about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-24 18:44:03 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-24 18:44:03 +0100
commitc967802c4351f34d5c62e52b72c7d5c2d72ffba3 (patch)
treeb673170c5b9e02b8aa3b1d96642c26bba592c04d /app/services
parent79609d62705fa7060c1d1ab78234b4aabdbd7e0f (diff)
Notify remote users about mentions
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index e8fc6cdef..39bbe9f9e 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -9,6 +9,11 @@ class PostStatusService < BaseService
       next unless local_account.nil?
       follow_remote_account_service.("acct:#{match.first}")
     end
+
+    status.mentions.each do |mentioned_account|
+      next if mentioned_account.local?
+      send_interaction_service.(status.stream_entry, mentioned_account)
+    end
   end
 
   private
@@ -16,4 +21,8 @@ class PostStatusService < BaseService
   def follow_remote_account_service
     @follow_remote_account_service ||= FollowRemoteAccountService.new
   end
+
+  def send_interaction_service
+    @send_interaction_service ||= SendInteractionService.new
+  end
 end