Allow import/export of mutes list (#1541)
* Allow export of mutes list * Allow importing of mutes list * Refactor to use Settings::Exports::BaseController and DRY up exports code
This commit is contained in:
parent
08fce08217
commit
7f0a865b05
13 changed files with 86 additions and 19 deletions
|
@ -16,6 +16,8 @@ class ImportWorker
|
|||
process_blocks
|
||||
when 'following'
|
||||
process_follows
|
||||
when 'muting'
|
||||
process_mutes
|
||||
end
|
||||
|
||||
@import.destroy
|
||||
|
@ -35,6 +37,18 @@ class ImportWorker
|
|||
CSV.new(import_contents).reject(&:blank?)
|
||||
end
|
||||
|
||||
def process_mutes
|
||||
import_rows.each do |row|
|
||||
begin
|
||||
target_account = FollowRemoteAccountService.new.call(row.first)
|
||||
next if target_account.nil?
|
||||
MuteService.new.call(from_account, target_account)
|
||||
rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError
|
||||
next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def process_blocks
|
||||
import_rows.each do |row|
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue