* Fix mastodon version * テーブル作成 * Wip: フレンドサーバーフォローの承認を受信 * Wip: フレンド申請拒否を受信 * Wip: フォローリクエストを受理 * Wip: 相手からのフォロー・アンフォローを受理 * 普通のフォローとフレンドサーバーのフォローを区別するテストを追加 * ドメインブロックによるフォロー拒否 * ドメインブロックしたあと、申請中のフォロリクを取り下げる処理 * スタブに条件を追加 * Wip: 相手からのDelete信号に対応 * DB定義が消えていたので修正 * Wip: ローカル公開投稿をフレンドに送信する処理など * Wip: 未収載+誰でもの投稿をフレンドに送る設定 * Wip: ローカル公開をそのまま送信する設定を考慮 * Fix test * Wip: 他サーバーからのローカル公開投稿の受け入れ * Wip: Web画面作成 * Fix test * Wip: ローカル公開を連合TLに流す * Wip: フレンドサーバーの削除ボタン * Wip: メール通知や設定のテストなど * Wip: 翻訳を作成 * Fix: 却下されたあとフォローボタンが表示されない問題 * Wip: 編集できない問題 * 有効にしていないフレンドサーバーをリストで無効表示
60 lines
1.6 KiB
Ruby
60 lines
1.6 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::DistributionWorker < ActivityPub::RawDistributionWorker
|
|
# Distribute a new status or an edit of a status to all the places
|
|
# where the status is supposed to go or where it was interacted with
|
|
def perform(status_id)
|
|
@status = Status.find(status_id)
|
|
@account = @status.account
|
|
|
|
distribute!
|
|
rescue ActiveRecord::RecordNotFound
|
|
true
|
|
end
|
|
|
|
protected
|
|
|
|
def inboxes
|
|
@inboxes ||= status_reach_finder.inboxes
|
|
end
|
|
|
|
def inboxes_for_misskey
|
|
@inboxes_for_misskey ||= status_reach_finder.inboxes_for_misskey
|
|
end
|
|
|
|
def inboxes_for_friend
|
|
@inboxes_for_friend ||= status_reach_finder.inboxes_for_friend
|
|
end
|
|
|
|
def status_reach_finder
|
|
@status_reach_finder ||= StatusReachFinder.new(@status)
|
|
end
|
|
|
|
def payload
|
|
@payload ||= Oj.dump(serialize_payload(activity, ActivityPub::ActivitySerializer, signer: @account))
|
|
end
|
|
|
|
def payload_for_misskey
|
|
@payload_for_misskey ||= Oj.dump(serialize_payload(activity_for_misskey, ActivityPub::ActivityForMisskeySerializer, signer: @account))
|
|
end
|
|
|
|
def payload_for_friend
|
|
@payload_for_friend ||= Oj.dump(serialize_payload(activity_for_friend, ActivityPub::ActivityForFriendSerializer, signer: @account))
|
|
end
|
|
|
|
def activity
|
|
ActivityPub::ActivityPresenter.from_status(@status)
|
|
end
|
|
|
|
def activity_for_misskey
|
|
ActivityPub::ActivityPresenter.from_status(@status, for_misskey: true)
|
|
end
|
|
|
|
def activity_for_friend
|
|
ActivityPub::ActivityPresenter.from_status(@status, for_friend: true)
|
|
end
|
|
|
|
def options
|
|
{ 'synchronize_followers' => @status.private_visibility? }
|
|
end
|
|
end
|