]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/command.php
Merge branch 'admin-sections/4' into 0.9.x
[quix0rs-gnu-social.git] / lib / command.php
index 247ea447582a0d4d35568ad5c364aa1d1d5e5a1e..7e98156b6679fd355e561f1839f27e1daad3e2f9 100644 (file)
@@ -617,8 +617,11 @@ class SubscriptionsCommand extends Command
         if(count($nicknames)==0){
             $out=_('You are not subscribed to anyone.');
         }else{
-            $out=_('You are subscribed to these people: ');
-            $out.=implode(', ',$nicknames);
+            $out = ngettext('You are subscribed to this person:',
+                'You are subscribed to these people:',
+                count($nicknames));
+            $out .= ' ';
+            $out .= implode(', ',$nicknames);
         }
         $channel->output($this->user,$out);
     }
@@ -636,8 +639,32 @@ class SubscribersCommand extends Command
         if(count($nicknames)==0){
             $out=_('No one is subscribed to you.');
         }else{
-            $out=_('These people are subscribed to you: ');
-            $out.=implode(', ',$nicknames);
+            $out = ngettext('This person is subscribed to you:',
+                'These people are subscribed to you:',
+                count($nicknames));
+            $out .= ' ';
+            $out .= implode(', ',$nicknames);
+        }
+        $channel->output($this->user,$out);
+    }
+}
+
+class GroupsCommand extends Command
+{
+    function execute($channel)
+    {
+        $group = $this->user->getGroups();
+        $groups=array();
+        while ($group->fetch()) {
+            $groups[]=$group->nickname;
+        }
+        if(count($groups)==0){
+            $out=_('You are not a member of any groups.');
+        }else{
+            $out = ngettext('You are a member of this group:',
+                'You are a member of these groups:',
+                count($nicknames));
+            $out.=implode(', ',$groups);
         }
         $channel->output($this->user,$out);
     }
@@ -653,6 +680,7 @@ class HelpCommand extends Command
                            "off - turn off notifications\n".
                            "help - show this help\n".
                            "follow <nickname> - subscribe to user\n".
+                           "groups - lists the groups you have joined\n".
                            "subscriptions - list the people you follow\n".
                            "subscribers - list the people that follow you\n".
                            "leave <nickname> - unsubscribe from user\n".