Handle profile-from-uri hook to return ostatus profile if there's a match

This commit is contained in:
Evan Prodromou 2010-09-01 16:16:38 -04:00
parent a2de30b767
commit 3baff9aa98

View File

@ -492,7 +492,7 @@ class OStatusPlugin extends Plugin
* Tell the FeedSub infrastructure whether we have any active OStatus * Tell the FeedSub infrastructure whether we have any active OStatus
* usage for the feed; if not it'll be able to garbage-collect the * usage for the feed; if not it'll be able to garbage-collect the
* feed subscription. * feed subscription.
* *
* @param FeedSub $feedsub * @param FeedSub $feedsub
* @param integer $count in/out * @param integer $count in/out
* @return mixed hook return code * @return mixed hook return code
@ -995,4 +995,18 @@ class OStatusPlugin extends Plugin
$feed = $oprofile->feeduri; $feed = $oprofile->feeduri;
return false; return false;
} }
function onStartGetProfileFromURI($uri, &$profile) {
// XXX: do discovery here instead (OStatus_profile::ensureProfileURI($uri))
$oprofile = Ostatus_profile::staticGet('uri', $uri);
if (!empty($oprofile) && !$oprofile->isGroup()) {
$profile = $oprofile->localProfile();
return false;
}
return true;
}
} }