about summary refs log tree commit diff
path: root/app/javascript/mastodon/selectors/index.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-18 18:23:08 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-06-18 18:23:08 +0200
commitc8fae508cfde704b514cfa5398cd2dd584e77706 (patch)
tree1f86026f6b297eaccef7cc94be8f184b1ae7a02f /app/javascript/mastodon/selectors/index.js
parent17747e2cd72c9142c508b6de64717c21d71dc189 (diff)
Completely hide toots matched by “irreversible” filters even if they got to the client (#11113)
Fixes #11090
Diffstat (limited to 'app/javascript/mastodon/selectors/index.js')
-rw-r--r--app/javascript/mastodon/selectors/index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js
index 70f08a8eb..ff6c7fdfb 100644
--- a/app/javascript/mastodon/selectors/index.js
+++ b/app/javascript/mastodon/selectors/index.js
@@ -84,8 +84,13 @@ export const makeGetStatus = () => {
         statusReblog = null;
       }
 
-      const regex    = (accountReblog || accountBase).get('id') !== me && regexFromFilters(filters);
-      const filtered = regex && regex.test(statusBase.get('reblog') ? statusReblog.get('search_index') : statusBase.get('search_index'));
+      const dropRegex = (accountReblog || accountBase).get('id') !== me && regexFromFilters(filters.filter(filter => filter.get('irreversible')));
+      if (dropRegex && dropRegex.test(statusBase.get('reblog') ? statusReblog.get('search_index') : statusBase.get('search_index'))) {
+        return null;
+      }
+
+      const regex     = (accountReblog || accountBase).get('id') !== me && regexFromFilters(filters);
+      const filtered  = regex && regex.test(statusBase.get('reblog') ? statusReblog.get('search_index') : statusBase.get('search_index'));
 
       return statusBase.withMutations(map => {
         map.set('reblog', statusReblog);