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/favourite_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index 5c04cfee4..d5fbd29e9 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -6,12 +6,14 @@ class FavouriteService < BaseService
   # @param [Status] status
   # @return [Favourite]
   def call(account, status)
+    raise Mastodon::NotPermitted unless status.permitted?(account)
+
     favourite = Favourite.create!(account: account, status: status)
 
     Pubsubhubbub::DistributionWorker.perform_async(favourite.stream_entry.id)
 
     if status.local?
-      NotifyService.new.call(status.account, favourite)
+      NotifyService.new.call(favourite.status.account, favourite)
     else
       NotificationWorker.perform_async(favourite.stream_entry.id, status.account_id)
     end