diff options
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php index b250557e6..91729f9de 100644 --- a/include/zot.php +++ b/include/zot.php @@ -604,11 +604,14 @@ function import_xchan($arr,$ud_flags = 1) { ); if($r) { logger('import_xchan: hub exists: ' . $location['url']); - // update connection timestamp - q("update hubloc set hubloc_connected = '%s' where hubloc_id = %d limit 1", - dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) - ); + // update connection timestamp if this is the site we're talking to + if($location['url'] == $arr['site']['url']) { + q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d limit 1", + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($r[0]['hubloc_id']) + ); + } if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) && (! $location['primary'])) || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY)) && ($location['primary']))) { $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", @@ -723,6 +726,14 @@ function import_xchan($arr,$ud_flags = 1) { update_modtime($xchan_hash,$guid,$arr['address'],$ud_flags); logger('import_xchan: changed: ' . $what,LOGGER_DEBUG); } + elseif(! $ud_flags) { + // nothing changed but we still need to update the updates record + q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d) ", + intval(UPDATE_FLAGS_UPDATED), + dbesc($arr['address']), + intval(UPDATE_FLAGS_UPDATED) + ); + } if(! x($ret,'message')) { $ret['success'] = true; @@ -1568,6 +1579,7 @@ function update_modtime($hash,$guid,$addr,$flags = 0) { else { q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d) ", intval(UPDATE_FLAGS_UPDATED), + dbesc($addr), intval(UPDATE_FLAGS_UPDATED) ); } |