X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/3290a5bf4d642beaef6584a700aab8f2da3af6e0..dda23e76ac4ed8d88f23c9f39b7110460a8a1ed5:/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java diff --git a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java index 5ad14537..65c210fc 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java @@ -4,6 +4,7 @@ import org.asamk.Signal; import org.asamk.signal.BaseConfig; import org.asamk.signal.manager.Manager; import org.asamk.signal.manager.api.AttachmentInvalidException; +import org.asamk.signal.manager.api.CaptchaRejectedException; import org.asamk.signal.manager.api.DeviceLinkUrl; import org.asamk.signal.manager.api.GroupId; import org.asamk.signal.manager.api.GroupInviteLinkUrl; @@ -159,8 +160,10 @@ public class DbusSignalImpl implements Signal, AutoCloseable { m.submitRateLimitRecaptchaChallenge(challenge, captcha); } catch (IOException e) { throw new Error.Failure("Submit challenge error: " + e.getMessage()); + } catch (CaptchaRejectedException e) { + throw new Error.Failure( + "Captcha rejected, it may be outdated, already used or solved from a different IP address."); } - } @Override @@ -1177,6 +1180,8 @@ public class DbusSignalImpl implements Signal, AutoCloseable { try { m.removeLinkedDevices(device.id()); updateDevices(); + } catch (NotPrimaryDeviceException e) { + throw new Error.Failure("This command doesn't work on linked devices."); } catch (IOException e) { throw new Error.Failure(e.getMessage()); } @@ -1187,7 +1192,7 @@ public class DbusSignalImpl implements Signal, AutoCloseable { throw new Error.Failure("Only the name of this device can be changed"); } try { - m.updateAccountAttributes(name); + m.updateAccountAttributes(name, null, null, null); // update device list updateDevices(); } catch (IOException e) {