1
0
Fork 0

Issue 12373: Fix communication to Diaspora

This commit is contained in:
Michael 2022-12-10 12:08:55 +00:00
commit 019bb56668
5 changed files with 31 additions and 5 deletions

View file

@ -134,6 +134,13 @@ class Probe
}
}
$newdata['networks'] = $data['networks'] ?? [];
foreach ([Protocol::DIASPORA, Protocol::OSTATUS] as $network) {
if (empty($newdata['networks'][$network])) {
unset($newdata['networks'][$network]);
}
}
// We don't use the "priority" field anymore and replace it with a dummy.
$newdata['priority'] = 0;
@ -345,7 +352,11 @@ class Probe
$data = [];
}
if (empty($data) || (!empty($ap_profile) && empty($network) && (($data['network'] ?? '') != Protocol::DFRN))) {
$networks = $data['networks'] ?? [];
unset($data['networks']);
$networks[$data['network']] = $data;
$data = $ap_profile;
$data['networks'] = $networks;
} elseif (!empty($ap_profile)) {
$ap_profile['batch'] = '';
$data = array_merge($ap_profile, $data);
@ -716,9 +727,13 @@ class Probe
}
if ((!$result && ($network == '')) || ($network == Protocol::DIASPORA)) {
$result = self::diaspora($webfinger);
} else {
$result['networks'][Protocol::DIASPORA] = self::diaspora($webfinger);
}
if ((!$result && ($network == '')) || ($network == Protocol::OSTATUS)) {
$result = self::ostatus($webfinger);
} else {
$result['networks'][Protocol::OSTATUS] = self::ostatus($webfinger);
}
if (in_array($network, ['', Protocol::ZOT])) {
$result = self::zot($webfinger, $result, $baseurl);