diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-03 11:42:02 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-03 11:42:02 -0800 |
commit | 13521cb510f2377e9b865b0506f92ada9ef9b3cd (patch) | |
tree | 253eb64f09ecc821ba273cee88514775495b5f97 /plugins/OStatus/OStatusPlugin.php | |
parent | e793b5661c2344371a14dfb87b0302a95da5ea48 (diff) | |
parent | ccd0db1e0a928fe914c894966ecf2260964a68f0 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 95414e517..da7ca2fe2 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -111,11 +111,11 @@ class OStatusPlugin extends Plugin $acct = 'acct:'. $action->profile->nickname .'@'. common_config('site', 'server'); $url = common_local_url('xrd'); $url.= '?uri='. $acct; - + header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="application/xrd+xml"'); } } - + /** * Set up a PuSH hub link to our internal link for canonical timeline * Atom feeds for users and groups. @@ -229,7 +229,6 @@ class OStatusPlugin extends Plugin return false; } - /** * Check if we've got remote replies to send via Salmon. * @@ -587,7 +586,6 @@ class OStatusPlugin extends Plugin // Drop the PuSH subscription if there are no other subscribers. $oprofile->garbageCollect(); - $member = Profile::staticGet($user->id); $act = new Activity(); @@ -738,6 +736,13 @@ class OStatusPlugin extends Plugin return true; } + function onEndShowGroupsMiniList($action) + { + $this->showEntityRemoteSubscribe($action); + + return true; + } + function showEntityRemoteSubscribe($action) { $user = common_current_user(); @@ -747,7 +752,7 @@ class OStatusPlugin extends Plugin 'class' => 'entity_subscribe')); $action->element('a', array('href' => common_local_url('ostatussub'), 'class' => 'entity_remote_subscribe') - , _m('New')); + , _m('Remote')); $action->elementEnd('p'); $action->elementEnd('div'); } @@ -799,4 +804,28 @@ class OStatusPlugin extends Plugin return true; } + + function onStartProfileListItemActionElements($item) + { + if (!common_logged_in()) { + + $profileUser = User::staticGet('id', $item->profile->id); + + if (!empty($profileUser)) { + + $output = $item->out; + + // Add an OStatus subscribe + $output->elementStart('li', 'entity_subscribe'); + $url = common_local_url('ostatusinit', + array('nickname' => $profileUser->nickname)); + $output->element('a', array('href' => $url, + 'class' => 'entity_remote_subscribe'), + _m('Subscribe')); + $output->elementEnd('li'); + } + } + + return true; + } } |