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-10-10 18:05:52 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-10 18:16:07 +0200
commit87b618ab02d5265e47bd3455a41c5c31d77905a5 (patch)
treef08b9d45ac8f670fa2fe0c28bb76b4dacf22849c /app/services/process_interaction_service.rb
parentf49ed8c819f8d5e171b4a93f92a60936c0f3d93f (diff)
Fix namespace parsing in Atom feeds
Diffstat (limited to 'app/services/process_interaction_service.rb')
-rw-r--r--app/services/process_interaction_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb
index 75051c5df..20ce3d00e 100644
--- a/app/services/process_interaction_service.rb
+++ b/app/services/process_interaction_service.rb
@@ -1,4 +1,6 @@
 class ProcessInteractionService < BaseService
+  ACTIVITY_NS = 'http://activitystrea.ms/spec/1.0/'.freeze
+
   # Record locally the remote interaction with our user
   # @param [String] envelope Salmon envelope
   # @param [Account] target_account Account the Salmon was addressed to
@@ -53,7 +55,7 @@ class ProcessInteractionService < BaseService
   end
 
   def verb(xml)
-    xml.at_xpath('//activity:verb').content.gsub('http://activitystrea.ms/schema/1.0/', '').gsub('http://ostatus.org/schema/1.0/', '').to_sym
+    xml.at_xpath('//activity:verb', activity: ACTIVITY_NS).content.gsub('http://activitystrea.ms/schema/1.0/', '').gsub('http://ostatus.org/schema/1.0/', '').to_sym
   rescue
     :post
   end
@@ -92,7 +94,7 @@ class ProcessInteractionService < BaseService
   end
 
   def activity_id(xml)
-    xml.at_xpath('//activity:object/xmlns:id').content
+    xml.at_xpath('//activity:object/xmlns:id', activity: ACTIVITY_NS).content
   end
 
   def salmon