diff options
Diffstat (limited to 'actions/twitapistatuses.php')
-rw-r--r-- | actions/twitapistatuses.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 3a06d146c..30f2e514a 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -28,12 +28,22 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapistatusesAction extends TwitterapiAction { function is_readonly() { - return false; + + static $write_methods = array( 'update', + 'destroy'); + + $cmdtext = explode('.', $this->arg('method')); + + if (in_array($cmdtext[0], $write_methods)) { + return false; + } + + return true; } function public_timeline($args, $apidata) { parent::handle($args); - + $sitename = common_config('site', 'name'); $siteserver = common_config('site', 'server'); $title = sprintf(_("%s public timeline"), $sitename); @@ -365,6 +375,9 @@ class TwitapistatusesAction extends TwitterapiAction { $user = $apidata['user']; + $this->is_readonly(); + + $notice = DB_DataObject::factory('notice'); $notice->profile_id = $user->id; # user id *is* profile id |