Skip to content

Commit

Permalink
Fix: フレンドサーバーおよびMisskeyで編集が連合できない問題 (#168)
Browse files Browse the repository at this point in the history
* Fix: フレンドサーバー間で編集が機能しない問題

* リファクタリング
  • Loading branch information
kmycode authored Oct 22, 2023
1 parent e3ec2f9 commit bcb3acd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions app/workers/activitypub/status_update_distribution_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,27 @@ def perform(status_id, options = {})

protected

def activity
def build_activity(for_misskey: false, for_friend: false)
ActivityPub::ActivityPresenter.new(
id: [ActivityPub::TagManager.instance.uri_for(@status), '#updates/', @status.edited_at.to_i].join,
type: 'Update',
actor: ActivityPub::TagManager.instance.uri_for(@status.account),
published: @status.edited_at,
to: ActivityPub::TagManager.instance.to(@status),
cc: ActivityPub::TagManager.instance.cc(@status),
to: for_friend ? ActivityPub::TagManager.instance.to_for_friend(@status) : ActivityPub::TagManager.instance.to(@status),
cc: for_misskey ? ActivityPub::TagManager.instance.cc_for_misskey : ActivityPub::TagManager.instance.cc(@status),
virtual_object: @status
)
end

def activity
build_activity
end

def activity_for_misskey
build_activity(for_misskey: true)
end

def activity_for_friend
build_activity(for_friend: true)
end
end

0 comments on commit bcb3acd

Please sign in to comment.