about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-21 19:36:33 +0100
committerThibG <thib@sitedethib.com>2019-01-27 13:56:41 +0100
commit05415fa5d38e988d967cc783dd2eb0852852fce2 (patch)
treebfc59aee525aaef4b8de40316574872dd4a696a7 /app/serializers
parent64cb9b691310a8b955e23b57ed0af51686f3ceb4 (diff)
Make storing and displaying application used to toot opt-in
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/status_serializer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index dd8482eea..f2b5febae 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -14,7 +14,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
   attribute :local_only if :local?
 
   belongs_to :reblog, serializer: REST::StatusSerializer
-  belongs_to :application
+  belongs_to :application, if: :user_shows_application?
   belongs_to :account, serializer: REST::AccountSerializer
 
   has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
@@ -40,6 +40,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
     !current_user.nil?
   end
 
+  def user_shows_application?
+    object.account.user_shows_application?
+  end
+
   def visibility
     # This visibility is masked behind "private"
     # to avoid API changes because there are no