about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-12 18:33:55 +0200
committerThibG <thib@sitedethib.com>2019-07-15 00:48:28 +0200
commit42b59b730b291e733f5920a77f8d58dd9d24e764 (patch)
treebe221b258960d193414e556eba32c991ae6d9235 /app
parent16b79a6237b90fd0c2550794631a7ced146b01e3 (diff)
Implement option to completely hide filtered toots
Diffstat (limited to 'app')
-rw-r--r--app/javascript/flavours/glitch/selectors/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js
index 3424058d3..551a3ae31 100644
--- a/app/javascript/flavours/glitch/selectors/index.js
+++ b/app/javascript/flavours/glitch/selectors/index.js
@@ -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);