]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapifriendships.php
move scripts to just before </body>, add event for scripts that need to be in <head>
[quix0rs-gnu-social.git] / actions / twitapifriendships.php
index 015a5dbaed2f577a297eb003f808e9808473e055..eea8945c393402d7080bda3534f38116ffe9bc7b 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET')) {
+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;