Commit c75f92d0 authored by Benjamin Neff's avatar Benjamin Neff Committed by Dennis Schubert
Browse files

add XMLLogger to debug federation

parent 97153ad0
......@@ -23,11 +23,13 @@ module Diaspora
module InstanceMethods
def to_diaspora_xml
xml = to_xml
::Logging::Logger["XMLLogger"].debug "to_xml: #{xml}"
<<-XML
<XML>
<post>#{to_xml.to_s}</post>
<post>#{xml}</post>
</XML>
XML
XML
end
def x(input)
......
......@@ -8,6 +8,7 @@ module Diaspora
doc = Nokogiri::XML(xml) {|cfg| cfg.noblanks }
return unless body = doc.xpath("/XML/post").children.first
class_name = body.name.gsub("-", "/")
::Logging::Logger["XMLLogger"].debug "from_xml: #{body}"
begin
class_name.camelize.constantize.from_xml body.to_s
rescue NameError => e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment