mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-03 20:50:38 +00:00
Add parameter to specify DBus name
This way multiple instances of signal-cli can run in daemon-mode in parallel. This was not possible previously as they tried to create the same DBus. This is rather my own quick fix and I guess there exists a cleaner way. (Maybe let the parser parse the busname directly to `SIGNAL_BUSNAME`.)
This commit is contained in:
parent
f3ecddba6f
commit
29b538677a
2 changed files with 9 additions and 1 deletions
|
@ -42,6 +42,7 @@ public class DaemonCommand implements LocalCommand {
|
|||
try {
|
||||
try {
|
||||
int busType;
|
||||
String busName;
|
||||
if (ns.getBoolean("system")) {
|
||||
busType = DBusConnection.SYSTEM;
|
||||
} else {
|
||||
|
@ -49,7 +50,12 @@ public class DaemonCommand implements LocalCommand {
|
|||
}
|
||||
conn = DBusConnection.getConnection(busType);
|
||||
conn.exportObject(SIGNAL_OBJECTPATH, m);
|
||||
conn.requestBusName(SIGNAL_BUSNAME);
|
||||
busName = ns.getString("busname");
|
||||
if (busName == null) {
|
||||
conn.requestBusName(SIGNAL_BUSNAME);
|
||||
} else {
|
||||
conn.requestBusName(busName);
|
||||
}
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Missing native library dependency for dbus service: " + e.getMessage());
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue