about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorreverite <samantha@chalker.io>2019-01-29 21:12:50 -0800
committerreverite <samantha@chalker.io>2019-01-29 21:12:50 -0800
commitc2ccdad102cae9bc3dc94d1d6c6f306ca0366370 (patch)
tree85bac2a16c9c2371679d43311d9d6b069c988e94 /app/serializers
parent50dc62ea3a36039463032aa2e712471859d9d9b6 (diff)
parent48d00ac0d9ad703fa3605337b0866c8ce6f21b28 (diff)
Merge branch 'glitch'
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..b72eebb10 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: :show_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 show_application?
+    object.account.user_shows_application? || (current_user? && current_user.account_id == object.account_id)
+  end
+
   def visibility
     # This visibility is masked behind "private"
     # to avoid API changes because there are no