X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Ftwitapiaccount.php;h=0a57ad91c3c759ecb909174dee4f01082a7d5521;hb=0bba990e2f4506da877224285442c81f68662743;hp=3a0fd85447ddb8a130bfd664ce87758cfd025add;hpb=00a6f3d01510e01a5dcc0999a50fba7bafbcd5e1;p=quix0rs-gnu-social.git diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index 3a0fd85447..0a57ad91c3 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -23,6 +23,20 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiaccountAction extends TwitterapiAction { + function is_readonly() { + + static $write_methods = array( 'update_location', + 'update_delivery_device'); + + $cmdtext = explode('.', $this->arg('method')); + + if (in_array($cmdtext[0], $write_methods)) { + return false; + } + + return true; + } + function verify_credentials($args, $apidata) { if ($apidata['content-type'] == 'xml') { @@ -51,7 +65,7 @@ class TwitapiaccountAction extends TwitterapiAction { if (!is_null($location) && strlen($location) > 255) { - // XXX: Twitter just truncates and runs with it. + // XXX: But Twitter just truncates and runs with it. -- Zach header('HTTP/1.1 406 Not Acceptable'); print "That's too long. Max notice size is 255 chars.\n"; exit(); @@ -80,9 +94,11 @@ class TwitapiaccountAction extends TwitterapiAction { } common_broadcast_profile($profile); + $type = $apidata['content-type']; - $apidata['api_arg'] = $user->id; - $this->show($args, $apidata); + $this->init_document($type); + $this->show_profile($profile, $type); + $this->end_document($type); exit(); }