]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
only use Posterous author data if it matches the profile URL
authorEvan Prodromou <evan@status.net>
Sun, 21 Mar 2010 12:37:58 +0000 (07:37 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 21 Mar 2010 12:37:58 +0000 (07:37 -0500)
plugins/OStatus/classes/Ostatus_profile.php

index 1c110ab2472dc7995768d62de3f44b792ab17e90..e48ed6ee8b353be10a78b5ebd613be7eaf7c57c3 100644 (file)
@@ -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);
+                }
             }
         }