summaryrefslogtreecommitdiff
path: root/plugins/OStatus/OStatusPlugin.php
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-02-09 01:37:45 -0500
committerJames Walker <walkah@walkah.net>2010-02-09 01:37:45 -0500
commit841981a38140b793b7e950a0d2e057c720816ccb (patch)
tree0ef542b50ae2ba864a7c4afedade14fb63206488 /plugins/OStatus/OStatusPlugin.php
parent4e6f587f868d71f08c618d0dedf6ddf0331619c2 (diff)
discovery piece - hand merged :P
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r--plugins/OStatus/OStatusPlugin.php37
1 files changed, 36 insertions, 1 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 4e8b892c6..ce33344d2 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -53,6 +53,19 @@ class OStatusPlugin extends Plugin
*/
function onRouterInitialized($m)
{
+ $m->connect('.well-known/host-meta',
+ array('action' => 'hostmeta'));
+ $m->connect('main/webfinger',
+ array('action' => 'webfinger'));
+ $m->connect('main/ostatus',
+ array('action' => 'ostatusinit'));
+ $m->connect('main/ostatus?nickname=:nickname',
+ array('action' => 'ostatusinit'), array('nickname' => '[A-Za-z0-9_-]+'));
+ $m->connect('main/ostatussub',
+ array('action' => 'ostatussub'));
+ $m->connect('main/ostatussub',
+ array('action' => 'ostatussub'), array('feed' => '[A-Za-z0-9\.\/\:]+'));
+
$m->connect('main/push/hub', array('action' => 'pushhub'));
$m->connect('main/push/callback/:feed',
@@ -148,6 +161,28 @@ class OStatusPlugin extends Plugin
return true;
}
+ /**
+ * Add in an OStatus subscribe button
+ */
+ function onStartProfilePageActionsElements($output, $profile)
+ {
+ $cur = common_current_user();
+
+ if (empty($cur)) {
+ // Add an OStatus subscribe
+ $output->elementStart('li', 'entity_subscribe');
+ $url = common_local_url('ostatusinit',
+ array('nickname' => $profile->nickname));
+ $output->element('a', array('href' => $url,
+ 'class' => 'entity_remote_subscribe'),
+ _('OStatus'));
+
+ $output->elementEnd('li');
+ }
+ }
+
+
+
function onCheckSchema() {
// warning: the autoincrement doesn't seem to set.
// alter table feedinfo change column id id int(11) not null auto_increment;
@@ -155,5 +190,5 @@ class OStatusPlugin extends Plugin
$schema->ensureTable('feedinfo', Feedinfo::schemaDef());
$schema->ensureTable('hubsub', HubSub::schemaDef());
return true;
- }
+ }
}