From 87b618ab02d5265e47bd3455a41c5c31d77905a5 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 10 Oct 2016 18:05:52 +0200 Subject: Fix namespace parsing in Atom feeds --- app/services/process_interaction_service.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/services/process_interaction_service.rb') 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 -- cgit