about summary refs log tree commit diff
path: root/app/serializers/rest/status_serializer.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-21 22:40:26 +0100
committerThibG <thib@sitedethib.com>2019-01-27 13:56:41 +0100
commitf938800ef4fcd7f63310e3f1d021c809f60ea448 (patch)
treed66345293a962ba11d8502f8fa97458284730a04 /app/serializers/rest/status_serializer.rb
parent05415fa5d38e988d967cc783dd2eb0852852fce2 (diff)
Revert to storing application info, and display it to the author via API
Diffstat (limited to 'app/serializers/rest/status_serializer.rb')
-rw-r--r--app/serializers/rest/status_serializer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index f2b5febae..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, if: :user_shows_application?
+  belongs_to :application, if: :show_application?
   belongs_to :account, serializer: REST::AccountSerializer
 
   has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
@@ -40,8 +40,8 @@ class REST::StatusSerializer < ActiveModel::Serializer
     !current_user.nil?
   end
 
-  def user_shows_application?
-    object.account.user_shows_application?
+  def show_application?
+    object.account.user_shows_application? || (current_user? && current_user.account_id == object.account_id)
   end
 
   def visibility