summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-22 21:58:23 -0800
committerEvan Prodromou <evan@status.net>2009-12-22 21:58:23 -0800
commit725b2d0475ba3d0dcfafd48a191b4ddee09cae68 (patch)
tree085e607f1121ae58c37ceb5e3f7269cd8a1b066e /actions
parentfa0fbd011812e9df52c9e5684d4cf953c6f75d8e (diff)
save location at notice post time
Diffstat (limited to 'actions')
-rw-r--r--actions/newnotice.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index c6c70e326..c014f1781 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -169,6 +169,14 @@ class NewnoticeAction extends Action
$location_id = $this->trimmed('location_id');
$location_ns = $this->trimmed('location_ns');
+ if (!empty($lat) && !empty($lon) && empty($location_id)) {
+ $location = Location::fromLatLon($lat, $lon);
+ if (!empty($location)) {
+ $location_id = $location->location_id;
+ $location_ns = $location->location_ns;
+ }
+ }
+
$upload = null;
$upload = MediaFile::fromUpload('attach');