about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorreverite <samantha@chalker.io>2019-01-29 21:13:22 -0800
committerreverite <samantha@chalker.io>2019-01-29 21:13:22 -0800
commit3510128c51f615634350a93dfb19053519d65454 (patch)
tree85bac2a16c9c2371679d43311d9d6b069c988e94 /app/serializers
parentc5b97d18762dce34a95ca42e9335e672c66953c0 (diff)
parentc2ccdad102cae9bc3dc94d1d6c6f306ca0366370 (diff)
Merge branch 'master' into production
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