Skip to content

Commit 708b4fd

Browse files
committed
Revert to storing application info, and display it to the author via API
1 parent 206194a commit 708b4fd

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

app/serializers/rest/status_serializer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
1212
attribute :pinned, if: :pinnable?
1313

1414
belongs_to :reblog, serializer: REST::StatusSerializer
15-
belongs_to :application, if: :user_shows_application?
15+
belongs_to :application, if: :show_application?
1616
belongs_to :account, serializer: REST::AccountSerializer
1717

1818
has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
@@ -38,8 +38,8 @@ def current_user?
3838
!current_user.nil?
3939
end
4040

41-
def user_shows_application?
42-
object.account.user_shows_application?
41+
def show_application?
42+
object.account.user_shows_application? || (current_user? && current_user.account_id == object.account_id)
4343
end
4444

4545
def visibility

app/services/post_status_service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def call(account, options = {})
2222
@options = options
2323
@text = @options[:text] || ''
2424
@in_reply_to = @options[:thread]
25-
@options.delete(:application) unless @account.user&.setting_show_application
2625

2726
return idempotency_duplicate if idempotency_given? && idempotency_duplicate?
2827

0 commit comments

Comments
 (0)