diff options
author | Mario <mario@mariovavti.com> | 2020-09-23 11:44:10 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-09-23 11:44:10 +0000 |
commit | 6f508b81d62f9fec91840d4b7a35eaa5209bdeca (patch) | |
tree | d5d6b2ac9a3fa5772950ce974b0766ba696ae933 /Zotlabs/Lib/Libsync.php | |
parent | 81e2f73c9870b502ab0b56009459932282f87f02 (diff) | |
download | volse-hubzilla-6f508b81d62f9fec91840d4b7a35eaa5209bdeca.tar.gz volse-hubzilla-6f508b81d62f9fec91840d4b7a35eaa5209bdeca.tar.bz2 volse-hubzilla-6f508b81d62f9fec91840d4b7a35eaa5209bdeca.zip |
5.0RC testing: update hublocs by hubloc_id_url of we mark it deleted or change primary to catch both zot and zot6 hublocs. only set the zot6 hubloc as primary.
Diffstat (limited to 'Zotlabs/Lib/Libsync.php')
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index b7cda1770..b16080a51 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -819,9 +819,9 @@ class Libsync { } if(intval($r[0]['hubloc_primary']) && (! $location['primary'])) { - $m = q("update hubloc set hubloc_primary = 0, hubloc_updated = '%s' where hubloc_id = %d", + $m = q("update hubloc set hubloc_primary = 0, hubloc_updated = '%s' where hubloc_id_url = '%s'", dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) + intval($r[0]['hubloc_id_url']) ); $r[0]['hubloc_primary'] = intval($location['primary']); hubloc_change_primary($r[0]); @@ -848,18 +848,18 @@ class Libsync { } } if(intval($r[0]['hubloc_deleted']) && (! intval($location['deleted']))) { - $n = q("update hubloc set hubloc_deleted = 0, hubloc_updated = '%s' where hubloc_id = %d", + $n = q("update hubloc set hubloc_deleted = 0, hubloc_updated = '%s' where hubloc_id_url = '%s'", dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) + dbesc($r[0]['hubloc_id_url']) ); $what .= 'undelete_hub '; $changed = true; } elseif((! intval($r[0]['hubloc_deleted'])) && (intval($location['deleted']))) { logger('deleting hubloc: ' . $r[0]['hubloc_addr']); - $n = q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id = %d", + $n = q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id_url = '%s'", dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) + dbesc($r[0]['hubloc_id_url']) ); $what .= 'delete_hub '; $changed = true; @@ -918,9 +918,9 @@ class Libsync { foreach($xisting as $x) { if(! array_key_exists('updated',$x)) { logger('Deleting unreferenced hub location ' . $x['hubloc_addr']); - $r = q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id = %d", + $r = q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id_url = '%s'", dbesc(datetime_convert()), - intval($x['hubloc_id']) + dbesc($x['hubloc_id_url']) ); $what .= 'removed_hub '; $changed = true; |