about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/models/user.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 7f47ecc3f..88ee91801 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -536,6 +536,14 @@ class User < ApplicationRecord
   def set_last_fanged_at
     return unless defanged_changed? && !last_fanged_at_changed?
     self.last_fanged_at = (defanged? ? nil : Time.now.utc)
+
+    return unless usernme&.account?
+
+    if defanged?
+      LogWorker.perform_async("\u23ec <#{self.account.username}> is no longer in fanged #{role} mode.")
+    else
+      LogWorker.perform_async("\u23eb <#{self.account.username}> switched to fanged #{role} mode.")
+    end
   end
 
   def open_registrations?