diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-31 01:25:10 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-31 01:25:10 -0500 |
commit | 80a81fe223415525811c0c3ef62b8853624e9a6a (patch) | |
tree | a5438b0d28dd9a872ad0223b2a130dee59ab92b7 /app/lib | |
parent | 964054b6dbabf119c9dea9cfa0b71011ace8df07 (diff) |
ability to add domain moderation notes, edit existing domain policies in-place, and process asynchronously
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/bangtags.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index acb83221e..0197477c5 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -744,12 +744,13 @@ class Bangtags end when 'silence', 'unsilence', 'suspend', 'unsuspend', 'force_unlisted', 'allow_public', 'force_sensitive', 'allow_nonsensitive', 'reset', 'forgive' action = 'reset' if action == 'forgive' + reason = tf_cmd[2..-1].join(':') chunk.split.each do |c| if c.start_with?('@') account_parts = c.split('@')[1..2] - successful = account_policy(account_parts[0], account_parts[1], action) + successful = account_policy(account_parts[0], account_parts[1], action, reason) else - successful = domain_policy(c, action) + successful = domain_policy(c, action, reason) end if successful output << "\u2705 <code>#{c}</code>" @@ -757,7 +758,12 @@ class Bangtags output << "\u274c <code>#{c}</code>" end end - output = ['<em>No action.</em>'] if output.blank? + if output.blank? + output = ['<em>No action.</em>'] + elsif !reason.blank? + output << '' + output << "<strong>Comment:</strong> <em>#{reason}</em>" + end chunk = output.join("\n") + "\n" end end |