]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapifriendships.php
remove spurious readme from Orbited
[quix0rs-gnu-social.git] / actions / twitapifriendships.php
index 5fb55e9ffed488ddcd47ae6bfc08ff5ecb109e14..eea8945c393402d7080bda3534f38116ffe9bc7b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -99,6 +99,12 @@ class TwitapifriendshipsAction extends TwitterapiAction
         $other = $this->get_profile($id);
         $user = $apidata['user']; // Alwyas the auth user
 
+       if ($user->id == $other->id) {
+           $this->clientError(_("You cannot unfollow yourself!"),
+                              403, $apidata['content-type']);
+           return;
+       }
+
         $sub = new Subscription();
         $sub->subscriber = $user->id;
         $sub->subscribed = $other->id;