* Add: `conversations`テーブルに`ancestor_status`プロパティ * Fix test * Fix test more * Add: `limited_visibility`に`Reply`を追加、`context`のURI * Add: 外部からの`context`受信処理 * Fix test * Add: 公開範囲「返信」 * Fix test * Fix: 返信に返信以外の公開範囲を設定できない問題 * Add: ローカル投稿時にメンション追加・他サーバーへの転送 * Fix test * Fix test * Test: ローカルスレッドへの返信投稿の転送 * Test: 未知のアカウントからのメンション * Add: 編集・削除の連合に対応 * Remove: 重複テスト * Fix: 改善 * Add: 編集削除の転送処理・返信なのにsilentなメンションでの通知 * Fix: リプライが第三者に届かない問題 * Add: `always_sign_unsafe` * Add: Subject * Remove space * Fix: 他人のスレッドの送信先一覧を非表示 * Fix: おかしいコード
This commit is contained in:
parent
a52a8ce214
commit
a88349af55
42 changed files with 1115 additions and 77 deletions
|
@ -63,6 +63,22 @@ describe ActivityPub::DistributionWorker do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with limited response status' do
|
||||
before do
|
||||
allow(ActivityPub::DeliveryWorker).to receive(:perform_async).with(kind_of(String), status.account.id, 'http://example.com/conversation/inbox', anything)
|
||||
status.update(visibility: :limited, thread: Fabricate(:status))
|
||||
status.conversation.update(uri: 'https://example.com/conversation', inbox_url: 'http://example.com/conversation/inbox')
|
||||
status.capability_tokens.create!
|
||||
status.mentions.create!(account: follower, silent: true)
|
||||
stub_request(:post, 'http://example.com/conversation/inbox')
|
||||
end
|
||||
|
||||
it 'delivers to followers' do
|
||||
subject.perform(status.id)
|
||||
expect(ActivityPub::DeliveryWorker).to have_received(:perform_async)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with limited status for no-follower but non-mentioned follower' do
|
||||
let(:no_follower) { Fabricate(:account, domain: 'example.com', inbox_url: 'http://example.com/no_follower/inbox', shared_inbox_url: 'http://example.com') }
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ describe ActivityPub::StatusUpdateDistributionWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:status) { Fabricate(:status, text: 'foo') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, shared_inbox_url: 'http://example.com', inbox_url: 'http://example.com/follower/inbox', domain: 'example.com') }
|
||||
|
||||
describe '#perform' do
|
||||
before do
|
||||
|
@ -31,6 +31,18 @@ describe ActivityPub::StatusUpdateDistributionWorker do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with unlisted status' do
|
||||
before do
|
||||
status.update(visibility: :unlisted)
|
||||
end
|
||||
|
||||
it 'delivers to followers' do
|
||||
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com', anything]]) do
|
||||
subject.perform(status.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with private status' do
|
||||
before do
|
||||
status.update(visibility: :private)
|
||||
|
@ -42,5 +54,35 @@ describe ActivityPub::StatusUpdateDistributionWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with limited status' do
|
||||
before do
|
||||
status.update(visibility: :limited)
|
||||
status.capability_tokens.create!
|
||||
status.mentions.create!(account: follower, silent: true)
|
||||
end
|
||||
|
||||
it 'delivers to followers' do
|
||||
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com', anything]]) do
|
||||
subject.perform(status.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with limited response status' do
|
||||
before do
|
||||
allow(ActivityPub::DeliveryWorker).to receive(:perform_async).with(kind_of(String), status.account.id, 'http://example.com/conversation/inbox', anything)
|
||||
status.update(visibility: :limited, thread: Fabricate(:status))
|
||||
status.conversation.update(uri: 'https://example.com/conversation', inbox_url: 'http://example.com/conversation/inbox')
|
||||
status.capability_tokens.create!
|
||||
status.mentions.create!(account: follower, silent: true)
|
||||
stub_request(:post, 'http://example.com/conversation/inbox')
|
||||
end
|
||||
|
||||
it 'delivers to followers' do
|
||||
subject.perform(status.id)
|
||||
expect(ActivityPub::DeliveryWorker).to have_received(:perform_async)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue