OStatusPlugin does discovery in Profile::fromURI()
This commit is contained in:
parent
dce2824747
commit
a2aa87fbff
@ -992,17 +992,29 @@ class OStatusPlugin extends Plugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStartGetProfileFromURI($uri, &$profile) {
|
function onStartGetProfileFromURI($uri, &$profile)
|
||||||
|
{
|
||||||
|
// Don't want to do Web-based discovery on our own server,
|
||||||
|
// so we check locally first.
|
||||||
|
|
||||||
// XXX: do discovery here instead (OStatus_profile::ensureProfileURI($uri))
|
$user = User::staticGet('uri', $uri);
|
||||||
|
|
||||||
$oprofile = Ostatus_profile::staticGet('uri', $uri);
|
if (!empty($user)) {
|
||||||
|
$profile = $user->getProfile();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($oprofile) && !$oprofile->isGroup()) {
|
// Now, check remotely
|
||||||
|
|
||||||
|
$oprofile = Ostatus_profile::ensureProfileURI($uri);
|
||||||
|
|
||||||
|
if (!empty($oprofile)) {
|
||||||
$profile = $oprofile->localProfile();
|
$profile = $oprofile->localProfile();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Still not a hit, so give up.
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user