]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapifriendships.php
Updated mobilelogo extension
[quix0rs-gnu-social.git] / actions / twitapifriendships.php
index b730edcdf79bbf6d900d232155e41a08fb7141f3..eea8945c393402d7080bda3534f38116ffe9bc7b 100644 (file)
@@ -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;