Completely hide toots matched by “irreversible” filters even if they got to the client (#11113)

Fixes #11090
This commit is contained in:
ThibG
2019-06-18 18:23:08 +02:00
committed by Eugen Rochko
parent 17747e2cd7
commit c8fae508cf
2 changed files with 12 additions and 2 deletions

View File

@ -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);
}