about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-15 22:40:20 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-15 22:40:20 -0500
commit7bbcf793bc75b44f2b20de77b7774759af60cd90 (patch)
treed8d441c2d8cf245b28651efa14f6460841a8e304 /app/controllers/api
parentf783ec279d03b7b56c96af5e18e0dd8c7a0710a1 (diff)
custom filters now have an option to add or override content warnings; filter caching has been fixed
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/filters_controller.rb2
-rw-r--r--app/controllers/api/v1/statuses_controller.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/api/v1/filters_controller.rb b/app/controllers/api/v1/filters_controller.rb
index 48177f41a..760218d62 100644
--- a/app/controllers/api/v1/filters_controller.rb
+++ b/app/controllers/api/v1/filters_controller.rb
@@ -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, context: [])
+    params.permit(:phrase, :expires_in, :irreversible, :whole_word, :exclude_media, :media_only, :status_text, :spoiler, :tags, :custom_cw, :override_cw, context: [])
   end
 end
diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb
index fa3483822..a5ea12591 100644
--- a/app/controllers/api/v1/statuses_controller.rb
+++ b/app/controllers/api/v1/statuses_controller.rb
@@ -2,6 +2,7 @@
 
 class Api::V1::StatusesController < Api::BaseController
   include Authorization
+  include FilterHelper
 
   before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy]
   before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only:   [:create, :destroy]
@@ -18,6 +19,8 @@ class Api::V1::StatusesController < Api::BaseController
 
   def show
     @status = cache_collection([@status], Status).first
+    # make sure any custom cws are applied
+    phrase_filtered?(@status, current_account.id, 'thread') unless current_account.nil?
     render json: @status, serializer: REST::StatusSerializer
   end