signal-cli/src/main/java/org/asamk/signal/DbusConfig.java
AsamK ca86c421eb Allow calling signal-cli without -u flag
For daemon command all local users will be exposed as dbus objects
If only one local user exists, all other commands will use that user,
otherwise a user has to be specified.
2021-01-16 09:00:03 +01:00

23 lines
595 B
Java

package org.asamk.signal;
public class DbusConfig {
private static final String SIGNAL_BUSNAME = "org.asamk.Signal";
private static final String SIGNAL_OBJECT_BASE_PATH = "/org/asamk/Signal";
public static String getBusname() {
return SIGNAL_BUSNAME;
}
public static String getObjectPath() {
return getObjectPath(null);
}
public static String getObjectPath(String username) {
if (username == null) {
return SIGNAL_OBJECT_BASE_PATH;
}
return SIGNAL_OBJECT_BASE_PATH + "/" + username.replace('+', '_');
}
}