From 802734d07eace79d3002e887d02d8585d3dd19f5 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth <mmn@hethane.se>
Date: Sun, 20 Oct 2013 12:50:27 +0200
Subject: [PATCH] Switch order of html/text for StatusNet backwards
 compatibility

StatusNet chooses the first content element in an Atom feed, while
it should really choose the 'html' representation for its 'rendered'
and 'text' representation for the (text-only) 'content'.

GNU social will implement a better algorithm for retrieving Atom
feeds, but that is yet to be done. So to avoid having link-less posts
on remote nodes, we'll just do the old switch-a-roo.

Other Atom readers, such as Mozilla Firefox, has the reverse priority
(choosing the last of the content elements).
---
 lib/activityobject.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/activityobject.php b/lib/activityobject.php
index e2869f9ae4..530c9aba15 100644
--- a/lib/activityobject.php
+++ b/lib/activityobject.php
@@ -698,13 +698,13 @@ class ActivityObject
                 // XXX: assuming HTML content here
                 $xo->element(
                     ActivityUtils::CONTENT,
-                    array('type' => 'text'),
-                    html_entity_decode(strip_tags($this->content), ENT_QUOTES, 'UTF-8')
+                    array('type' => 'html'),
+                    common_xml_safe_str($this->content)
                 );
                 $xo->element(
                     ActivityUtils::CONTENT,
-                    array('type' => 'html'),
-                    common_xml_safe_str($this->content)
+                    array('type' => 'text'),
+                    html_entity_decode(strip_tags($this->content), ENT_QUOTES, 'UTF-8')
                 );
             }
 
-- 
2.39.5