diff options
author | Evan Prodromou <evan@status.net> | 2009-11-10 16:27:23 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-10 16:27:23 -0500 |
commit | 1f5f5474f175a8248b362f8be4ff23bb5e971305 (patch) | |
tree | c38d9b80db71ba403c61079502bc12bfe2732654 /actions/apistatusesupdate.php | |
parent | 348b155376eac2130150cd041bca9fd4799334cf (diff) | |
parent | 651cbf0681b6d263dde673ce36811710bfe553b8 (diff) |
Merge branch '0.9.x' into adminpanel
Diffstat (limited to 'actions/apistatusesupdate.php')
-rw-r--r-- | actions/apistatusesupdate.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 5c23accca..7ddf7703b 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -61,6 +61,9 @@ class ApiStatusesUpdateAction extends ApiAuthAction var $source = null; var $status = null; var $in_reply_to_status_id = null; + var $lat = null; + var $lon = null; + static $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api'); /** @@ -79,6 +82,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction $this->user = $this->auth_user; $this->status = $this->trimmed('status'); $this->source = $this->trimmed('source'); + $this->lat = $this->trimmed('lat'); + $this->lon = $this->trimmed('long'); if (empty($this->source) || in_array($source, self::$reserved_sources)) { $this->source = 'api'; @@ -198,6 +203,12 @@ class ApiStatusesUpdateAction extends ApiAuthAction } } + $location = null; + + if (!empty($this->lat) && !empty($this->lon)) { + $location = Location::fromLatLon($this->lat, $this->lon); + } + $upload = null; try { @@ -225,7 +236,13 @@ class ApiStatusesUpdateAction extends ApiAuthAction html_entity_decode($status_shortened, ENT_NOQUOTES, 'UTF-8'), $this->source, 1, - $reply_to + $reply_to, + null, + null, + empty($location) ? null : $location->lat, + empty($location) ? null : $location->lon, + empty($location) ? null : $location->location_id, + empty($location) ? null : $location->location_ns ); if (isset($upload)) { |