Add dbus SignalControl interface to register/verify/link accounts

This commit is contained in:
AsamK 2021-04-03 19:13:12 +02:00
parent 48b2c7ff8a
commit 8f781c019f
9 changed files with 272 additions and 22 deletions

View file

@ -14,6 +14,7 @@ import org.asamk.signal.commands.LocalCommand;
import org.asamk.signal.commands.MultiLocalCommand;
import org.asamk.signal.commands.ProvisioningCommand;
import org.asamk.signal.commands.RegistrationCommand;
import org.asamk.signal.commands.SignalCreator;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
@ -235,7 +236,17 @@ public class App {
}
}
command.handleCommand(ns, managers);
command.handleCommand(ns, managers, new SignalCreator() {
@Override
public ProvisioningManager getNewProvisioningManager() {
return ProvisioningManager.init(dataPath, serviceEnvironment, BaseConfig.USER_AGENT);
}
@Override
public RegistrationManager getNewRegistrationManager(String username) throws IOException {
return RegistrationManager.init(username, dataPath, serviceEnvironment, BaseConfig.USER_AGENT);
}
});
for (var m : managers) {
try {