From 0f1f7ab79bad2392e10f2bc0d310f5f77b05c531 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 21 Mar 2010 07:37:58 -0500 Subject: [PATCH] only use Posterous author data if it matches the profile URL --- plugins/OStatus/classes/Ostatus_profile.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 1c110ab247..e48ed6ee8b 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -903,7 +903,13 @@ class Ostatus_profile extends Memcached_DataObject $authorEl = ActivityUtils::child($item, ActivityObject::AUTHOR, ActivityObject::POSTEROUS); if (!empty($authorEl)) { $obj = ActivityObject::fromPosterousAuthor($authorEl); - return self::ensureActivityObjectProfile($obj, $hints); + // Posterous has multiple authors per feed, and multiple feeds + // per author. We check if this is the "main" feed for this author. + if (array_key_exists('profileurl', $hints) && + !empty($obj->poco) && + common_url_to_nickname($hints['profileurl']) == $obj->poco->preferredUsername) { + return self::ensureActivityObjectProfile($obj, $hints); + } } }