X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapifriendships.php;h=05c192ea6fc8bc46938c64d5a60b2dac2539a9bf;hb=575f70545171f6f5c94214ce88e5b07a1f517810;hp=19617a071bf07f96a5ec420dc53bc6324d96ee81;hpb=93ac0bcae3a600733045ad7a5bafabcdfd49d9e5;p=quix0rs-gnu-social.git diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index 19617a071b..05c192ea6f 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -23,6 +23,20 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapifriendshipsAction extends TwitterapiAction { + function is_readonly() { + + static $write_methods = array( 'create', + 'destroy'); + + $cmdtext = explode('.', $this->arg('method')); + + if (in_array($cmdtext[0], $write_methods)) { + return false; + } + + return true; + } + function create($args, $apidata) { parent::handle($args); @@ -129,8 +143,8 @@ class TwitapifriendshipsAction extends TwitterapiAction { $user_a_id = $this->trimmed('user_a'); $user_b_id = $this->trimmed('user_b'); - $user_a = $this->get_profile($user_a_id); - $user_b = $this->get_profile($user_b_id); + $user_a = $this->get_user($user_a_id); + $user_b = $this->get_user($user_b_id); if (!$user_a || !$user_b) { $this->client_error(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']);