Add: フレンドサーバー (#61)
* 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: 編集できない問題 * 有効にしていないフレンドサーバーをリストで無効表示
This commit is contained in:
parent
acb29e5b11
commit
87e858a202
66 changed files with 1638 additions and 51 deletions
|
@ -24,6 +24,9 @@ class BlockDomainService < BaseService
|
|||
silence_accounts!
|
||||
elsif domain_block.suspend?
|
||||
suspend_accounts!
|
||||
remove_friends!
|
||||
elsif domain_block.reject_friend?
|
||||
remove_friends!
|
||||
end
|
||||
|
||||
DomainClearMediaWorker.perform_async(domain_block.id) if domain_block.reject_media?
|
||||
|
@ -41,6 +44,10 @@ class BlockDomainService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
def remove_friends!
|
||||
blocked_friends.find_each(&:destroy)
|
||||
end
|
||||
|
||||
def blocked_domain
|
||||
domain_block.domain
|
||||
end
|
||||
|
@ -48,4 +55,8 @@ class BlockDomainService < BaseService
|
|||
def blocked_domain_accounts
|
||||
Account.by_domain_and_subdomains(blocked_domain)
|
||||
end
|
||||
|
||||
def blocked_friends
|
||||
@blocked_friends ||= FriendDomain.by_domain_and_subdomains(blocked_domain)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,9 +21,6 @@ class FanOutOnWriteService < BaseService
|
|||
if broadcastable?
|
||||
fan_out_to_public_recipients!
|
||||
fan_out_to_public_streams!
|
||||
elsif broadcastable_unlisted?
|
||||
fan_out_to_public_recipients!
|
||||
fan_out_to_public_unlisted_streams!
|
||||
elsif broadcastable_unlisted2?
|
||||
fan_out_to_unlisted_streams!
|
||||
end
|
||||
|
@ -75,11 +72,6 @@ class FanOutOnWriteService < BaseService
|
|||
broadcast_to_public_streams!
|
||||
end
|
||||
|
||||
def fan_out_to_public_unlisted_streams!
|
||||
broadcast_to_hashtag_streams!
|
||||
broadcast_to_public_unlisted_streams!
|
||||
end
|
||||
|
||||
def fan_out_to_unlisted_streams!
|
||||
broadcast_to_hashtag_streams!
|
||||
end
|
||||
|
@ -176,16 +168,6 @@ class FanOutOnWriteService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
def broadcast_to_public_unlisted_streams!
|
||||
return if @status.reply? && @status.in_reply_to_account_id != @account.id
|
||||
|
||||
redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload)
|
||||
|
||||
if @status.with_media?
|
||||
redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', anonymous_payload)
|
||||
end
|
||||
end
|
||||
|
||||
def deliver_to_conversation!
|
||||
AccountConversation.add_status(@account, @status) unless update?
|
||||
end
|
||||
|
@ -210,11 +192,7 @@ class FanOutOnWriteService < BaseService
|
|||
end
|
||||
|
||||
def broadcastable?
|
||||
(@status.public_visibility? || @status.login_visibility?) && !@status.reblog? && !@account.silenced?
|
||||
end
|
||||
|
||||
def broadcastable_unlisted?
|
||||
@status.public_unlisted_visibility? && !@status.reblog? && !@account.silenced?
|
||||
(@status.public_visibility? || @status.public_unlisted_visibility? || @status.login_visibility?) && !@status.reblog? && !@account.silenced?
|
||||
end
|
||||
|
||||
def broadcastable_unlisted2?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue