mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Prevent updateContact and block commands on linked devices
The changes would be overwritten with the next sync anyway Fixes #600
This commit is contained in:
parent
312c6c8bb2
commit
36475bb632
6 changed files with 38 additions and 5 deletions
|
@ -4,7 +4,9 @@ import net.sourceforge.argparse4j.inf.Namespace;
|
|||
import net.sourceforge.argparse4j.inf.Subparser;
|
||||
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.NotMasterDeviceException;
|
||||
import org.asamk.signal.manager.groups.GroupIdFormatException;
|
||||
import org.asamk.signal.manager.groups.GroupNotFoundException;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
@ -30,6 +32,8 @@ public class UnblockCommand implements LocalCommand {
|
|||
m.setContactBlocked(contactNumber, false);
|
||||
} catch (InvalidNumberException e) {
|
||||
logger.warn("Invalid number: {}", contactNumber);
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new UserErrorException("This command doesn't work on linked devices.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue