]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/command.php
Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / lib / command.php
index 8080fb8bc0071de9f4a4b991d1fb7f6a524ea69b..216f9e649a33af4660bdc4fcaa2965571d0b1d0c 100644 (file)
@@ -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".