diff options
author | marijus <mario@localhost.localdomain> | 2013-12-03 14:00:46 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2013-12-03 14:00:46 +0100 |
commit | f49837d7ee16a7379eed40358ee099f137ce81ac (patch) | |
tree | 5d00640dd86d86db8ec1d384de5b6473a83a2846 /include/zot.php | |
parent | d525d1c26f2b67579ff5911dc81958c4fa1e9c6f (diff) | |
parent | d96f5e2c081b582a77097b06706416d5ff371211 (diff) | |
download | volse-hubzilla-f49837d7ee16a7379eed40358ee099f137ce81ac.tar.gz volse-hubzilla-f49837d7ee16a7379eed40358ee099f137ce81ac.tar.bz2 volse-hubzilla-f49837d7ee16a7379eed40358ee099f137ce81ac.zip |
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php index 9777f7ae4..124fe7fd6 100644 --- a/include/zot.php +++ b/include/zot.php @@ -691,6 +691,16 @@ function import_xchan($arr,$ud_flags = 1) { dbesc($xchan_hash) ); + // See if a primary is specified + + $has_primary = false; + foreach($arr['locations'] as $location) { + if($location['primary']) { + $has_primary = true; + break; + } + } + foreach($arr['locations'] as $location) { if(! rsa_verify($location['url'],base64url_decode($location['url_sig']),$arr['key'])) { logger('import_xchan: Unable to verify site signature for ' . $location['url']); @@ -698,6 +708,12 @@ function import_xchan($arr,$ud_flags = 1) { continue; } + // Ensure that they have one primary hub + + if(! $has_primary) + $location['primary'] = true; + + for($x = 0; $x < count($xisting); $x ++) { if(($xisting[$x]['hubloc_url'] === $location['url']) && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) { $xisting[$x]['updated'] = true; |