Prevent non-admins from sending to announcement groups

Only reactions are allowed
This commit is contained in:
AsamK 2021-08-26 09:34:06 +02:00
parent 944c3327ee
commit 7f64a9812c
10 changed files with 76 additions and 32 deletions

View file

@ -17,6 +17,7 @@ import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.util.CommandUtil;
import org.asamk.signal.util.ErrorUtils;
@ -108,7 +109,7 @@ public class SendCommand implements DbusCommand, JsonRpcLocalCommand {
ErrorUtils.handleSendMessageResults(results.getResults());
} catch (AttachmentInvalidException | IOException e) {
throw new UnexpectedErrorException("Failed to send message: " + e.getMessage());
} catch (GroupNotFoundException | NotAGroupMemberException e) {
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new UserErrorException(e.getMessage());
}
}