about summary refs log tree commit diff
path: root/app/models/export.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-04-03 18:17:43 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-04-03 18:17:43 +0200
commitd4882aa64a7a483ec30ca61a507c2a6f5d3294f5 (patch)
tree4b72c4c44feafa772ba322b0a46f3eb524297138 /app/models/export.rb
parentdaab45d4ae000a208f251ce96334df47d894dba3 (diff)
Export and import `hide_notifications` alongside user mutes (#10335)
* Export hide_notifications along with user mutes

* Import hide_notifications along with muted users list

* Add headers for CSV exports
Diffstat (limited to 'app/models/export.rb')
-rw-r--r--app/models/export.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/export.rb b/app/models/export.rb
index 9bf866d35..b35632c60 100644
--- a/app/models/export.rb
+++ b/app/models/export.rb
@@ -14,7 +14,11 @@ class Export
   end
 
   def to_muted_accounts_csv
-    to_csv account.muting.select(:username, :domain)
+    CSV.generate(headers: ['Account address', 'Hide notifications'], write_headers: true) do |csv|
+      account.mute_relationships.includes(:target_account).reorder(id: :desc).each do |mute|
+        csv << [acct(mute.target_account), mute.hide_notifications]
+      end
+    end
   end
 
   def to_following_accounts_csv