about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-09-24 20:40:58 -0500
committermultiple creatures <dev@multiple-creature.party>2019-09-24 20:40:58 -0500
commit5fdd29f80fe0020629129767bb0633fe84f55da3 (patch)
tree0bc905c09c44ca60af17f91f7ad04cb06bb9cb55 /app/controllers
parent3c1f1feef14ee9ea0a002010c927ac6556f00801 (diff)
work around vanilladon apps breaking when a custom filter uses monsterfork cw extensions - supporting clients can explicitly ask for those by setting `?all=1`
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v1/filters_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/v1/filters_controller.rb b/app/controllers/api/v1/filters_controller.rb
index 760218d62..6cba4b23f 100644
--- a/app/controllers/api/v1/filters_controller.rb
+++ b/app/controllers/api/v1/filters_controller.rb
@@ -35,7 +35,7 @@ class Api::V1::FiltersController < Api::BaseController
   private
 
   def set_filters
-    @filters = current_account.custom_filters
+    @filters = params['all'].to_i == 1 ? current_account.custom_filters : current_account.custom_filters.where(custom_cw: nil)
   end
 
   def set_filter
@@ -43,6 +43,6 @@ class Api::V1::FiltersController < Api::BaseController
   end
 
   def resource_params
-    params.permit(:phrase, :expires_in, :irreversible, :whole_word, :exclude_media, :media_only, :status_text, :spoiler, :tags, :custom_cw, :override_cw, context: [])
+    params.permit(:phrase, :expires_in, :whole_word, :exclude_media, :media_only, :status_text, :spoiler, :tags, :custom_cw, :override_cw, context: [])
   end
 end