diff options
author | Mario <mario@mariovavti.com> | 2021-09-21 07:33:02 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-09-21 07:33:02 +0000 |
commit | 7122e1522ab9350755f0c34131f1be074b0ed79e (patch) | |
tree | 6918ff9ae2eeea1eea6fab5c9bf3582be6f17cea | |
parent | 5497adfde6e1df941d42bb8fb6e18b261402716e (diff) | |
download | volse-hubzilla-7122e1522ab9350755f0c34131f1be074b0ed79e.tar.gz volse-hubzilla-7122e1522ab9350755f0c34131f1be074b0ed79e.tar.bz2 volse-hubzilla-7122e1522ab9350755f0c34131f1be074b0ed79e.zip |
perform profile sync after all the fields are updated otherwise we will sync outdated data
-rw-r--r-- | Zotlabs/Module/Profiles.php | 23 |
1 files changed, 12 insertions, 11 deletions
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())); } |