summaryrefslogtreecommitdiff
path: root/plugins/OStatus
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-20 17:18:55 -0500
committerEvan Prodromou <evan@status.net>2010-03-20 17:18:55 -0500
commitc2afdfbbf5534474d0c5289e7916e77a612aadfd (patch)
treef0874c8ca7d4b8ff28246ba9cb2749c4c521895c /plugins/OStatus
parent97bd7e22da893ac2d93e66d7f4747358713e739b (diff)
use Posterous element if available for RssChannel discovery
Diffstat (limited to 'plugins/OStatus')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index efb12a2dd..1c110ab24 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -893,6 +893,20 @@ class Ostatus_profile extends Memcached_DataObject
public static function ensureRssChannel($feedEl, $hints)
{
+ // Special-case for Posterous. They have some nice metadata in their
+ // posterous:author elements. We should use them instead of the channel.
+
+ $items = $feedEl->getElementsByTagName('item');
+
+ if ($items->length > 0) {
+ $item = $items->item(0);
+ $authorEl = ActivityUtils::child($item, ActivityObject::AUTHOR, ActivityObject::POSTEROUS);
+ if (!empty($authorEl)) {
+ $obj = ActivityObject::fromPosterousAuthor($authorEl);
+ return self::ensureActivityObjectProfile($obj, $hints);
+ }
+ }
+
// @fixme we should check whether this feed has elements
// with different <author> or <dc:creator> elements, and... I dunno.
// Do something about that.