]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
try to make a nickname from the user profile url before using the URI
authorEvan Prodromou <evan@status.net>
Sat, 20 Mar 2010 11:44:38 +0000 (06:44 -0500)
committerEvan Prodromou <evan@status.net>
Sat, 20 Mar 2010 11:44:38 +0000 (06:44 -0500)
plugins/OStatus/classes/Ostatus_profile.php

index 80b980aba4dac360156c6ed36698993e9bc6b43b..31fba009ed0346c85788fbb7e74b53dfe8235176 100644 (file)
@@ -1322,9 +1322,19 @@ class Ostatus_profile extends Memcached_DataObject
             return $hints['nickname'];
         }
 
-        // Try the definitive ID
+        // Try the profile url (like foo.example.com or example.com/user/foo)
 
-        $nickname = self::nicknameFromURI($object->id);
+        $profileUrl = ($object->link) ? $object->link : $hints['profileurl'];
+
+        if (!empty($profileUrl)) {
+            $nickname = self::nicknameFromURI($profileUrl);
+        }
+
+        // Try the URI (may be a tag:, http:, acct:, ...
+
+        if (empty($nickname)) {
+            $nickname = self::nicknameFromURI($object->id);
+        }
 
         // Try a Webfinger if one was passed (way) down