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

Conflicts:
- `config/routes.rb`:
  Upstream disabled E2EE routes, which we did earlier, but slightly
  differently. Took upstream's version.
This commit is contained in:
Thibaut Girka
2020-07-15 15:32:40 +02:00
156 changed files with 2855 additions and 1070 deletions

View File

@ -19,7 +19,7 @@ class AfterBlockDomainFromAccountService < BaseService
private
def remove_follows!
@account.active_relationships.where(account: Account.where(domain: @domain)).includes(:target_account).reorder(nil).find_each do |follow|
@account.active_relationships.where(target_account: Account.where(domain: @domain)).includes(:target_account).reorder(nil).find_each do |follow|
UnfollowService.new.call(@account, follow.target_account)
end
end

View File

@ -1,11 +1,19 @@
# frozen_string_literal: true
class UnallowDomainService < BaseService
include DomainControlHelper
def call(domain_allow)
Account.where(domain: domain_allow.domain).find_each do |account|
SuspendAccountService.new.call(account, reserve_username: false)
end
suspend_accounts!(domain_allow.domain) if whitelist_mode?
domain_allow.destroy
end
private
def suspend_accounts!(domain)
Account.where(domain: domain).find_each do |account|
SuspendAccountService.new.call(account, reserve_username: false)
end
end
end