store FEP-612d url as abook alias

This commit is contained in:
Mike Macgirvin 2024-07-08 06:09:32 +10:00
parent 55a26cd8c3
commit c3e191c36a

View file

@ -25,11 +25,13 @@ class Connect
{
$uid = $channel['channel_id'];
$alias = '';
if (!str_contains($url, '@') && !str_contains($url, '/')) {
if (str_contains($url,'.') && !str_contains(trim($url), ' ') && checkdnsrr('_apobjid.' . trim($url), 'TXT')) {
$dnsRecord = dns_get_record('_apobjid.' . trim($url), DNS_TXT);
if (isset($dnsRecord[0]['txt'])) {
$alias = $url;
$url = $dnsRecord[0]['txt'];
}
}
@ -259,6 +261,7 @@ class Connect
'abook_channel' => intval($uid),
'abook_closeness' => intval($closeness),
'abook_xchan' => $xchan_hash,
'abook_alias' => $alias,
'abook_profile' => $profile_assign,
'abook_feed' => intval(($xchan['xchan_network'] === 'rss') ? 1 : 0),
'abook_created' => Time::convert(),