forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change move handler to carry blocks over (mastodon#14144)
* Change move handler to carry blocks and mutes over When user A blocks user B and B moves to a new account C, make A block C accordingly. Note that it only works if A's instance is aware of the Move, that is, if B is on A's instance or has followers there. * Also notify instances with known people blocking you when moving * Add automatic account notes when blocking/muting an account that had no note
- Loading branch information
1 parent
a00fcda
commit eb9c87f
Showing
7 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Fabricator(:account_migration) do | ||
account | ||
target_account | ||
target_account { |attrs| Fabricate(:account, also_known_as: [ActivityPub::TagManager.instance.uri_for(attrs[:account])]) } | ||
acct { |attrs| attrs[:target_account].acct } | ||
followers_count 1234 | ||
acct 'test@example.com' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'rails_helper' | ||
|
||
describe ActivityPub::MoveDistributionWorker do | ||
subject { described_class.new } | ||
|
||
let(:migration) { Fabricate(:account_migration) } | ||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') } | ||
let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com') } | ||
|
||
describe '#perform' do | ||
before do | ||
allow(ActivityPub::DeliveryWorker).to receive(:push_bulk) | ||
follower.follow!(migration.account) | ||
blocker.block!(migration.account) | ||
end | ||
|
||
it 'delivers to followers and known blockers' do | ||
subject.perform(migration.id) | ||
expect(ActivityPub::DeliveryWorker).to have_received(:push_bulk).with(['http://example.com', 'http://example2.com']) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters