Skip to content

Commit

Permalink
スタンプに認証情報を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Oct 11, 2023
1 parent 6823ae3 commit 842a932
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/activitypub/activity/like.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def relay_for_emoji_reaction
end

def relay_friend_for_emoji_reaction
return unless @json['signature'].present? && @original_status.public_visibility?
return unless @json['signature'].present? && @original_status.distributable_friend?

ActivityPub::DeliveryWorker.push_bulk(FriendDomain.distributables.pluck(:inbox_url)) do |inbox_url|
[Oj.dump(@json), @original_status.account.id, inbox_url]
Expand Down
4 changes: 4 additions & 0 deletions app/models/emoji_reaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def remote_custom_emoji?
custom_emoji? && !custom_emoji.local?
end

def sign?
status&.distributable_friend?
end

private

def refresh_cache
Expand Down
4 changes: 4 additions & 0 deletions app/models/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,10 @@ def unlink_from_conversations!
end
end

def distributable_friend?
public_visibility? || public_unlisted_visibility? || (unlisted_visibility? && (public_searchability? || public_unlisted_searchability?))
end

private

def update_status_stat!(attrs)
Expand Down

0 comments on commit 842a932

Please sign in to comment.