diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-25 00:09:42 -0700 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-25 00:09:42 -0700 |
commit | b23f3fc03b6bc751aab67fe2258a21f7c65bab8e (patch) | |
tree | 84c997aa781afa566536ca5f66eb8f90ef468476 /include/zot.php | |
parent | d30f718e0836a031e43d5403480aa049561e736e (diff) | |
parent | 0b0bd3c20765d267ec6d7cc261c7713917a22582 (diff) | |
download | volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.gz volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.bz2 volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.zip |
Merge pull request #3 from friendica/master
Align to main project HEAD
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) ); } |