From: Evan Prodromou Date: Wed, 23 Dec 2009 05:58:23 +0000 (-0800) Subject: save location at notice post time X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=725b2d0475ba3d0dcfafd48a191b4ddee09cae68;p=quix0rs-gnu-social.git save location at notice post time --- diff --git a/actions/newnotice.php b/actions/newnotice.php index c6c70e3260..c014f1781c 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');