diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-19 18:50:24 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:43:59 -0500 |
commit | 21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 (patch) | |
tree | e577d047af196823227e675dea52b2fc2fa842c6 /app/services/process_mentions_service.rb | |
parent | 8c8ad0ac0ed0d3e67f3e521068b59edd4054f1e9 (diff) |
[Feature] Add manual publishing option
Diffstat (limited to 'app/services/process_mentions_service.rb')
-rw-r--r-- | app/services/process_mentions_service.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index 2cc376a75..8b4b11617 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -9,13 +9,16 @@ class ProcessMentionsService < BaseService # @param [Status] status # @option [Enumerable] :mentions Mentions to include # @option [Boolean] :reveal_implicit_mentions Append implicit mentions to text - def call(status, mentions: [], reveal_implicit_mentions: true) + # @option [Boolean] :deliver Deliver mention notifications + def call(status, mentions: [], reveal_implicit_mentions: true, deliver: true) return unless status.local? @status = status @status.text, mentions = ResolveMentionsService.new.call(@status, mentions: mentions, reveal_implicit_mentions: reveal_implicit_mentions) @status.save! + return unless deliver + check_for_spam(status) mentions.each { |mention| create_notification(mention) } |