mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add dbus SignalControl interface to register/verify/link accounts
This commit is contained in:
parent
48b2c7ff8a
commit
8f781c019f
9 changed files with 272 additions and 22 deletions
56
src/main/java/org/asamk/SignalControl.java
Normal file
56
src/main/java/org/asamk/SignalControl.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package org.asamk;
|
||||
|
||||
import org.freedesktop.dbus.DBusPath;
|
||||
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DBus interface for the org.asamk.SignalControl interface.
|
||||
* Including emitted Signals and returned Errors.
|
||||
*/
|
||||
public interface SignalControl extends DBusInterface {
|
||||
|
||||
void register(
|
||||
String number, boolean voiceVerification
|
||||
) throws Error.Failure, Error.InvalidNumber, Error.RequiresCaptcha;
|
||||
|
||||
void registerWithCaptcha(
|
||||
String number, boolean voiceVerification, String captcha
|
||||
) throws Error.Failure, Error.InvalidNumber, Error.RequiresCaptcha;
|
||||
|
||||
void verify(String number, String verificationCode) throws Error.Failure, Error.InvalidNumber;
|
||||
|
||||
void verifyWithPin(String number, String verificationCode, String pin) throws Error.Failure, Error.InvalidNumber;
|
||||
|
||||
String link(String newDeviceName) throws Error.Failure;
|
||||
|
||||
public String version();
|
||||
|
||||
List<DBusPath> listAccounts();
|
||||
|
||||
interface Error {
|
||||
|
||||
class Failure extends DBusExecutionException {
|
||||
|
||||
public Failure(final String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
class InvalidNumber extends DBusExecutionException {
|
||||
|
||||
public InvalidNumber(final String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
class RequiresCaptcha extends DBusExecutionException {
|
||||
|
||||
public RequiresCaptcha(final String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue