// 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.absent());
+
+ account.setRegistered(false);
+ }
+
+ public void deleteAccount() throws IOException {
accountManager.deleteAccount();
account.setRegistered(false);
Use "updateAccount" to undo this.
To remove a linked device, use "removeDevice" from the master device.
+*--delete-account*::
+Delete account completely from server. Cannot be undone without loss. You will
+have to be readded to each group.
+
+CAUTION: Only delete your account if you won't use this number again!
+
=== updateAccount
Update the account attributes on the signal server.
package org.asamk.signal.commands;
+import net.sourceforge.argparse4j.impl.Arguments;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
@Override
public void attachToSubparser(final Subparser subparser) {
subparser.help("Unregister the current device from the signal server.");
+ subparser.addArgument("--delete-account")
+ .help("Delete account completely from server. CAUTION: Only do this if you won't use this number again!")
+ .action(Arguments.storeTrue());
}
@Override
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
try {
- m.unregister();
+ if (ns.getBoolean("delete_account")) {
+ m.deleteAccount();
+ } else {
+ m.unregister();
+ }
} catch (IOException e) {
+ e.printStackTrace();
throw new IOErrorException("Unregister error: " + e.getMessage());
}
}