about summary refs log tree commit diff
path: root/app/serializers
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/serializers
parentf783ec279d03b7b56c96af5e18e0dd8c7a0710a1 (diff)
custom filters now have an option to add or override content warnings; filter caching has been fixed
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/status_serializer.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index 7146d8108..d41d1ba43 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -1,6 +1,8 @@
 # frozen_string_literal: true
 
 class REST::StatusSerializer < ActiveModel::Serializer
+  include Redisable
+
   attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id,
              :sensitive, :spoiler_text, :visibility, :language,
              :uri, :url, :replies_count, :reblogs_count,
@@ -55,6 +57,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
     object.account.user_shows_application? || owner?
   end
 
+  def spoiler_text
+    redis.hget("custom_cw:#{current_user&.account_id}", object.id) || object.spoiler_text
+  end
+
   def visibility
     if object.limited_visibility?
       'private'