summaryrefslogtreecommitdiff
path: root/actions/twitapifriendships.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/twitapifriendships.php')
-rw-r--r--actions/twitapifriendships.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php
index 5fb55e9ff..eea8945c3 100644
--- a/actions/twitapifriendships.php
+++ b/actions/twitapifriendships.php
@@ -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;