diff options
author | ThibG <thib@sitedethib.com> | 2019-06-18 18:23:08 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-22 01:35:01 -0600 |
commit | 052ee55210e98bb2e2bae0f05008e7eaeddcb8d1 (patch) | |
tree | b3d61f58505010f1f97c5ba9574d956bf3e0d0c7 /app/javascript/flavours/glitch/actions | |
parent | 83657becd1f419e776e8e22cad9e54b40e593a45 (diff) |
port glitch-soc@`3771a99` to monserfork: [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.js | 5 |
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); } |