]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
save location at notice post time
authorEvan Prodromou <evan@status.net>
Wed, 23 Dec 2009 05:58:23 +0000 (21:58 -0800)
committerEvan Prodromou <evan@status.net>
Wed, 23 Dec 2009 05:58:23 +0000 (21:58 -0800)
actions/newnotice.php

index c6c70e32600bb69ac1abf3e74eec43bdb6ee295a..c014f1781cd9b380b46a160e3113bc846057327f 100644 (file)
@@ -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');