diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/post_status_service.rb | 2 | ||||
-rw-r--r-- | app/services/reblog_service.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index d5204151b..55405c0db 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -10,7 +10,7 @@ class PostStatusService < BaseService # @option [Enumerable] :media_ids Optional array of media IDs to attach # @return [Status] def call(account, text, in_reply_to = nil, options = {}) - status = account.statuses.create!(text: text, thread: in_reply_to, sensitive: options[:sensitive], visibility: options[:unlisted] ? :unlisted : :public) + status = account.statuses.create!(text: text, thread: in_reply_to, sensitive: options[:sensitive], visibility: options[:visibility]) attach_media(status, options[:media_ids]) process_mentions_service.call(status) process_hashtags_service.call(status) diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb index 7d0c90d2f..1a78b8f69 100644 --- a/app/services/reblog_service.rb +++ b/app/services/reblog_service.rb @@ -6,6 +6,8 @@ class ReblogService < BaseService # @param [Status] reblogged_status Status to be reblogged # @return [Status] def call(account, reblogged_status) + raise ActiveRecord::RecordInvalid if reblogged_status.private_visibility? + reblog = account.statuses.create!(reblog: reblogged_status, text: '') DistributionWorker.perform_async(reblog.id) |