]> cat aescling's git repositories - mastodon.git/commitdiff
Remove custom emojis on "tootctl domains purge" (#10721)
authorJeong Arm <kjwonmail@gmail.com>
Thu, 9 May 2019 20:03:21 +0000 (05:03 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 9 May 2019 20:03:20 +0000 (22:03 +0200)
* Remove custom emojis on domains purge

* Change message "Removing" to "Removed"

lib/mastodon/domains_cli.rb

index 303b8a94a0f0be6cf5eaaed54dcb2421375152fb..b081581fe5797089d3e2a2f00c85209c33a303c8 100644 (file)
@@ -28,10 +28,15 @@ module Mastodon
         say('.', :green, false)
       end
 
-      DomainBlock.where(domain: domain).destroy_all
+      DomainBlock.where(domain: domain).destroy_all unless options[:dry_run]
 
       say
       say("Removed #{removed} accounts#{dry_run}", :green)
+
+      custom_emojis = CustomEmoji.where(domain: domain)
+      custom_emojis_count = custom_emojis.count
+      custom_emojis.destroy_all unless options[:dry_run]
+      say("Removed #{custom_emojis_count} custom emojis", :green)
     end
 
     option :concurrency, type: :numeric, default: 50, aliases: [:c]