]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
only show subscribe button in profile list for local users
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 3 Jul 2009 14:14:02 +0000 (10:14 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 3 Jul 2009 14:14:02 +0000 (10:14 -0400)
lib/profilelist.php

index a604230f85dd5c0554823cf0747550082dbd1610..e13d56a9a697c30edaf1071cb46f2d6f1e3322f7 100644 (file)
@@ -243,15 +243,20 @@ class ProfileListItem extends Widget
         $user = common_current_user();
 
         if (!empty($user) && $this->profile->id != $user->id) {
-            $this->out->elementStart('li', 'entity_subscribe');
-            if ($user->isSubscribed($this->profile)) {
-                $usf = new UnsubscribeForm($this->out, $this->profile);
-                $usf->show();
-            } else {
-                $sf = new SubscribeForm($this->out, $this->profile);
-                $sf->show();
+            // Is it a local user? can't remote sub from a list
+            // XXX: make that possible!
+            $other = User::staticGet('id', $this->profile->id);
+            if (!empty($other)) {
+                $this->out->elementStart('li', 'entity_subscribe');
+                if ($user->isSubscribed($this->profile)) {
+                    $usf = new UnsubscribeForm($this->out, $this->profile);
+                    $usf->show();
+                } else {
+                    $sf = new SubscribeForm($this->out, $this->profile);
+                    $sf->show();
+                }
+                $this->out->elementEnd('li');
             }
-            $this->out->elementEnd('li');
         }
     }