Skip to content

Commit e900c93

Browse files
committed
Fix triggering spam if mention twice and then don't mention.
1 parent 66870ee commit e900c93

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/message-routing/message-router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class MessageRouter {
109109
this.spamDetection.checkListOfRecentUrlsForSpam(
110110
messageContent,
111111
this.chatCache.getViewerUrlList(user),
112+
this.chatCache.messageUrlSpamUser,
112113
),
113114
];
114115

lib/services/spam-detection.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ class SpamDetection {
118118
return this.isSimilarityAboveThreshold(matchPercents);
119119
}
120120

121-
checkListOfRecentUrlsForSpam(message, urlList) {
121+
checkListOfRecentUrlsForSpam(message, urlList, mentionUser = null) {
122+
if (mentionUser && !this.messageMatching.mentionsUser(message, mentionUser)) return false;
122123
return this.messageMatching.getLinks(message).some((link) => {
123124
return (
124125
urlList.filter((url) => url === link.hostname + link.pathname).length >=

0 commit comments

Comments
 (0)