]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Transmitter.php
Fix mail delivery via AP when the contact is hidden
[friendica.git] / src / Protocol / ActivityPub / Transmitter.php
index 5d3094339cbf99f7afb863773de944ef9703d187..7fc0f5d990957df5181ac929d606e45145b8c0cd 100644 (file)
@@ -498,13 +498,7 @@ class Transmitter
                        }
                }
 
-               $receivers = ['to' => array_values($data['to']), 'cc' => array_values($data['cc']), 'bcc' => array_values($data['bcc'])];
-
-               if (!$blindcopy) {
-                       unset($receivers['bcc']);
-               }
-
-               return $receivers;
+               return ['to' => array_values($data['to']), 'cc' => array_values($data['cc']), 'bcc' => array_values($data['bcc'])];
        }
 
        /**
@@ -699,8 +693,15 @@ class Transmitter
                $mail = self::ItemArrayFromMail($mail_id);
                $object = self::createNote($mail);
 
-               $object['to'] = $object['cc'];
-               unset($object['cc']);
+               if (!empty($object['cc'])) {
+                       $object['to'] = array_merge($object['to'], $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']];