issues encountered with hubzilla DB changes, zot_refresh and item_drop and hub sync
This commit is contained in:
parent
2a59392ba8
commit
bf190be5b4
@ -4366,7 +4366,7 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("UPDATE item set item_deleted = 1, changed = '%s', edited = '%s' where if = %d",
|
$r = q("UPDATE item set item_deleted = 1, changed = '%s', edited = '%s' where id = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($item['id'])
|
intval($item['id'])
|
||||||
|
@ -294,12 +294,12 @@ function zot_refresh($them, $channel = null, $force = false) {
|
|||||||
if ($them['hubloc_url']) {
|
if ($them['hubloc_url']) {
|
||||||
$url = $them['hubloc_url'];
|
$url = $them['hubloc_url'];
|
||||||
} else {
|
} else {
|
||||||
$r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'",
|
$r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s'",
|
||||||
dbesc($them['xchan_hash'])
|
dbesc($them['xchan_hash'])
|
||||||
);
|
);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
if ($rr['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) {
|
if (intval($rr['hubloc_primary'])) {
|
||||||
$url = $rr['hubloc_url'];
|
$url = $rr['hubloc_url'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2207,7 +2207,7 @@ function sync_locations($sender, $arr, $absolute = false) {
|
|||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($r[0]['hubloc_id'])
|
intval($r[0]['hubloc_id'])
|
||||||
);
|
);
|
||||||
$r[0]['hubloc_flags'] = $r[0]['hubloc_flags'] ^ HUBLOC_FLAGS_PRIMARY;
|
$r[0]['hubloc_primary'] = intval($location['primary']);
|
||||||
hubloc_change_primary($r[0]);
|
hubloc_change_primary($r[0]);
|
||||||
$what .= 'primary_hub ';
|
$what .= 'primary_hub ';
|
||||||
$changed = true;
|
$changed = true;
|
||||||
|
Reference in New Issue
Block a user