zot_refresh: always try the hubloc pointed to by xchan_addr first

This commit is contained in:
redmatrix 2015-09-10 16:48:08 -07:00
parent e6690c818d
commit 50e32c3d8a
2 changed files with 13 additions and 4 deletions

View File

@ -296,9 +296,18 @@ function zot_refresh($them, $channel = null, $force = false) {
if ($them['hubloc_url']) {
$url = $them['hubloc_url'];
} else {
$r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'",
dbesc($them['xchan_hash'])
);
$r = null;
if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) {
$r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_addr = '%s'",
dbesc($them['xchan_addr'])
);
}
if(! $r) {
$r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'",
dbesc($them['xchan_hash'])
);
}
if ($r) {
foreach ($r as $rr) {
if ($rr['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) {

View File

@ -1 +1 @@
2015-09-08.1149
2015-09-10.1151