0
0
Fork 0

Make displaying application used to toot opt-in (#9897)

* Make storing and displaying application used to toot opt-in

* Revert to storing application info, and display it to the author via API
This commit is contained in:
ThibG 2019-02-02 19:18:15 +01:00 committed by Eugen Rochko
parent bcfff65195
commit ed30110618
9 changed files with 24 additions and 3 deletions

View file

@ -12,7 +12,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
attribute :pinned, if: :pinnable?
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
@ -38,6 +38,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