From 80a81fe223415525811c0c3ef62b8853624e9a6a Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 31 Jul 2019 01:25:10 -0500 Subject: ability to add domain moderation notes, edit existing domain policies in-place, and process asynchronously --- app/lib/bangtags.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'app/lib') 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 #{c}" @@ -757,7 +758,12 @@ class Bangtags output << "\u274c #{c}" end end - output = ['No action.'] if output.blank? + if output.blank? + output = ['No action.'] + elsif !reason.blank? + output << '' + output << "Comment: #{reason}" + end chunk = output.join("\n") + "\n" end end -- cgit