Merge pull request #7854 from annando/notice-ap-mail

Fix mail delivery via AP when the contact is hidden
This commit is contained in:
Hypolite Petovan 2019-11-22 11:49:40 -05:00 committed by GitHub
commit cde467eca1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 9 deletions

View file

@ -498,13 +498,7 @@ class Transmitter
} }
} }
$receivers = ['to' => array_values($data['to']), 'cc' => array_values($data['cc']), 'bcc' => array_values($data['bcc'])]; return ['to' => array_values($data['to']), 'cc' => array_values($data['cc']), 'bcc' => array_values($data['bcc'])];
if (!$blindcopy) {
unset($receivers['bcc']);
}
return $receivers;
} }
/** /**
@ -699,8 +693,15 @@ class Transmitter
$mail = self::ItemArrayFromMail($mail_id); $mail = self::ItemArrayFromMail($mail_id);
$object = self::createNote($mail); $object = self::createNote($mail);
$object['to'] = $object['cc']; if (!empty($object['cc'])) {
$object['to'] = array_merge($object['to'], $object['cc']);
unset($object['cc']); unset($object['cc']);
}
if (!empty($object['bcc'])) {
$object['to'] = array_merge($object['to'], $object['bcc']);
unset($object['bcc']);
}
$object['tag'] = [['type' => 'Mention', 'href' => $object['to'][0], 'name' => 'test']]; $object['tag'] = [['type' => 'Mention', 'href' => $object['to'][0], 'name' => 'test']];

View file

@ -51,6 +51,8 @@ class Notifier
$delivery_contacts_stmt = null; $delivery_contacts_stmt = null;
$target_item = []; $target_item = [];
$parent = [];
$thr_parent = [];
$items = []; $items = [];
$delivery_queue_count = 0; $delivery_queue_count = 0;
@ -594,6 +596,10 @@ class Notifier
*/ */
private static function skipDFRN($contact, $item, $parent, $thr_parent, $cmd) private static function skipDFRN($contact, $item, $parent, $thr_parent, $cmd)
{ {
if (empty($parent['network'])) {
return false;
}
// Don't skip when the starting post is delivered via Diaspora // Don't skip when the starting post is delivered via Diaspora
if ($parent['network'] == Protocol::DIASPORA) { if ($parent['network'] == Protocol::DIASPORA) {
return false; return false;