diff options
Diffstat (limited to 'app/lib/bangtags.rb')
-rw-r--r-- | app/lib/bangtags.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index ac5a4fce3..201f93c5b 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -983,9 +983,22 @@ class Bangtags end chunk = "<p>\"<code>#{q.split('').join("\u200c")}</code>\" mentions by post count:<br/>#{data.join('<br/>')}<br/>#{avg}<br/>#{total}</p>" + 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' chunk = nil - next unless @user.admin? + next unless @user.admin? && !@user.defanged? next if cmd[1].nil? @status.visibility = :direct @@ -1299,18 +1312,6 @@ 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? |