about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb4
-rw-r--r--app/services/process_hashtags_service.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 8765ef5e3..ef8aa4a91 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -8,6 +8,8 @@ class PostStatusService < BaseService
   # @param [Hash] options
   # @option [Boolean] :sensitive
   # @option [String] :visibility
+  # @option [Boolean] :spoiler
+  # @option [String] :spoiler_text
   # @option [Enumerable] :media_ids Optional array of media IDs to attach
   # @option [Doorkeeper::Application] :application
   # @return [Status]
@@ -15,6 +17,8 @@ class PostStatusService < BaseService
     status = account.statuses.create!(text:        text,
                                       thread:      in_reply_to,
                                       sensitive:   options[:sensitive],
+                                      spoiler:   options[:spoiler],
+                                      spoiler_text:   options[:spoiler_text],
                                       visibility:  options[:visibility],
                                       application: options[:application])
 
diff --git a/app/services/process_hashtags_service.rb b/app/services/process_hashtags_service.rb
index 617a38159..9da7ef74e 100644
--- a/app/services/process_hashtags_service.rb
+++ b/app/services/process_hashtags_service.rb
@@ -9,5 +9,6 @@ class ProcessHashtagsService < BaseService
     end
 
     status.update(sensitive: true) if tags.include?('nsfw')
+    status.update(spoiler: true) if tags.include?('spoiler')
   end
 end