Refactored remote subscribe action in OStatus

This commit is contained in:
Sarven Capadisli 2010-03-02 12:41:18 -05:00
parent 88c33bbb57
commit e3c2b8e0b5

View File

@ -706,22 +706,19 @@ class OStatusPlugin extends Plugin
function onStartShowSubscriptionsContent($action) function onStartShowSubscriptionsContent($action)
{ {
$user = common_current_user(); $this->showEntityRemoteSubscribe($action);
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');
}
return true; return true;
} }
function onStartShowAllContent($action) function onStartShowAllContent($action)
{
$this->showEntityRemoteSubscribe($action);
return true;
}
function showEntityRemoteSubscribe($action)
{ {
$user = common_current_user(); $user = common_current_user();
if ($user && ($user->id == $action->profile->id)) { if ($user && ($user->id == $action->profile->id)) {
@ -734,11 +731,8 @@ class OStatusPlugin extends Plugin
$action->elementEnd('p'); $action->elementEnd('p');
$action->elementEnd('div'); $action->elementEnd('div');
} }
return true;
} }
/** /**
* Ping remote profiles with updates to this profile. * Ping remote profiles with updates to this profile.
* Salmon pings are queued for background processing. * Salmon pings are queued for background processing.