diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-02-19 11:25:05 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-19 11:25:21 -0600 |
commit | 7acfafa0a11c5acc63356cc256fe0cf74f20a4e3 (patch) | |
tree | 6f8e8d9658f47128c9f1e457d7547e1b857de083 | |
parent | 87160de42bb7037f81fbfd52678cb6d2c0b80ca8 (diff) |
fix `fangs`/`defang` bangtags
-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? |