mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-07 23:44:33 +00:00
Revert to storing application info, and display it to the author via API
This commit is contained in:
parent
05415fa5d3
commit
f938800ef4
|
@ -14,7 +14,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||||
attribute :local_only if :local?
|
attribute :local_only if :local?
|
||||||
|
|
||||||
belongs_to :reblog, serializer: REST::StatusSerializer
|
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
|
belongs_to :account, serializer: REST::AccountSerializer
|
||||||
|
|
||||||
has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
|
has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
|
||||||
|
@ -40,8 +40,8 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||||
!current_user.nil?
|
!current_user.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_shows_application?
|
def show_application?
|
||||||
object.account.user_shows_application?
|
object.account.user_shows_application? || (current_user? && current_user.account_id == object.account_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def visibility
|
def visibility
|
||||||
|
|
|
@ -22,7 +22,6 @@ class PostStatusService < BaseService
|
||||||
@options = options
|
@options = options
|
||||||
@text = @options[:text] || ''
|
@text = @options[:text] || ''
|
||||||
@in_reply_to = @options[:thread]
|
@in_reply_to = @options[:thread]
|
||||||
@options.delete(:application) unless @account.user&.setting_show_application
|
|
||||||
|
|
||||||
return idempotency_duplicate if idempotency_given? && idempotency_duplicate?
|
return idempotency_duplicate if idempotency_given? && idempotency_duplicate?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue