From 8a7b22141239969b3af39582019dfa455612bb41 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 12 Jan 2023 11:28:48 +0000 Subject: mark old hubloc entries from re-installed hubs deleted if we discover any --- Zotlabs/Lib/Libsync.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index f844c63b5..19361c4ae 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -862,7 +862,9 @@ class Libsync { ); } - // update connection timestamp if this is the site we're talking to + // Update connection timestamp if this is the site we're talking to. + // Also mark all entries from the current site with different sitekeys + // deleted (the site has been re-installed) // This only happens when called from import_xchan $current_site = false; @@ -876,6 +878,12 @@ class Libsync { intval($r[0]['hubloc_id']), dbesc($t) ); + + q("update hubloc set hubloc_error = 1, hubloc_deleted = 1 where hubloc_url = '%s' and hubloc_sitekey != '%s'", + dbesc($r[0]['hubloc_url']), + dbesc($r[0]['hubloc_sitekey']) + ); + $current_site = true; } -- cgit v1.2.3