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.rb2
-rw-r--r--app/services/follow_service.rb2
-rw-r--r--app/services/process_feed_service.rb4
-rw-r--r--app/services/process_interaction_service.rb4
-rw-r--r--app/services/process_mentions_service.rb2
-rw-r--r--app/services/reblog_service.rb2
6 files changed, 8 insertions, 8 deletions
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index 3d0bc718c..98f08d32b 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -8,7 +8,7 @@ class FavouriteService < BaseService
     account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
 
     if status.local?
-      NotificationMailer.favourite(status, account).deliver_later
+      NotificationMailer.favourite(status, account).deliver_later unless status.account.blocking?(account)
     else
       NotificationWorker.perform_async(favourite.stream_entry.id, status.account_id)
     end
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index 6dd85dd7d..f44d53398 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -10,7 +10,7 @@ class FollowService < BaseService
     follow = source_account.follow!(target_account)
 
     if target_account.local?
-      NotificationMailer.follow(target_account, source_account).deliver_later
+      NotificationMailer.follow(target_account, source_account).deliver_later unless target_account.blocking?(source_account)
     else
       subscribe_service.call(target_account)
       NotificationWorker.perform_async(follow.stream_entry.id, target_account.id)
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 1ea79835b..9585b15dd 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -69,7 +69,7 @@ class ProcessFeedService < BaseService
 
         unless mentioned_account.nil?
           mentioned_account.mentions.where(status: status).first_or_create(status: status)
-          NotificationMailer.mention(mentioned_account, status).deliver_later
+          NotificationMailer.mention(mentioned_account, status).deliver_later unless mentioned_account.blocking?(status.account)
         end
       else
         # What to do about remote user?
@@ -114,7 +114,7 @@ class ProcessFeedService < BaseService
 
     if !status.reblog.nil?
       status.save!
-      NotificationMailer.reblog(status.reblog, status.account).deliver_later if status.reblog.local?
+      NotificationMailer.reblog(status.reblog, status.account).deliver_later if status.reblog.local? && !status.reblog.account.blocking?(status.account)
     end
   end
 
diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb
index 96dae30da..31c7c46a5 100644
--- a/app/services/process_interaction_service.rb
+++ b/app/services/process_interaction_service.rb
@@ -58,7 +58,7 @@ class ProcessInteractionService < BaseService
 
   def follow!(account, target_account)
     account.follow!(target_account)
-    NotificationMailer.follow(target_account, account).deliver_later
+    NotificationMailer.follow(target_account, account).deliver_later unless target_account.blocking?(account)
   end
 
   def unfollow!(account, target_account)
@@ -78,7 +78,7 @@ class ProcessInteractionService < BaseService
   def favourite!(xml, from_account)
     current_status = status(xml)
     current_status.favourites.where(account: from_account).first_or_create!(account: from_account)
-    NotificationMailer.favourite(current_status, from_account).deliver_later
+    NotificationMailer.favourite(current_status, from_account).deliver_later unless current_status.account.blocking?(from_account)
   end
 
   def add_post!(body, account)
diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb
index 2d09fc2cd..8baa03d07 100644
--- a/app/services/process_mentions_service.rb
+++ b/app/services/process_mentions_service.rb
@@ -27,7 +27,7 @@ class ProcessMentionsService < BaseService
       mentioned_account = mention.account
 
       if mentioned_account.local?
-        NotificationMailer.mention(mentioned_account, status).deliver_later
+        NotificationMailer.mention(mentioned_account, status).deliver_later unless mentioned_account.blocking?(status.account)
       else
         NotificationWorker.perform_async(status.stream_entry.id, mentioned_account.id)
       end
diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb
index f149477c7..56c59cb18 100644
--- a/app/services/reblog_service.rb
+++ b/app/services/reblog_service.rb
@@ -9,7 +9,7 @@ class ReblogService < BaseService
     account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
 
     if reblogged_status.local?
-      NotificationMailer.reblog(reblogged_status, account).deliver_later
+      NotificationMailer.reblog(reblogged_status, account).deliver_later unless reblogged_status.account.blocking?(account)
     else
       NotificationWorker.perform_async(reblog.stream_entry.id, reblogged_status.account_id)
     end