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,6 +4,7 @@ import org.asamk.Signal;
|
|||
import org.asamk.signal.BaseConfig;
|
||||
import org.asamk.signal.manager.AttachmentInvalidException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.NotMasterDeviceException;
|
||||
import org.asamk.signal.manager.groups.GroupId;
|
||||
import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
|
||||
import org.asamk.signal.manager.groups.GroupNotFoundException;
|
||||
|
@ -260,6 +261,8 @@ public class DbusSignalImpl implements Signal {
|
|||
m.setContactName(number, name);
|
||||
} catch (InvalidNumberException e) {
|
||||
throw new Error.InvalidNumber(e.getMessage());
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,6 +272,8 @@ public class DbusSignalImpl implements Signal {
|
|||
m.setContactBlocked(number, blocked);
|
||||
} catch (InvalidNumberException e) {
|
||||
throw new Error.InvalidNumber(e.getMessage());
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue