Add lose <nickname> command to the command interpreter

This commit is contained in:
Craig Andrews
2010-02-22 22:57:16 -05:00
parent daccaeb748
commit f0d1d07b94
3 changed files with 84 additions and 1 deletions

View File

@@ -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 <nickname> <text> - direct message to user\n".
"get <nickname> - get last notice from user\n".
"whois <nickname> - get profile info on user\n".
"lose <nickname> - force user to stop following you\n".
"fav <nickname> - add user's last notice as a 'fave'\n".
"fav #<notice_id> - add notice with the given id as a 'fave'\n".
"repeat #<notice_id> - repeat a notice with a given id\n".