fix o use portable_ids in replyto

This commit is contained in:
Mike Macgirvin 2024-06-04 16:48:18 -07:00
parent f16b3433b6
commit 3b1d3d8959

View file

@ -561,7 +561,7 @@ class Notifier implements DaemonInterface
return;
}
// logger('recipients: ' . print_r(self::$recipients,true), LOGGER_NORMAL, LOG_DEBUG);
// logger('recipients: ' . print_r(self::$recipients,true), LOGGER_NORMAL, LOG_DEBUG);
if (! count(self::$env_recips)) {
self::$env_recips = ((self::$private) ? [] : null);
@ -880,8 +880,21 @@ class Notifier implements DaemonInterface
else {
$audience[] = $parentItem['owner_xchan'];
}
return $audience;
// convert to portable_id where needed
$xchans = [];
foreach ($audience as $recipient) {
$result = q("select * from hubloc where hubloc_id_url = '%s' or hubloc_hash = '%s'",
dbesc($recipient),
dbesc($recipient)
);
if ($result) {
$record = Libzot::zot_record_preferred($result);
$xchans[] = $record['hubloc_hash'];
}
}
return $xchans;
}
public static function getAudienceFromItem($item)
{
$audience = 0;