diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-21 19:55:53 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-21 19:55:53 -0800 |
commit | bd3051b85cdd7a135cac446b13251f739e2c74ac (patch) | |
tree | 61940807cdb21335d9f5e097502520a5542d0d3f | |
parent | 5207783765328a3d6f0101f143edb8807247bcfe (diff) | |
parent | cc18f757a8e6ef854cae89d8947efac505b1fd7c (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
-rw-r--r-- | classes/Profile.php | 22 | ||||
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 10 |
2 files changed, 18 insertions, 14 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 6b396c8c3..5ff746e30 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -841,28 +841,22 @@ class Profile extends Memcached_DataObject { $uri = null; - // check for a local user first - $user = User::staticGet('id', $this->id); + // give plugins a chance to set the URI + if (Event::handle('StartGetProfileUri', array($this, &$uri))) { - if (!empty($user)) { - $uri = common_local_url( - 'userbyid', - array('id' => $user->id) - ); - } else { - - // give plugins a chance to set the URI - if (Event::handle('StartGetProfileUri', array($this, &$uri))) { + // check for a local user first + $user = User::staticGet('id', $this->id); + if (!empty($user)) { + $uri = $user->uri; + } else { // return OMB profile if any $remote = Remote_profile::staticGet('id', $this->id); - if (!empty($remote)) { $uri = $remote->uri; } - - Event::handle('EndGetProfileUri', array($this, &$uri)); } + Event::handle('EndGetProfileUri', array($this, &$uri)); } return $uri; diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 5b9e3be2b..548c87711 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -485,4 +485,14 @@ class OStatusPlugin extends Plugin return true; } + + function onStartGetProfileUri($profile, &$uri) + { + $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id); + if (!empty($oprofile)) { + $uri = $oprofile->uri; + return false; + } + return true; + } } |