+class LoseCommand extends Command
+{
+ var $other = null;
+
+ function __construct($user, $other)
+ {
+ parent::__construct($user);
+ $this->other = $other;
+ }
+
+ function execute($channel)
+ {
+ if(!$this->other) {
+ // TRANS: Error text shown when no username was provided when issuing the command.
+ $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) {
+ // TRANS: Text shown after issuing the lose command successfully (stop another user from following the current user).
+ // TRANS: %s is the name of the user the unsubscription was requested for.
+ $channel->output($this->user, sprintf(_('Unsubscribed %s.'), $this->other));
+ } else {
+ $channel->error($this->user, $result);
+ }
+ }
+}
+