Enable "magic" with Hubzilla

This commit is contained in:
Michael 2024-05-20 19:36:40 +00:00
parent 5751311e99
commit dca93a9606
8 changed files with 115 additions and 79 deletions

View file

@ -3580,15 +3580,19 @@ class Contact
return $destination;
}
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local') && ($url == '')) {
return 'contact/' . $contact['id'] . '/conversations';
}
if (Strings::compareLink($contact['url'], $url) || Strings::compareLink($contact['alias'], $url)) {
$url = '';
}
// Only redirections to the same host do make sense
if (($url != '') && (parse_url($url, PHP_URL_HOST) != parse_url($contact['url'], PHP_URL_HOST))) {
return $url;
}
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local') && ($url == '')) {
return 'contact/' . $contact['id'] . '/conversations';
}
if (!empty($contact['network']) && $contact['network'] != Protocol::DFRN) {
return $destination;
}
@ -3599,7 +3603,7 @@ class Contact
$redirect = 'contact/redir/' . $contact['id'];
if (($url != '') && !Strings::compareLink($contact['url'], $url)) {
if ($url != '') {
$redirect .= '?url=' . $url;
}