about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-23 19:01:12 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-23 19:01:12 +0100
commit3373ae02ded0ac5847350da9f9550721cdebe732 (patch)
tree3fa12a04c5af6aa67043c797093e2d9872b1f5ce /app/services
parentd74cef45aafb1bf049c7ee0e7b3b334aefdf5c17 (diff)
parent79a01358698ad3889b0c9a43cfb2f886fbae77e4 (diff)
Merge branch 'development'
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index cf824ff99..76366e984 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -5,11 +5,13 @@ class PostStatusService < BaseService
   # @param [Account] account Account from which to post
   # @param [String] text Message
   # @param [Status] in_reply_to Optional status to reply to
-  # @param [Enumerable] media_ids Optional array of media IDs to attach
+  # @param [Hash] options
+  # @option [Boolean] :sensitive
+  # @option [Enumerable] :media_ids Optional array of media IDs to attach
   # @return [Status]
-  def call(account, text, in_reply_to = nil, media_ids = nil)
-    status = account.statuses.create!(text: text, thread: in_reply_to)
-    attach_media(status, media_ids)
+  def call(account, text, in_reply_to = nil, options = {})
+    status = account.statuses.create!(text: text, thread: in_reply_to, sensitive: options[:sensitive])
+    attach_media(status, options[:media_ids])
     process_mentions_service.call(status)
     process_hashtags_service.call(status)
     DistributionWorker.perform_async(status.id)