From 7147447254160d892c461a21bba7c2098dd06c66 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 15 Jul 2019 13:54:00 -0500 Subject: add `untag` bangtag --- app/lib/bangtags.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/lib/bangtags.rb') 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) -- cgit