mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Update libsignal-service-java
- Use session based number verification and registration
This commit is contained in:
parent
20b3563f21
commit
276ecef300
19 changed files with 359 additions and 158 deletions
|
@ -11,6 +11,7 @@ import org.asamk.signal.manager.api.CaptchaRequiredException;
|
|||
import org.asamk.signal.manager.api.IncorrectPinException;
|
||||
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
|
||||
import org.asamk.signal.manager.api.PinLockedException;
|
||||
import org.asamk.signal.manager.api.RateLimitException;
|
||||
import org.asamk.signal.manager.api.UserAlreadyExistsException;
|
||||
import org.freedesktop.dbus.DBusPath;
|
||||
|
||||
|
@ -59,6 +60,9 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
|
|||
}
|
||||
try (final RegistrationManager registrationManager = c.getNewRegistrationManager(number)) {
|
||||
registrationManager.register(voiceVerification, captcha);
|
||||
} catch (RateLimitException e) {
|
||||
String message = "Rate limit reached";
|
||||
throw new SignalControl.Error.Failure(message);
|
||||
} catch (CaptchaRequiredException e) {
|
||||
String message = captcha == null ? "Captcha required for verification." : "Invalid captcha given.";
|
||||
throw new SignalControl.Error.RequiresCaptcha(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue