diff options
author | Evan Prodromou <evan@status.net> | 2010-09-01 16:16:38 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-01 16:16:38 -0400 |
commit | 3baff9aa98005c6f72d295f681bc211102614946 (patch) | |
tree | bc2e55755d8e0febd7dd0931de7700a1f77d7db8 /plugins/OStatus | |
parent | a2de30b767e23ae848d15a3ce1d3ed9d16fd1df9 (diff) |
Handle profile-from-uri hook to return ostatus profile if there's a match
Diffstat (limited to 'plugins/OStatus')
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 6fef20d6f..fff692c82 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -492,7 +492,7 @@ class OStatusPlugin extends Plugin * Tell the FeedSub infrastructure whether we have any active OStatus * usage for the feed; if not it'll be able to garbage-collect the * feed subscription. - * + * * @param FeedSub $feedsub * @param integer $count in/out * @return mixed hook return code @@ -995,4 +995,18 @@ class OStatusPlugin extends Plugin $feed = $oprofile->feeduri; 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; + } } |