From d423edb7e0968434d23d56fc7d9277d20a300767 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Thu, 5 Sep 2024 16:37:20 -0400 Subject: [PATCH] feat: mail provider backend Signed-off-by: SebastianKrupinski --- lib/Provider/Command/MessageSend.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Provider/Command/MessageSend.php b/lib/Provider/Command/MessageSend.php index e047f0810f..2efd6687d2 100644 --- a/lib/Provider/Command/MessageSend.php +++ b/lib/Provider/Command/MessageSend.php @@ -86,15 +86,11 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar foreach ($message->getAttachments() as $entry) { // convert mail provider attachment to mail app attachment try { - $name = $entry->getName(); - $type = $entry->getType(); - $contents = $entry->getContents(); - $attachments[] = $this->attachmentService->addFileFromString( $userId, - $name, - $type, - $contents + (string)$entry->getName(), + (string)$entry->getType(), + (string)$entry->getContents() )->jsonSerialize(); } catch (\Throwable $e) { throw new SendException('Error: occurred while saving mail message attachment', 0, $e); @@ -135,7 +131,7 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar * * @param array $addresses collection of IAddress objects * - * @return array + * @return array */ protected function convertAddressArray(array $addresses): array { return array_map(static function (IAddress $address) {