Adjust the scam detector

* Ignore HTML tags in the message so we don't sometimes false-positive
  based on the base64-encoded image data shared in chat.
* Remove 'session' from the messenger list, it is a more obscure
  messenger and source of too many false positives.
This commit is contained in:
Noah 2025-01-30 20:13:27 -08:00
parent 200c025a78
commit ba5fb2d48d

View File

@ -9,15 +9,20 @@ export default {
}; };
}, },
computed: { computed: {
// Message sans HTML tags, so we don't false positive on base64-encoded image data.
filteredMessage() {
return this.message.replace(/<(.|\n)+?>/g, "");
},
// Scam/spam detection and warning. // Scam/spam detection and warning.
maybeWhatsAppScam() { maybeWhatsAppScam() {
return this.message.match(/whats\s*app/i); return this.filteredMessage.match(/whats\s*app/i);
}, },
maybePhoneNumberScam() { maybePhoneNumberScam() {
return this.message.match(/\b(phone number|phone|digits|cell number|your number|ur number|text me)\b/i); return this.filteredMessage.match(/\b(phone number|phone|digits|cell number|your number|ur number|text me)\b/i);
}, },
maybeOffPlatformScam() { maybeOffPlatformScam() {
return this.message.match(/\b(telegram|signal|kik|session)\b/i); return this.filteredMessage.match(/\b(telegram|signal|kik)\b/i);
}, },
}, },
methods: { methods: {