diff --git a/src/backend/chat/moderation/chat-moderation-manager.js b/src/backend/chat/moderation/chat-moderation-manager.js index be2bb9715..0fccc986b 100644 --- a/src/backend/chat/moderation/chat-moderation-manager.js +++ b/src/backend/chat/moderation/chat-moderation-manager.js @@ -204,7 +204,12 @@ async function moderateMessage(chatMessage) { } const userExemptForUrlModeration = rolesManager.userIsInRole(chatMessage.userId, chatMessage.roles, chatModerationSettings.urlModeration.exemptRoles); - if (chatModerationSettings.urlModeration.enabled && !userExemptForUrlModeration && !permitCommand.hasTemporaryPermission(chatMessage.username)) { + if ( + chatModerationSettings.urlModeration.enabled && + !userExemptForUrlModeration && + !permitCommand.hasTemporaryPermission(chatMessage.username) && + !permitCommand.hasTemporaryPermission(chatMessage.userDisplayName.toLowerCase()) + ) { let shouldDeleteMessage = false; const message = chatMessage.rawText; const regex = utils.getUrlRegex(); diff --git a/src/backend/chat/moderation/url-permit-command.ts b/src/backend/chat/moderation/url-permit-command.ts index 077cb1452..272774658 100644 --- a/src/backend/chat/moderation/url-permit-command.ts +++ b/src/backend/chat/moderation/url-permit-command.ts @@ -66,12 +66,13 @@ class PermitManager { } const target = args[0].replace("@", ""); + const normalizedTarget = target.toLowerCase(); if (!target) { await twitchChat.sendChatMessage("Please specify a user to permit."); return; } - this._tempPermittedUsers.push(target); + this._tempPermittedUsers.push(normalizedTarget); logger.debug(`URL moderation: ${target} has been temporary permitted to post a URL.`); const message = commandOptions.permitDisplayTemplate.replace("{target}", target).replace("{duration}", commandOptions.permitDuration.toString()); @@ -81,7 +82,7 @@ class PermitManager { } setTimeout(() => { - this._tempPermittedUsers = this._tempPermittedUsers.filter(user => user !== target); + this._tempPermittedUsers = this._tempPermittedUsers.filter(user => user !== normalizedTarget); logger.debug(`URL moderation: Temporary URL permission for ${target} expired.`); }, commandOptions.permitDuration * 1000); }