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);
*/
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']]];
}
/**