summaryrefslogtreecommitdiff
path: root/lib/command.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-16 11:23:00 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-16 11:23:00 -0500
commit0e7dd81a6cf38c879f24f476411104d67b9eb177 (patch)
treefe6108427cc3b99dfcca9570d344c6e569a9bb09 /lib/command.php
parent717758563038e802976fbd5fcdede45804b82c51 (diff)
Added a "groups" command
Diffstat (limited to 'lib/command.php')
-rw-r--r--lib/command.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/command.php b/lib/command.php
index 247ea4475..0c98c94ac 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -643,6 +643,25 @@ class SubscribersCommand extends Command
}
}
+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=_('You are a member of these groups: ');
+ $out.=implode(', ',$groups);
+ }
+ $channel->output($this->user,$out);
+ }
+}
+
class HelpCommand extends Command
{
function execute($channel)
@@ -653,6 +672,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".