Issue 13627: DMs now work bidirectional again

This commit is contained in:
Michael 2023-11-22 11:07:18 +00:00
parent 2b8a71231e
commit 08d06064ce
2 changed files with 6 additions and 8 deletions

View file

@ -682,7 +682,7 @@ class Receiver
self::addArrivedId($object_data['object_id']);
}
$decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE]);
$decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE]) && empty($object_data['directmessage']);
if ($decouple && ($trust_source || DI::config()->get('debug', 'ap_inbox_store_untrusted'))) {
$object_data = Queue::add($object_data, $type, $uid, $http_signer, $push, $trust_source);

View file

@ -1121,19 +1121,17 @@ class Transmitter
*/
public static function fetchTargetInboxesFromMail(int $mail_id): array
{
$mail = DBA::selectFirst('mail', ['uid', 'parent-uri', 'from-url'], ['id' => $mail_id]);
$mail = DBA::selectFirst('mail', ['contact-id'], ['id' => $mail_id]);
if (!DBA::isResult($mail)) {
return [];
}
$reply = DBA::selectFirst('mail', ['from-url'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
if (!DBA::isResult($reply)) {
$reply = $mail;
$account = DBA::selectFirst('account-user-view', ['ap-inbox'], ['id' => $mail['contact-id']]);
if (empty($account['ap-inbox'])) {
return [];
}
$apcontact = APContact::getByURL($reply['from-url'], false);
return [$apcontact['inbox'] => [Contact::getIdForURL($reply['from-url'])]];
return [$account['ap-inbox'] => [$mail['contact-id']]];
}
/**