about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-15 13:54:00 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-15 14:12:24 -0500
commit7147447254160d892c461a21bba7c2098dd06c66 (patch)
treec2bd35a364c2c913c4ac3369259e1c130f797f90
parent27d67e2d5cc786c83f56e96573a8692fa763fbcc (diff)
add `untag` bangtag
-rw-r--r--app/lib/bangtags.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 8ed8a0612..99eb14d49 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -293,11 +293,15 @@ class Bangtags
           case cmd[1].downcase
           when 'permalink'
             chunk = TagManager.instance.url_for(@parent_status)
-          when 'tag'
+          when 'tag', 'untag'
             chunk = nil
             next unless @parent_status.account.id == @account.id
             tags = cmd[2..-1].map {|t| t.gsub(':', '.')}
-            add_tags(@parent_status, *tags)
+            if cmd[1].downcase == 'tag'
+              add_tags(@parent_status, *tags)
+            else
+              del_tags(@parent_status, *tags)
+            end
           when 'emoji'
             @parent_status.emojis.each do |theirs|
               ours = CustomEmoji.find_or_initialize_by(shortcode: theirs.shortcode, domain: nil)