mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-21 16:14:21 +01:00
32 lines
861 B
Java
32 lines
861 B
Java
package org.asamk.signal.commands;
|
|
|
|
import net.sourceforge.argparse4j.inf.Namespace;
|
|
import net.sourceforge.argparse4j.inf.Subparser;
|
|
|
|
import org.asamk.signal.manager.Manager;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class UpdateAccountCommand implements LocalCommand {
|
|
|
|
@Override
|
|
public void attachToSubparser(final Subparser subparser) {
|
|
subparser.help("Update the account attributes on the signal server.");
|
|
}
|
|
|
|
@Override
|
|
public int handleCommand(final Namespace ns, final Manager m) {
|
|
if (!m.isRegistered()) {
|
|
System.err.println("User is not registered.");
|
|
return 1;
|
|
}
|
|
try {
|
|
m.updateAccountAttributes();
|
|
return 0;
|
|
} catch (IOException e) {
|
|
System.err.println("UpdateAccount error: " + e.getMessage());
|
|
return 3;
|
|
}
|
|
}
|
|
}
|