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
|
@ -10,9 +10,13 @@ RSpec.describe BlockDomainService, type: :service do
|
|||
let!(:bad_status_with_attachment) { Fabricate(:status, account: bad_account, text: 'Hahaha') }
|
||||
let!(:bad_attachment) { Fabricate(:media_attachment, account: bad_account, status: bad_status_with_attachment, file: attachment_fixture('attachment.jpg')) }
|
||||
let!(:already_banned_account) { Fabricate(:account, username: 'badguy', domain: 'evil.org', suspended: true, silenced: true) }
|
||||
let!(:bad_friend) { Fabricate(:friend_domain, domain: 'evil.org', inbox_url: 'https://evil.org/inbox', active_state: :accepted, passive_state: :accepted) }
|
||||
|
||||
describe 'for a suspension' do
|
||||
before do
|
||||
stub_request(:post, 'https://evil.org/inbox').with(body: hash_including({
|
||||
type: 'Delete',
|
||||
}))
|
||||
subject.call(DomainBlock.create!(domain: 'evil.org', severity: :suspend))
|
||||
end
|
||||
|
||||
|
@ -41,6 +45,21 @@ RSpec.describe BlockDomainService, type: :service do
|
|||
expect { bad_status_with_attachment.reload }.to raise_exception ActiveRecord::RecordNotFound
|
||||
expect { bad_attachment.reload }.to raise_exception ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
it 'removes remote friend from that domain' do
|
||||
expect(FriendDomain.find_by(domain: 'evil.org')).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'for rejecting friend only' do
|
||||
before do
|
||||
stub_request(:post, 'https://evil.org/inbox')
|
||||
subject.call(DomainBlock.create!(domain: 'evil.org', severity: :noop, reject_friend: true))
|
||||
end
|
||||
|
||||
it 'removes remote friend from that domain' do
|
||||
expect(FriendDomain.find_by(domain: 'evil.org')).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'for a silence with reject media' do
|
||||
|
|
|
@ -278,7 +278,7 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
it 'is broadcast publicly' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to have_received(:publish).with('timeline:public:local', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public', anything)
|
||||
expect(redis).to have_received(:publish).with('timeline:public', anything)
|
||||
end
|
||||
|
||||
context 'with list' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue