about summary refs log tree commit diff
path: root/app/services/process_interaction_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-24 12:57:29 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-24 12:57:29 +0100
commitfa7868675d0952f8e4e1aa2f6b77586bb56de2c1 (patch)
tree33b79c306943ade9c5bc49a06cfedf1e2aee231a /app/services/process_interaction_service.rb
parent10eb47a33e2f0c7f0eba5302319c4321db41294c (diff)
Send Salmon interactions
Diffstat (limited to 'app/services/process_interaction_service.rb')
-rw-r--r--app/services/process_interaction_service.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb
index ee04f01af..3a8332118 100644
--- a/app/services/process_interaction_service.rb
+++ b/app/services/process_interaction_service.rb
@@ -1,6 +1,7 @@
-class ProcessInteractionService
-  include ApplicationHelper
-
+class ProcessInteractionService < BaseService
+  # Record locally the remote interaction with our user
+  # @param [String] envelope Salmon envelope
+  # @param [Account] target_account Account the Salmon was addressed to
   def call(envelope, target_account)
     body = salmon.unpack(envelope)
     xml  = Nokogiri::XML(body)
@@ -75,14 +76,14 @@ class ProcessInteractionService
   end
 
   def salmon
-    OStatus2::Salmon.new
+    @salmon ||= OStatus2::Salmon.new
   end
 
   def follow_remote_account_service
-    FollowRemoteAccountService.new
+    @follow_remote_account_service ||= FollowRemoteAccountService.new
   end
 
   def process_feed_service
-    ProcessFeedService.new
+    @process_feed_service ||= ProcessFeedService.new
   end
 end