From 8acd8912ebfcc0b64a161af3a4ba2d50f086a4d6 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 24 Dec 2019 10:19:14 +0000 Subject: [PATCH] Zot: Retrieve alias addresses as well --- src/Network/Probe.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 042e761e92..02a755eec6 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -724,8 +724,18 @@ class Probe $zot_url = self::$baseurl . '/.well-known/zot-info?address=' . $data['addr']; } - if (!empty($zot_url)) { - $data = self::pollZot($zot_url, $data); + if (empty($zot_url)) { + return $data; + } + + $data = self::pollZot($zot_url, $data); + + if (!empty($data['url']) && !empty($webfinger['aliases']) && is_array($webfinger['aliases'])) { + foreach ($webfinger['aliases'] as $alias) { + if (!strstr($alias, '@') && Strings::normaliseLink($alias) != Strings::normaliseLink($data['url'])) { + $data['alias'] = $alias; + } + } } return $data;