From 7122e1522ab9350755f0c34131f1be074b0ed79e Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 21 Sep 2021 07:33:02 +0000 Subject: perform profile sync after all the fields are updated otherwise we will sync outdated data --- Zotlabs/Module/Profiles.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 631a41ddc..73bae45e8 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -595,30 +595,31 @@ class Profiles extends \Zotlabs\Web\Controller { if($r) info( t('Profile updated.') . EOL); - $r = q("select * from profile where id = %d and uid = %d limit 1", - intval(argv(1)), - intval(local_channel()) - ); - if($r) { - Libsync::build_sync_packet(local_channel(),array('profile' => $r)); - } - $channel = \App::get_channel(); if($namechanged && $is_default) { - $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'", + q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'", dbesc($name), dbesc(datetime_convert()), dbesc($channel['xchan_hash']) ); - $r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'", + q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'", dbesc($name), dbesc($channel['xchan_hash']) ); } + $r = q("select * from profile where id = %d and uid = %d limit 1", + intval(argv(1)), + intval(local_channel()) + ); + + if($r) { + Libsync::build_sync_packet(local_channel(), ['profile' => $r]); + } + if($is_default) { - // reload the info for the sidebar widget - why does this not work? + // reload the info for the sidebar widget profile_load($channel['channel_address']); \Zotlabs\Daemon\Master::Summon(array('Directory',local_channel())); } -- cgit v1.2.3