about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-18 18:23:08 +0200
committerThibaut Girka <thib@sitedethib.com>2019-06-19 19:16:13 +0200
commit3771a993b7e19bc0e756e7f727f10ddd14c10c93 (patch)
treee512bfc11eae35fa601522672f47261a0972c484 /app/javascript/flavours/glitch/actions
parent032a6696227edc8f55d07d0243c10e11d6ac18da (diff)
[Glitch] Completely hide toots matched by “irreversible” filters even if they got to the client
Diffstat (limited to 'app/javascript/flavours/glitch/actions')
-rw-r--r--app/javascript/flavours/glitch/actions/notifications.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js
index 57fecf63d..2107503db 100644
--- a/app/javascript/flavours/glitch/actions/notifications.js
+++ b/app/javascript/flavours/glitch/actions/notifications.js
@@ -62,9 +62,14 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
     let filtered = false;
 
     if (notification.type === 'mention') {
+      const dropRegex   = regexFromFilters(filters.filter(filter => filter.get('irreversible')));
       const regex       = regexFromFilters(filters);
       const searchIndex = notification.status.spoiler_text + '\n' + unescapeHTML(notification.status.content);
 
+      if (dropRegex && dropRegex.test(searchIndex)) {
+        return;
+      }
+
       filtered = regex && regex.test(searchIndex);
     }