diff options
author | Zach Copley <zach@status.net> | 2010-02-16 16:22:58 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-16 16:22:58 -0800 |
commit | c892726c80b4e466b2bbad0f7b396cf0c7a137d9 (patch) | |
tree | 015b28c37e1241f1601171b78fb65ea71f40d319 /classes/Profile.php | |
parent | 014a32e6b873291bcd289a1ed25759a7a29221d7 (diff) |
Take remote profiles into account when looking up canonical profile URIs
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 8f578c95a..5a86619fd 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -810,10 +810,7 @@ class Profile extends Memcached_DataObject $xs->element( 'id', null, - common_local_url( - 'userbyid', - array('id' => $this->id) - ) + $this->getUri() ); $xs->element('title', null, $this->getBestName()); @@ -835,9 +832,21 @@ class Profile extends Memcached_DataObject return $xs->getString(); } - function getAcctUri() + function getUri() { - return $this->nickname . '@' . common_config('site', 'server'); + if (Event::handle('GetProfileUri', array($this))) { + + $remote = Remote_profile::staticGet('id', $this->id); + + if (!empty($remote)) { + return $remote->uri; + } else { + return common_local_url( + 'userbyid', + array('id' => $this->id) + ); + } + } } } |