From 0057612a9f9ecb49c2bd69e550827e2304c85204 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 13 Oct 2014 21:38:36 -0700 Subject: figuring out how to bootstrap the change_primary procedure when all you have is inconsistent data which you think you trust. --- include/zot.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 2400643a7..0338f0ea2 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1849,6 +1849,10 @@ function sync_locations($sender,$arr,$absolute = false) { $what .= 'primary_hub '; $changed = true; } + elseif($absolute) { + // Absolute sync - make sure the current primary is correctly reflected in the xchan + hubloc_change_primary($r[0]); + } if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) && (! $location['deleted'])) || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED)) && ($location['deleted']))) { $n = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", -- cgit v1.2.3