mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 20:40:38 +00:00
Add blocking/unblocking for groups
This commit is contained in:
parent
5ab3152a40
commit
ff478a5b0a
8 changed files with 116 additions and 62 deletions
|
@ -701,6 +701,19 @@ public class Manager implements Signal {
|
|||
account.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupBlocked(final byte[] groupId, final boolean blocked) throws GroupNotFoundException {
|
||||
GroupInfo group = getGroup(groupId);
|
||||
if (group == null) {
|
||||
throw new GroupNotFoundException(groupId);
|
||||
} else {
|
||||
System.err.println((blocked ? "Blocking" : "Unblocking") + " group " + Base64.encodeBytes(groupId));
|
||||
group.blocked = blocked;
|
||||
account.getGroupStore().updateGroup(group);
|
||||
account.save();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> getGroupIds() {
|
||||
List<GroupInfo> groups = getGroups();
|
||||
|
@ -1441,7 +1454,7 @@ public class Manager implements Signal {
|
|||
out.write(new DeviceGroup(record.groupId, Optional.fromNullable(record.name),
|
||||
new ArrayList<>(record.getMembers()), createGroupAvatarAttachment(record.groupId),
|
||||
record.active, Optional.fromNullable(info != null ? info.messageExpirationTime : null),
|
||||
Optional.fromNullable(record.color), false));
|
||||
Optional.fromNullable(record.color), record.blocked));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue