-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anna Larch <[email protected]>
- Loading branch information
1 parent
078390e
commit a281851
Showing
4 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ public function __construct(string $appName, | |
* @param int|null $smimeCertificateId | ||
* @param int|null $sendAt | ||
* @param int|null $draftId | ||
* @param bool $requestMdn | ||
* | ||
* @return JsonResponse | ||
* @throws DoesNotExistException | ||
|
@@ -99,6 +100,7 @@ public function create( | |
array $cc = [], | ||
array $bcc = [], | ||
array $attachments = [], | ||
bool $requestMdn, | ||
?int $aliasId = null, | ||
?string $inReplyToMessageId = null, | ||
?int $smimeCertificateId = null, | ||
|
@@ -121,6 +123,7 @@ public function create( | |
$message->setSendAt($sendAt); | ||
$message->setSmimeSign($smimeSign); | ||
$message->setSmimeEncrypt($smimeEncrypt); | ||
$message->setRequestMdn($requestMdn); | ||
|
||
if (!empty($smimeCertificateId)) { | ||
$smimeCertificate = $this->smimeService->findCertificate($smimeCertificateId, $this->userId); | ||
|
@@ -141,14 +144,14 @@ public function create( | |
* @param string $body | ||
* @param string $editorBody | ||
* @param bool $isHtml | ||
* @param bool $failed | ||
* @param array<int, string[]> $to i. e. [['label' => 'Linus', 'email' => '[email protected]'], ['label' => 'Pierre', 'email' => '[email protected]']] | ||
* @param array<int, string[]> $cc | ||
* @param array<int, string[]> $bcc | ||
* @param array $attachments | ||
* @param int|null $aliasId | ||
* @param string|null $inReplyToMessageId | ||
* @param int|null $sendAt | ||
* @param bool $requestMdn | ||
* @return JsonResponse | ||
*/ | ||
#[TrapError] | ||
|
@@ -160,11 +163,11 @@ public function update(int $id, | |
bool $isHtml, | ||
?bool $smimeSign, | ||
?bool $smimeEncrypt, | ||
bool $failed = false, | ||
array $to = [], | ||
array $cc = [], | ||
array $bcc = [], | ||
array $attachments = [], | ||
bool $requestMdn, | ||
?int $aliasId = null, | ||
?string $inReplyToMessageId = null, | ||
?int $smimeCertificateId = null, | ||
|
@@ -179,12 +182,12 @@ public function update(int $id, | |
$message->setBody($body); | ||
$message->setEditorBody($editorBody); | ||
$message->setHtml($isHtml); | ||
$message->setFailed($failed); | ||
$message->setInReplyToMessageId($inReplyToMessageId); | ||
$message->setSendAt($sendAt); | ||
$message->setUpdatedAt($this->timeFactory->getTime()); | ||
$message->setSmimeSign($smimeSign); | ||
$message->setSmimeEncrypt($smimeEncrypt); | ||
$message->setRequestMdn($requestMdn); | ||
|
||
if (!empty($smimeCertificateId)) { | ||
$smimeCertificate = $this->smimeService->findCertificate($smimeCertificateId, $this->userId); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ public function show(int $id): JsonResponse { | |
* @param int|null $aliasId | ||
* @param string|null $inReplyToMessageId | ||
* @param int|null $sendAt | ||
* @param bool $requestMdn | ||
* | ||
* @return JsonResponse | ||
* @throws DoesNotExistException | ||
|
@@ -115,6 +116,7 @@ public function create( | |
array $cc = [], | ||
array $bcc = [], | ||
array $attachments = [], | ||
bool $requestMdn, | ||
?int $draftId = null, | ||
?int $aliasId = null, | ||
?string $inReplyToMessageId = null, | ||
|
@@ -139,6 +141,7 @@ public function create( | |
$message->setSendAt($sendAt); | ||
$message->setSmimeSign($smimeSign); | ||
$message->setSmimeEncrypt($smimeEncrypt); | ||
$message->setRequestMdn($requestMdn); | ||
|
||
if (!empty($smimeCertificateId)) { | ||
$smimeCertificate = $this->smimeService->findCertificate($smimeCertificateId, $this->userId); | ||
|
@@ -178,14 +181,15 @@ public function createFromDraft(DraftsService $draftsService, int $id, ?int $sen | |
* @param string $body | ||
* @param string $editorBody | ||
* @param bool $isHtml | ||
* @param bool $failed | ||
* @param array $to i. e. [['label' => 'Linus', 'email' => '[email protected]'], ['label' => 'Pierre', 'email' => '[email protected]']] | ||
* @param array $cc | ||
* @param array $bcc | ||
* @param array $attachments | ||
* @param int|null $aliasId | ||
* @param string|null $inReplyToMessageId | ||
* @param int|null $sendAt | ||
* @param bool $requestMdn | ||
* | ||
* @return JsonResponse | ||
*/ | ||
#[TrapError] | ||
|
@@ -198,11 +202,11 @@ public function update( | |
bool $isHtml, | ||
bool $smimeSign, | ||
bool $smimeEncrypt, | ||
bool $failed = false, | ||
array $to = [], | ||
array $cc = [], | ||
array $bcc = [], | ||
array $attachments = [], | ||
bool $requestMdn, | ||
?int $aliasId = null, | ||
?string $inReplyToMessageId = null, | ||
?int $smimeCertificateId = null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* @copyright 2024 Anna Larch <[email protected]> | ||
* | ||
* @author Anna Larch <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace OCA\Mail\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\DB\Types; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version3600Date20240319172810 extends SimpleMigrationStep { | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure(): ISchemaWrapper $schemaClosure | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
|
||
$localMessagesTable = $schema->getTable('mail_local_messages'); | ||
if (!$localMessagesTable->hasColumn('request_mdn')) { | ||
$localMessagesTable->addColumn('request_mdn', Types::BOOLEAN, [ | ||
'notnull' => false, | ||
'default' => false, | ||
]); | ||
} | ||
|
||
return $schema; | ||
} | ||
} |