]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/profilesettings.php
update location while saving new profile
[quix0rs-gnu-social.git] / actions / profilesettings.php
index 5445d9bb257ee0c513ead7c2799a1f11958cbe81..0a0cc59973a3709c272a93e74bf1e9176f46c5d5 100644 (file)
@@ -306,6 +306,16 @@ class ProfilesettingsAction extends AccountSettingsAction
             $profile->homepage = $homepage;
             $profile->bio = $bio;
             $profile->location = $location;
+
+            $loc = Location::fromName($location);
+
+            if (!empty($loc)) {
+                $profile->lat         = $loc->lat;
+                $profile->lon         = $loc->lon;
+                $profile->location_id = $loc->location_id;
+                $profile->location_ns = $loc->location_ns;
+            }
+
             $profile->profileurl = common_profile_url($nickname);
 
             common_debug('Old profile: ' . common_log_objstring($orig_profile), __FILE__);