about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-18 02:02:54 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-18 02:18:09 -0600
commit0f3b01eaab82325baaf1c7a4c75a322d3c21a67f (patch)
treef3d19c99328336997919803ffc6850a96d5a6411 /app/lib
parentfc69e4a0bb4e3d2fdcb2ffef0f3211f8c347ed15 (diff)
switch to irc-like oper behavior; require mods & admins to explicitly oper up using `fangs`/`op` bangtag or toggling defang setting in profile; auto-defang after 15 mins or with `defang`/`deop` bangtag
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/bangtags.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 59ec16a23..ac5a4fce3 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -1299,6 +1299,18 @@ class Bangtags
           @vars.delete("_media:#{media_idx}:desc")
         end
 
+      when 'op', 'oper', 'fang', 'fangs'
+        chunk = nil
+        next unless @user.can_moderate? && @user.defanged?
+        @user.fangs_out!
+        service_dm('announcements', @account, "You are now in #{@user.role} mode. This will expire after 15 minutes.", footer: '#!fangs')
+
+      when 'deop', 'deoper', 'defang'
+        chunk = nil
+        next if @user.defanged?
+        @user.defang!
+        service_dm('announcements', @account, "You are no longer in #{@user.role} mode.", footer: '#!defang')
+
       when 'admin'
         next unless @user.admin?
         next if post_cmd[1].nil?