]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/manager/Manager.java
Update SignalAccount storage on unregister
[signal-cli] / src / main / java / org / asamk / signal / manager / Manager.java
index 492842abb62cc21a948c65624f64701aacc41e89..8672684aa02a09ee4d5264f7825b533fb0f8694c 100644 (file)
@@ -137,6 +137,7 @@ public class Manager implements Signal {
             }
         } catch (AuthorizationFailedException e) {
             System.err.println("Authorization failed, was the number registered elsewhere?");
+            throw e;
         }
     }
 
@@ -208,6 +209,9 @@ public class Manager implements Signal {
         // If this is the master device, other users can't send messages to this number anymore.
         // If this is a linked device, other users can still send messages, but this device doesn't receive them anymore.
         accountManager.setGcmId(Optional.<String>absent());
+
+        account.setRegistered(false);
+        account.save();
     }
 
     public String getDeviceLinkUri() throws TimeoutException, IOException {