diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-31 01:26:57 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:16 -0500 |
commit | 45e04f00db91cc2956707a84a87dfdfce05363e4 (patch) | |
tree | 9b00bde519afcf1e5e63e2e12bba190d8f01131d /app | |
parent | f6b6d595958154c4e1c0a588d36bf09e6a0c6a09 (diff) |
[Command Tags] Move blank post check to utility method
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/command_tag/processor.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb index 414c08638..aba7be158 100644 --- a/app/lib/command_tag/processor.rb +++ b/app/lib/command_tag/processor.rb @@ -58,7 +58,7 @@ class CommandTag::Processor @text = parse_templates(@text).rstrip execute_statements(:before_save) - if @text.blank? || @text.gsub(MENTIONS_OR_HASHTAGS_RE, '').strip.blank? + if status_text_blank? execute_statements(:when_blank) unless (@status.published? && !@status.edited.zero?) || @text.present? @@ -210,6 +210,10 @@ class CommandTag::Processor @account.id == @parent&.account_id end + def status_text_blank? + @text.blank? || @text.gsub(MENTIONS_OR_HASHTAGS_RE, '').strip.blank? + end + def destroy_status! @status.destroy unless @status.destroyed? end |