From 3771a993b7e19bc0e756e7f727f10ddd14c10c93 Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 18 Jun 2019 18:23:08 +0200 Subject: [Glitch] Completely hide toots matched by “irreversible” filters even if they got to the client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/actions/notifications.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/javascript/flavours/glitch/actions/notifications.js') 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); } -- cgit