don't let a zot-finger bring a dead hub back to life unless it's the site we're currently talking to.
This commit is contained in:
parent
52f42e7d81
commit
85f79990af
@ -2100,19 +2100,21 @@ function sync_locations($sender,$arr,$absolute = false) {
|
|||||||
// update connection timestamp if this is the site we're talking to
|
// update connection timestamp if this is the site we're talking to
|
||||||
// This only happens when called from import_xchan
|
// This only happens when called from import_xchan
|
||||||
|
|
||||||
|
$current_site = false;
|
||||||
|
|
||||||
if(array_key_exists('site',$arr) && $location['url'] == $arr['site']['url']) {
|
if(array_key_exists('site',$arr) && $location['url'] == $arr['site']['url']) {
|
||||||
q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d",
|
q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($r[0]['hubloc_id'])
|
intval($r[0]['hubloc_id'])
|
||||||
);
|
);
|
||||||
|
$current_site = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's marked offline/dead, bring it back
|
// If it is the site we're currently talking to, and it's marked offline,
|
||||||
// Should we do this? It's basically saying that the channel knows better than
|
// either we have some bad information - or the thing came back to life.
|
||||||
// the directory server if the site is alive.
|
|
||||||
|
|
||||||
if($r[0]['hubloc_status'] & HUBLOC_OFFLINE) {
|
if(($current_site) && ($r[0]['hubloc_status'] & HUBLOC_OFFLINE)) {
|
||||||
q("update hubloc set hubloc_status = (hubloc_status & ~%d) where hubloc_id = %d",
|
q("update hubloc set hubloc_status = (hubloc_status & ~%d) where hubloc_id = %d",
|
||||||
intval(HUBLOC_OFFLINE),
|
intval(HUBLOC_OFFLINE),
|
||||||
intval($r[0]['hubloc_id'])
|
intval($r[0]['hubloc_id'])
|
||||||
|
Reference in New Issue
Block a user