Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `app/controllers/settings/preferences_controller.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/lib/user_settings_decorator.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/models/status.rb`:
  Conflict because of slight change in how glitch-soc handles the scope to
  filter out local-only posts for anonymous viewers.
  Took upstream's changes and re-applied glitch-soc's change.
- `app/models/user.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/views/directories/index.html.haml`:
  Conflict because upstream redesigned that page while glitch-soc had a minor
  change to support hiding the number of followers.
  Ported glitch-soc's change on top of upstream's redesign.

Additional changes:
- `app/models/account_statuses_filter.rb`:
  See change to `app/models/status.rb`.
This commit is contained in:
Claire
2022-03-08 20:22:54 +01:00
75 changed files with 906 additions and 597 deletions

View File

@ -63,20 +63,20 @@ RSpec.describe UnsuspendAccountService, type: :service do
describe 'unsuspending a remote account' do
include_examples 'common behavior' do
let!(:account) { Fabricate(:account, domain: 'bob.com', uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) }
let!(:reslove_account_service) { double }
let!(:resolve_account_service) { double }
before do
allow(ResolveAccountService).to receive(:new).and_return(reslove_account_service)
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service)
end
context 'when the account is not remotely suspended' do
before do
allow(reslove_account_service).to receive(:call).with(account).and_return(account)
allow(resolve_account_service).to receive(:call).with(account).and_return(account)
end
it 're-fetches the account' do
subject.call
expect(reslove_account_service).to have_received(:call).with(account)
expect(resolve_account_service).to have_received(:call).with(account)
end
it "merges back into local followers' feeds" do
@ -92,7 +92,7 @@ RSpec.describe UnsuspendAccountService, type: :service do
context 'when the account is remotely suspended' do
before do
allow(reslove_account_service).to receive(:call).with(account) do |account|
allow(resolve_account_service).to receive(:call).with(account) do |account|
account.suspend!(origin: :remote)
account
end
@ -100,7 +100,7 @@ RSpec.describe UnsuspendAccountService, type: :service do
it 're-fetches the account' do
subject.call
expect(reslove_account_service).to have_received(:call).with(account)
expect(resolve_account_service).to have_received(:call).with(account)
end
it "does not merge back into local followers' feeds" do
@ -116,12 +116,12 @@ RSpec.describe UnsuspendAccountService, type: :service do
context 'when the account is remotely deleted' do
before do
allow(reslove_account_service).to receive(:call).with(account).and_return(nil)
allow(resolve_account_service).to receive(:call).with(account).and_return(nil)
end
it 're-fetches the account' do
subject.call
expect(reslove_account_service).to have_received(:call).with(account)
expect(resolve_account_service).to have_received(:call).with(account)
end
it "does not merge back into local followers' feeds" do