diff options
author | ThibG <thib@sitedethib.com> | 2019-06-18 18:23:08 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-06-18 18:23:08 +0200 |
commit | c8fae508cfde704b514cfa5398cd2dd584e77706 (patch) | |
tree | 1f86026f6b297eaccef7cc94be8f184b1ae7a02f /app/javascript/mastodon/actions/notifications.js | |
parent | 17747e2cd72c9142c508b6de64717c21d71dc189 (diff) |
Completely hide toots matched by “irreversible” filters even if they got to the client (#11113)
Fixes #11090
Diffstat (limited to 'app/javascript/mastodon/actions/notifications.js')
-rw-r--r-- | app/javascript/mastodon/actions/notifications.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index b0861fc6b..88788eec9 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -48,9 +48,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); } |