Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing

This commit is contained in:
Zach Copley
2010-02-22 01:23:24 -08:00
18 changed files with 597 additions and 466 deletions

View File

@@ -882,28 +882,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;