summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-01 16:16:38 -0400
committerEvan Prodromou <evan@status.net>2010-09-01 16:16:38 -0400
commit3baff9aa98005c6f72d295f681bc211102614946 (patch)
treebc2e55755d8e0febd7dd0931de7700a1f77d7db8 /plugins
parenta2de30b767e23ae848d15a3ce1d3ed9d16fd1df9 (diff)
Handle profile-from-uri hook to return ostatus profile if there's a match
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/OStatusPlugin.php16
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;
+ }
}