From f0d1d07b94fbd2fe0ecd1c2f18d831a177d11c5c Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 22 Feb 2010 22:57:16 -0500 Subject: Add lose command to the command interpreter --- lib/command.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lib/command.php') diff --git a/lib/command.php b/lib/command.php index ea7b60372..db8e80030 100644 --- a/lib/command.php +++ b/lib/command.php @@ -668,6 +668,34 @@ class LoginCommand extends Command } } +class LoseCommand extends Command +{ + + var $other = null; + + function __construct($user, $other) + { + parent::__construct($user); + $this->other = $other; + } + + function execute($channel) + { + if(!$this->other) { + $channel->error($this->user, _('Specify the name of the user to unsubscribe from')); + return; + } + + $result=subs_unsubscribe_from($this->user, $this->other); + + if ($result) { + $channel->output($this->user, sprintf(_('Unsubscribed %s'), $this->other)); + } else { + $channel->error($this->user, $result); + } + } +} + class SubscriptionsCommand extends Command { function execute($channel) @@ -750,6 +778,7 @@ class HelpCommand extends Command "d - direct message to user\n". "get - get last notice from user\n". "whois - get profile info on user\n". + "lose - force user to stop following you\n". "fav - add user's last notice as a 'fave'\n". "fav # - add notice with the given id as a 'fave'\n". "repeat # - repeat a notice with a given id\n". -- cgit v1.2.3