]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Refactored remote subscribe action in OStatus
authorSarven Capadisli <csarven@status.net>
Tue, 2 Mar 2010 17:41:18 +0000 (12:41 -0500)
committerSarven Capadisli <csarven@status.net>
Tue, 2 Mar 2010 17:41:18 +0000 (12:41 -0500)
plugins/OStatus/OStatusPlugin.php

index 64504547f49b3618c65b4f3ecd184dcb8d21e543..7b6d22acf3bf3c7b9aa0d42509b8c5b99bf895b2 100644 (file)
@@ -706,22 +706,19 @@ 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)) {
@@ -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.