diff options
author | Evan Prodromou <evan@status.net> | 2010-03-13 06:36:25 -0600 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-13 06:36:25 -0600 |
commit | c1e96cbdefa66e66815c421378b9452d7c8d5548 (patch) | |
tree | a08e80d705d08ffb33233991bf80e7c19867552a /lib/command.php | |
parent | a2cc26ba8a21aa3614ebfc4a77c0bec9ffb2655d (diff) | |
parent | 9e9ab23e1f936eb62014d8f7b0051f0314ae482c (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'lib/command.php')
-rw-r--r-- | lib/command.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/command.php b/lib/command.php index 9d550550f..f7421269d 100644 --- a/lib/command.php +++ b/lib/command.php @@ -711,6 +711,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 = Subscription::cancel($this->getProfile($this->other), $this->user->getProfile()); + + if ($result) { + $channel->output($this->user, sprintf(_('Unsubscribed %s'), $this->other)); + } else { + $channel->error($this->user, $result); + } + } +} + class SubscriptionsCommand extends Command { function handle($channel) @@ -793,6 +821,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". |