Do not allow send to announcement only groups

This commit is contained in:
Josh Perez 2022-10-05 15:43:37 -04:00 committed by GitHub
parent 5219cdf2c9
commit b0203e8909
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View file

@ -190,6 +190,14 @@ export async function sendStoryMessage(
return;
}
if (group.get('announcementsOnly') && !group.areWeAdmin()) {
log.warn(
'stories.sendStoryMessage: cannot send to an announcement only group as a non-admin',
conversationId
);
return;
}
const groupTimestamp = timestamp + index;
const myId = window.ConversationController.getOurConversationIdOrThrow();