]> cat aescling's git repositories - mastodon.git/commitdiff
Implement option to completely hide filtered toots
authorThibaut Girka <thib@sitedethib.com>
Fri, 12 Jul 2019 16:33:55 +0000 (18:33 +0200)
committerThibG <thib@sitedethib.com>
Sun, 14 Jul 2019 22:48:28 +0000 (00:48 +0200)
app/javascript/flavours/glitch/selectors/index.js

index 3424058d30e7fe7dac12eef2b1fca71d7f0e9aef..551a3ae3176fcf210c4cd7c0ee0c965829bb6cda 100644 (file)
@@ -89,10 +89,11 @@ export const makeGetStatus = () => {
       (state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
       (state, { id }) => state.getIn(['accounts', state.getIn(['statuses', id, 'account'])]),
       (state, { id }) => state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'account'])]),
+      (state, _) => state.getIn(['local_settings', 'filtering_behavior']),
       getFiltersRegex,
     ],
 
-    (statusBase, statusReblog, accountBase, accountReblog, filtersRegex) => {
+    (statusBase, statusReblog, accountBase, accountReblog, filteringBehavior, filtersRegex) => {
       if (!statusBase) {
         return null;
       }
@@ -116,6 +117,10 @@ export const makeGetStatus = () => {
 
       filtered = filtered || regex && regex.test(statusBase.get('search_index'));
 
+      if (filtered && filteringBehavior === 'drop') {
+        return null;
+      }
+
       return statusBase.withMutations(map => {
         map.set('reblog', statusReblog);
         map.set('account', accountBase);