Restrict blocking of group to master device

This commit is contained in:
AsamK 2021-10-12 20:49:41 +02:00
parent e977f38bdd
commit 997b3c6a2a
5 changed files with 13 additions and 2 deletions

View file

@ -184,7 +184,7 @@ public interface Manager extends Closeable {
void setGroupBlocked(
GroupId groupId, boolean blocked
) throws GroupNotFoundException, IOException;
) throws GroupNotFoundException, IOException, NotMasterDeviceException;
void setExpirationTimer(
RecipientIdentifier.Single recipient, int messageExpirationTimer

View file

@ -714,7 +714,10 @@ public class ManagerImpl implements Manager {
@Override
public void setGroupBlocked(
final GroupId groupId, final boolean blocked
) throws GroupNotFoundException, IOException {
) throws GroupNotFoundException, IOException, NotMasterDeviceException {
if (!account.isMasterDevice()) {
throw new NotMasterDeviceException();
}
groupHelper.setGroupBlocked(groupId, blocked);
// TODO cycle our profile key
syncHelper.sendBlockedList();