hubloc confusion during magic auth where hublocs with more than one network may exist

This commit is contained in:
zotlabs
2019-04-24 16:21:59 -07:00
parent 831b9d4433
commit c88286556a
6 changed files with 90 additions and 28 deletions

View File

@@ -5286,3 +5286,25 @@ function zot_reply_notify($data) {
$ret['success'] = true;
json_return_and_die($ret);
}
function zot_record_preferred($arr, $check = 'hubloc_network') {
if(! $arr) {
return $arr;
}
foreach($arr as $v) {
if($v[$check] === 'zot') {
return $v;
}
}
foreach($arr as $v) {
if($v[$check] === 'zot6') {
return $v;
}
}
return $arr[0];
}