]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapiaccount.php
fix problem with new notices
[quix0rs-gnu-social.git] / actions / twitapiaccount.php
index 3a0fd85447ddb8a130bfd664ce87758cfd025add..0a57ad91c3c759ecb909174dee4f01082a7d5521 100644 (file)
@@ -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();
        }