aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-10 16:51:22 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-10 16:51:22 -0700
commit922d2165b3a74d1954f2bc424eb314a5d5c99fa8 (patch)
tree30ac6ab86edcd9a317700bb0ec9491a15b6232ad /include/zot.php
parent2d94a038a5055e7df76799f8fe110991cedbee88 (diff)
parent9cee52c66882973cc3f906dbe6a0f8280b5929e8 (diff)
downloadvolse-hubzilla-922d2165b3a74d1954f2bc424eb314a5d5c99fa8.tar.gz
volse-hubzilla-922d2165b3a74d1954f2bc424eb314a5d5c99fa8.tar.bz2
volse-hubzilla-922d2165b3a74d1954f2bc424eb314a5d5c99fa8.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts: include/zot.php
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php
index 9fac4d40e..a5ddd661c 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -294,9 +294,19 @@ function zot_refresh($them, $channel = null, $force = false) {
if ($them['hubloc_url']) {
$url = $them['hubloc_url'];
} else {
- $r = q("select hubloc_url, hubloc_primary 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_primary from hubloc where hubloc_addr = '%s'",
+ dbesc($them['xchan_addr'])
+ );
+ }
+ if(! $r) {
+ $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s'",
+ dbesc($them['xchan_hash'])
+ );
+ }
+
if ($r) {
foreach ($r as $rr) {
if (intval($rr['hubloc_primary'])) {