diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-08-23 09:38:27 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:20 -0500 |
commit | 5622de4a785e6b7c9a4946af3efaf8b4c2bc5755 (patch) | |
tree | b9378500aa449af54ac09c44b2aba8f6ee2a184b /app/lib/command_tag/processor.rb | |
parent | 5de7e2d667fa55f353a8b3d988cd047c118a4250 (diff) |
[Feature] Support Misskey-compatible boosts with attached content notes
Diffstat (limited to 'app/lib/command_tag/processor.rb')
-rw-r--r-- | app/lib/command_tag/processor.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb index 2c33b5f83..9edcb58ba 100644 --- a/app/lib/command_tag/processor.rb +++ b/app/lib/command_tag/processor.rb @@ -12,6 +12,12 @@ require_relative 'commands' +class CommandTag::Break < Mastodon::Error + def initialize(msg = 'A handler stopped execution.') + super + end +end + class CommandTag::Processor include Redisable include ImgProxyHelper @@ -83,6 +89,8 @@ class CommandTag::Processor execute_statements(:at_end) all_handlers!(:shutdown) + rescue CommandTag::Break + nil rescue StandardError => e @status.update(published: false) @status.destroy @@ -247,6 +255,13 @@ class CommandTag::Processor @status.destroy end + def replace_status!(new_status) + return if new_status.blank? + + destroy_status! + @status = new_status + end + def normalize(text) text.to_s.strip.downcase end |