Skip to content

Commit

Permalink
Merge pull request matrix-org#480 from RasmusRendal/blockstickers
Browse files Browse the repository at this point in the history
Detect stickers as media
  • Loading branch information
turt2live authored May 11, 2023
2 parents 9023c78 + 57af056 commit 0e94bc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/protections/MessageIsMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class MessageIsMedia extends Protection {
const content = event['content'] || {};
const msgtype = content['msgtype'] || 'm.text';
const formattedBody = content['formatted_body'] || '';
const isMedia = msgtype === 'm.image' || msgtype === 'm.video' || formattedBody.toLowerCase().includes('<img');
const isMedia = msgtype === 'm.image' || msgtype === 'm.video' || msgtype === 'm.sticker' || formattedBody.toLowerCase().includes('<img');
if (isMedia) {
await mjolnir.managementRoomOutput.logMessage(LogLevel.WARN, "MessageIsMedia", `Redacting event from ${event['sender']} for posting an image/video. ${Permalinks.forEvent(roomId, event['event_id'], [new UserID(await mjolnir.client.getUserId()).domain])}`);
// Redact the event
Expand Down

0 comments on commit 0e94bc7

Please sign in to comment.