diff options
author | Sarven Capadisli <csarven@status.net> | 2010-03-02 12:41:18 -0500 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-03-02 12:41:18 -0500 |
commit | e3c2b8e0b50d750ad35cb313726fd2706684c09b (patch) | |
tree | 4ee47b9b399d487a8ce8ad84b6b17b422123fd83 | |
parent | 88c33bbb57433b3f10407f590b49d11ec4d5d530 (diff) |
Refactored remote subscribe action in OStatus
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 64504547f..7b6d22acf 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -706,23 +706,20 @@ class OStatusPlugin extends Plugin function onStartShowSubscriptionsContent($action) { - $user = common_current_user(); - if ($user && ($user->id == $action->profile->id)) { - $action->elementStart('div', 'entity_actions'); - $action->elementStart('p', array('id' => 'entity_remote_subscribe', - 'class' => 'entity_subscribe')); - $action->element('a', array('href' => common_local_url('ostatussub'), - 'class' => 'entity_remote_subscribe') - , _m('Subscribe to remote user')); - $action->elementEnd('p'); - $action->elementEnd('div'); - } + $this->showEntityRemoteSubscribe($action); return true; } function onStartShowAllContent($action) { + $this->showEntityRemoteSubscribe($action); + + return true; + } + + function showEntityRemoteSubscribe($action) + { $user = common_current_user(); if ($user && ($user->id == $action->profile->id)) { $action->elementStart('div', 'entity_actions'); @@ -734,11 +731,8 @@ class OStatusPlugin extends Plugin $action->elementEnd('p'); $action->elementEnd('div'); } - - return true; } - /** * Ping remote profiles with updates to this profile. * Salmon pings are queued for background processing. |