Fix #522 - prevent blocked users from reblogging

pull/6/head^2
Eugen Rochko 2017-01-25 01:48:46 +01:00
parent ca28d9c2ae
commit 10ffd455a8
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,9 @@ class ReblogService < BaseService
# @param [Status] reblogged_status Status to be reblogged # @param [Status] reblogged_status Status to be reblogged
# @return [Status] # @return [Status]
def call(account, reblogged_status) def call(account, reblogged_status)
raise Mastodon::NotPermitted if reblogged_status.private_visibility? reblogged_status = reblogged_status.reblog if reblogged_status.reblog?
raise Mastodon::NotPermitted if reblogged_status.private_visibility? || !reblogged_status.permitted?(account)
reblog = account.statuses.create!(reblog: reblogged_status, text: '') reblog = account.statuses.create!(reblog: reblogged_status, text: '')