X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=8bb09aa6dd76d52379fcc7b9f723b1df17ba93ab;hb=76fdf5c910e8cd887f6f7b83559f4c81c88f507d;hp=ce71f0c741dfac61048fe5f71e840eaeb898c489;hpb=fa95911fdb2209907572381c62b1fa70088af634;p=friendica.git diff --git a/mod/profiles.php b/mod/profiles.php index ce71f0c741..8bb09aa6dd 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -14,6 +14,7 @@ use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBM; +use Friendica\Model\Contact; use Friendica\Model\GContact; use Friendica\Model\Item; use Friendica\Model\Profile; @@ -485,29 +486,15 @@ function profiles_post(App $a) { info(L10n::t('Profile updated.') . EOL); } - - if ($namechanged && $is_default) { - $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d", - dbesc($name), - dbesc(DateTimeFormat::utcNow()), - intval(local_user()) - ); - $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d", - dbesc($name), - intval(local_user()) - ); - } - if ($is_default) { - $location = Profile::formatLocation(["locality" => $locality, "region" => $region, "country-name" => $country_name]); - - q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d", - dbesc($about), - dbesc($location), - dbesc($pub_keywords), - dbesc($gender), - intval(local_user()) - ); + if ($namechanged) { + $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d", + dbesc($name), + intval(local_user()) + ); + } + + Contact::updateSelfFromUserID(local_user()); // Update global directory in background $url = $_SESSION['my_url'];