From abfd0c107c8003ba06a118625c49d22df553696f Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Fri, 14 Aug 2020 02:41:44 -0500 Subject: [Command Tags] Add #!notify toggle to allow toggling whether or not a post should be locally delivered to timelines/notifications --- app/services/post_status_service.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/services/post_status_service.rb') diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 82588d254..c6a983001 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -27,6 +27,7 @@ class PostStatusService < BaseService # @option [Enumerable] :mentions Optional array of Mentions to include # @option [Enumerable] :tags Option array of tag names to include # @option [Boolean] :publish If true, status will be published + # @option [Boolean] :notify If false, status will not be delivered to local timelines or mentions # @return [Status] def call(account, options = {}) @account = account @@ -91,6 +92,8 @@ class PostStatusService < BaseService @status = @account.statuses.create!(status_attributes) end + @status.notify = @options[:notify] if @options[:notify].present? + process_command_tags_service.call(@account, @status) process_hashtags_service.call(@status, nil, @tag_names) process_mentions_service.call(@status, mentions: @mentions, deliver: @options[:publish]) -- cgit