diff --git a/app/models/status_message.rb b/app/models/status_message.rb index c616efc5e7fa11ddc17f2246c649a0bbba442851..327f74f64e909cd14ef1ff39ad23089e849acbcd 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -13,12 +13,12 @@ class StatusMessage < Post def to_activity <<-XML <entry> - <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> - <title>#{self.message}</title> - <link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/> - <id>#{person.url}status_messages/#{self.id}</id> - <published>#{self.created_at.xmlschema}</published> - <updated>#{self.updated_at.xmlschema}</updated> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <title>#{self.message}</title> + <link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/> + <id>#{person.url}status_messages/#{self.id}</id> + <published>#{self.created_at.xmlschema}</published> + <updated>#{self.updated_at.xmlschema}</updated> </entry> XML end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index fbf6563f9ae0dd133aa65a56e7d5df88a72ba59c..60c90f7047c810cdd9bd56f5c2c3da1bb2aa87c1 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -24,35 +24,35 @@ module Diaspora end def create_headers - <<-XML.strip - <?xml version="1.0" encoding="UTF-8"?> - <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/"> - <generator uri="http://joindiaspora.com/">Diaspora</generator> - <id>#{@user.public_url}</id> - <title>#{@user.real_name}'s Public Feed</title> - <subtitle>its a stream</subtitle> - <updated>#{Time.now.xmlschema}</updated> - <author> - <name>#{@user.real_name}</name> - <uri>#{@user.public_url}</uri> - </author> + <<-XML +<?xml version="1.0" encoding="UTF-8"?> +<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/"> +<generator uri="http://joindiaspora.com/">Diaspora</generator> +<id>#{@user.public_url}</id> +<title>#{@user.real_name}'s Public Feed</title> +<subtitle>its a stream</subtitle> +<updated>#{Time.now.xmlschema}</updated> +<author> + <name>#{@user.real_name}</name> + <uri>#{@user.public_url}</uri> +</author> XML end def create_endpoints <<-XML - <link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/> +<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/> XML end def create_subject <<-XML - <activity:subject> - <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> - <id>#{@user.public_url}</id> - <title>#{@user.real_name}</title> - <link rel="alternative" type="text/html" href="#{@user.public_url}"/> - </activity:subject> +<activity:subject> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <id>#{@user.public_url}</id> + <title>#{@user.real_name}</title> + <link rel="alternative" type="text/html" href="#{@user.public_url}"/> +</activity:subject> XML end @@ -70,7 +70,7 @@ module Diaspora def create_footer <<-XML - </feed> +</feed> XML end end