DBus listen(number<s>) and daemon \-\-number

implement listen method for DBus
listen(number<s>) -> <>::

add \-\-number option to daemon subcommand
- permits starting daemon in anonymous mode with zero or more numbers
- numbers may be added to daemon with listen() and removed with unlisten()

change misleading "dataPath" to `settingsPath` in App.java
- settingsPath=~/.local/share/signal-cli, while dataPath=~/.local/share/signal-cli/data

only use FileLock when necessary in App.java, and unlock when appropriate

update documentation
This commit is contained in:
John Freed 2021-10-05 13:17:30 +02:00
parent 26594dd0ee
commit 690636b83d
12 changed files with 317 additions and 64 deletions

View file

@ -94,6 +94,8 @@ public interface Manager extends Closeable {
void checkAccountState() throws IOException;
SignalAccount getAccount();
Map<String, Pair<String, UUID>> areUsersRegistered(Set<String> numbers) throws IOException;
void updateAccountAttributes(String deviceName) throws IOException;

View file

@ -247,6 +247,11 @@ public class ManagerImpl implements Manager {
return account.getUsername();
}
@Override
public SignalAccount getAccount() {
return account;
}
@Override
public void checkAccountState() throws IOException {
if (account.getLastReceiveTimestamp() == 0) {

View file

@ -116,8 +116,9 @@ public class RegistrationManager implements Closeable {
return new RegistrationManager(account, pathConfig, serviceConfiguration, userAgent);
}
public void register(boolean voiceVerification, String captcha) throws IOException {
public void register(boolean voiceVerification, String captchaString) throws IOException {
final ServiceResponse<RequestVerificationCodeResponse> response;
final var captcha = captchaString == null ? null : captchaString.replace("signalcaptcha://", "");
if (voiceVerification) {
response = accountManager.requestVoiceVerificationCode(getDefaultLocale(),
Optional.fromNullable(captcha),