forked from GNUsocial/gnu-social
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
This commit is contained in:
commit
bd3051b85c
@ -841,28 +841,22 @@ class Profile extends Memcached_DataObject
|
||||
{
|
||||
$uri = null;
|
||||
|
||||
// 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 = common_local_url(
|
||||
'userbyid',
|
||||
array('id' => $user->id)
|
||||
);
|
||||
$uri = $user->uri;
|
||||
} else {
|
||||
|
||||
// give plugins a chance to set the URI
|
||||
if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
|
||||
|
||||
// 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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user