diff options
author | friendica <info@friendica.com> | 2014-10-13 21:38:36 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-10-13 21:38:36 -0700 |
commit | 0057612a9f9ecb49c2bd69e550827e2304c85204 (patch) | |
tree | 359511238d71c92c9c9813be3d60bb379eda1537 | |
parent | 79684e05cc884e311e99a8d5c48574e60a1d502b (diff) | |
download | volse-hubzilla-0057612a9f9ecb49c2bd69e550827e2304c85204.tar.gz volse-hubzilla-0057612a9f9ecb49c2bd69e550827e2304c85204.tar.bz2 volse-hubzilla-0057612a9f9ecb49c2bd69e550827e2304c85204.zip |
figuring out how to bootstrap the change_primary procedure when all you have is inconsistent data which you think you trust.
-rw-r--r-- | include/hubloc.php | 2 | ||||
-rw-r--r-- | include/zot.php | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/hubloc.php b/include/hubloc.php index 735aad432..04c29315a 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -113,6 +113,8 @@ function remove_obsolete_hublocs() { } +// This actually changes other structures to match the given (presumably current) hubloc primary selection + function hubloc_change_primary($hubloc) { if(! is_array($hubloc)) { 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", |