diff options
Diffstat (limited to 'app/lib/command_tag/command/status_tools.rb')
-rw-r--r-- | app/lib/command_tag/command/status_tools.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/lib/command_tag/command/status_tools.rb b/app/lib/command_tag/command/status_tools.rb index 1cdb90e4a..5cc11dde2 100644 --- a/app/lib/command_tag/command/status_tools.rb +++ b/app/lib/command_tag/command/status_tools.rb @@ -1,5 +1,19 @@ # frozen_string_literal: true module CommandTag::Command::StatusTools + def handle_boost_once_at_start(args) + return unless @parent.present? && StatusPolicy.new(@account, @parent).reblog? + + status = ReblogService.new.call( + @account, @parent, + visibility: @status.visibility, + spoiler_text: args.join(' ').presence || @status.spoiler_text + ) + end + + alias handle_reblog_at_start handle_boost_once_at_start + alias handle_rb_at_start handle_boost_once_at_start + alias handle_rt_at_start handle_boost_once_at_start + def handle_article_before_save(args) return unless author_of_status? && args.present? |