aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-10 16:48:08 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-10 16:48:08 -0700
commit50e32c3d8a9eb9d7b4c449224e0ad3da5d44f9e0 (patch)
tree0ca3070083c351a4b3bbd9e98ca5b00e9032b9a2 /include
parente6690c818df5f64f26a92bdbbeb867056bab6a1a (diff)
downloadvolse-hubzilla-50e32c3d8a9eb9d7b4c449224e0ad3da5d44f9e0.tar.gz
volse-hubzilla-50e32c3d8a9eb9d7b4c449224e0ad3da5d44f9e0.tar.bz2
volse-hubzilla-50e32c3d8a9eb9d7b4c449224e0ad3da5d44f9e0.zip
zot_refresh: always try the hubloc pointed to by xchan_addr first
Diffstat (limited to 'include')
-rw-r--r--include/zot.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php
index 0376dc7f5..a81c13707 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -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) {