mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
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.
This commit is contained in:
parent
a97bbf8608
commit
ca86c421eb
19 changed files with 356 additions and 172 deletions
|
@ -288,6 +288,22 @@ public class Manager implements Closeable {
|
|||
return new Manager(account, pathConfig, serviceConfiguration, userAgent);
|
||||
}
|
||||
|
||||
public static List<String> getAllLocalUsernames(File settingsPath) {
|
||||
PathConfig pathConfig = PathConfig.createDefault(settingsPath);
|
||||
final File dataPath = pathConfig.getDataPath();
|
||||
final File[] files = dataPath.listFiles();
|
||||
|
||||
if (files == null) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
return Arrays.stream(files)
|
||||
.filter(File::isFile)
|
||||
.map(File::getName)
|
||||
.filter(file -> PhoneNumberFormatter.isValidNumber(file, null))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void checkAccountState() throws IOException {
|
||||
if (accountManager.getPreKeysCount() < ServiceConfig.PREKEY_MINIMUM_COUNT) {
|
||||
refreshPreKeys();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue