summaryrefslogtreecommitdiff
path: root/plugins/OStatus
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-20 06:44:38 -0500
committerEvan Prodromou <evan@status.net>2010-03-20 06:44:38 -0500
commit51283a1b34b52b22a17cd87f7b23ce384b7b6303 (patch)
tree24c454a5ee2194073667baba56eb0d211dbef35f /plugins/OStatus
parentdb9e57f761b6414e974163e7224d7f04ece291d7 (diff)
try to make a nickname from the user profile url before using the URI
Diffstat (limited to 'plugins/OStatus')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 80b980aba..31fba009e 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -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