mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-26 09:04:19 +01:00
Refactor set blocked methods to accept multiple recipientIds/groupIds
This commit is contained in:
@@ -516,7 +516,7 @@ public class DbusSignalImpl implements Signal {
|
||||
@Override
|
||||
public void setContactBlocked(final String number, final boolean blocked) {
|
||||
try {
|
||||
m.setContactBlocked(getSingleRecipientIdentifier(number, m.getSelfNumber()), blocked);
|
||||
m.setContactsBlocked(List.of(getSingleRecipientIdentifier(number, m.getSelfNumber())), blocked);
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
} catch (IOException e) {
|
||||
@@ -529,7 +529,7 @@ public class DbusSignalImpl implements Signal {
|
||||
@Override
|
||||
public void setGroupBlocked(final byte[] groupId, final boolean blocked) {
|
||||
try {
|
||||
m.setGroupBlocked(getGroupId(groupId), blocked);
|
||||
m.setGroupsBlocked(List.of(getGroupId(groupId)), blocked);
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
} catch (GroupNotFoundException e) {
|
||||
@@ -1287,7 +1287,7 @@ public class DbusSignalImpl implements Signal {
|
||||
|
||||
private void setIsBlocked(final boolean isBlocked) {
|
||||
try {
|
||||
m.setGroupBlocked(groupId, isBlocked);
|
||||
m.setGroupsBlocked(List.of(groupId), isBlocked);
|
||||
} catch (NotMasterDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
} catch (GroupNotFoundException e) {
|
||||
|
||||
Reference in New Issue
Block a user