diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-12-03 13:46:41 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-12-03 13:46:41 +0100 |
commit | 1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c (patch) | |
tree | 75fd03333e51465fa8512b17200eb604db25b166 /Zotlabs/Lib/Libsync.php | |
parent | fe7ecede700fe04631d23f36473e697ce2b364dc (diff) | |
parent | 60b145833c5c07898363d51838a942b876f60c3c (diff) | |
download | volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.tar.gz volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.tar.bz2 volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.zip |
Merge branch 'dev'
Diffstat (limited to 'Zotlabs/Lib/Libsync.php')
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index c4f1b20ea..23573e837 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -768,14 +768,13 @@ class Libsync { // match as many fields as possible in case anything at all changed. - $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_id_url = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_site_id = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", + $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_id_url = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", dbesc($sender['hash']), dbesc($sender['id']), dbesc($sender['id_sig']), dbesc($location['id_url']), dbesc($location['url']), dbesc($location['url_sig']), - dbesc($location['site_id']), dbesc($location['host']), dbesc($location['address']), dbesc($location['callback']), @@ -784,6 +783,15 @@ class Libsync { if ($r) { logger('Hub exists: ' . $location['url'], LOGGER_DEBUG); + // generate a new hubloc_site_id if it's wrong due to historical bugs 2021-11-30 + + if ($r[0]['hubloc_site_id'] !== $location['site_id']) { + q("update hubloc set hubloc_site_id = '%s' where hubloc_id = %d", + dbesc(Libzot::make_xchan_hash($location['url'], $location['sitekey'])), + intval($r[0]['hubloc_id']) + ); + } + // update connection timestamp if this is the site we're talking to // This only happens when called from import_xchan |