add ability to post as linked account without switching using `once:i:am`/`once:we:are` bangtag

staging
multiple creatures 2019-08-07 01:06:23 -05:00
parent d9a8c50f92
commit a8475313b8
1 changed files with 11 additions and 1 deletions

View File

@ -491,7 +491,11 @@ class Bangtags
end
else
who = cmd[0]
next if switch_account(who.strip)
if @once
next if post_as(who.strip)
else
next if switch_account(who.strip)
end
name = who.downcase.gsub(/\s+/, '').strip
description = cmd[1..-1].join(':').strip
if description.blank?
@ -1017,6 +1021,12 @@ class Bangtags
true
end
def post_as(target_acct)
target_acct = Account.find_local(target_acct)
return false unless target_acct&.user.present? && target_acct.user.in?(@user.linked_users)
status.account_id = target_acct.id
end
def html_entities
@html_entities ||= HTMLEntities.new
end