mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Detect stickers as media
This commit is contained in:
parent
9023c78e66
commit
57af0563ba
@ -38,7 +38,7 @@ export class MessageIsMedia extends Protection {
|
|||||||
const content = event['content'] || {};
|
const content = event['content'] || {};
|
||||||
const msgtype = content['msgtype'] || 'm.text';
|
const msgtype = content['msgtype'] || 'm.text';
|
||||||
const formattedBody = content['formatted_body'] || '';
|
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) {
|
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])}`);
|
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
|
// Redact the event
|
||||||
|
Loading…
Reference in New Issue
Block a user