aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-30 13:45:28 -0800
committerfriendica <info@friendica.com>2015-01-30 13:45:28 -0800
commitab0706521ecc8874f53275d470dfa57a5f457517 (patch)
tree86ed7131b5ca7f6402558fc2636061da3d9048f9 /include/zot.php
parentb381579959b3c241a19e6dd8fc4fb34914f39847 (diff)
downloadvolse-hubzilla-ab0706521ecc8874f53275d470dfa57a5f457517.tar.gz
volse-hubzilla-ab0706521ecc8874f53275d470dfa57a5f457517.tar.bz2
volse-hubzilla-ab0706521ecc8874f53275d470dfa57a5f457517.zip
let zot_refresh continue without a primary hub if one cannot be found. also weekly doc updates
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php
index f3933d030..6057bda52 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -298,15 +298,24 @@ function zot_refresh($them,$channel = null, $force = false) {
if($channel)
logger('zot_refresh: channel: ' . print_r($channel,true), LOGGER_DATA);
+ $url = null;
+
if($them['hubloc_url'])
$url = $them['hubloc_url'];
else {
- $r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and ( hubloc_flags & %d ) > 0 limit 1",
- dbesc($them['xchan_hash']),
- intval(HUBLOC_FLAGS_PRIMARY)
+ $r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'",
+ dbesc($them['xchan_hash'])
);
- if($r)
- $url = $r[0]['hubloc_url'];
+ if($r) {
+ foreach($r as $rr) {
+ if($rr['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) {
+ $url = $rr['hubloc_url'];
+ break;
+ }
+ }
+ if(! $url)
+ $url = $r[0]['hubloc_url'];
+ }
}
if(! $url) {
logger('zot_refresh: no url');