summaryrefslogtreecommitdiff
path: root/lib/command.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-16 00:19:47 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-16 00:19:47 -0500
commitf04dbc8fa21d86bae5c34ece2637c3c345e29927 (patch)
tree000ea48e45ccbd13905f8093d9c52f6d2520f143 /lib/command.php
parent6470ccd1b869808d2fca530b9ee53e6a574646c4 (diff)
Add "followers" and "following" commands
Diffstat (limited to 'lib/command.php')
-rw-r--r--lib/command.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/command.php b/lib/command.php
index 2ec3320de..c4a4f7cf4 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -605,6 +605,44 @@ class LoginCommand extends Command
}
}
+class FollowingCommand extends Command
+{
+ function execute($channel)
+ {
+ $profile = $this->user->getSubscriptions(0);
+ $nicknames=array();
+ while ($profile->fetch()) {
+ $nicknames[]=$profile->nickname;
+ }
+ if(count($nicknames)==0){
+ $out=_('You are not subscribed to anyone.');
+ }else{
+ $out=_('You are subscribed to these people: ');
+ $out.=implode(', ',$nicknames);
+ }
+ $channel->output($this->user,$out);
+ }
+}
+
+class FollowersCommand extends Command
+{
+ function execute($channel)
+ {
+ $profile = $this->user->getSubscribers();
+ $nicknames=array();
+ while ($profile->fetch()) {
+ $nicknames[]=$profile->nickname;
+ }
+ if(count($nicknames)==0){
+ $out=_('No one is subscribed to you.');
+ }else{
+ $out=_('These people are subscribed to you: ');
+ $out.=implode(', ',$nicknames);
+ }
+ $channel->output($this->user,$out);
+ }
+}
+
class HelpCommand extends Command
{
function execute($channel)
@@ -615,6 +653,8 @@ class HelpCommand extends Command
"off - turn off notifications\n".
"help - show this help\n".
"follow <nickname> - subscribe to user\n".
+ "following - list the people you follow\n".
+ "followers - list the people that follow you\n".
"leave <nickname> - unsubscribe from user\n".
"d <nickname> <text> - direct message to user\n".
"get <nickname> - get last notice from user\n".