-
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
9d258fc
commit 752b012
Showing
8 changed files
with
87 additions
and
7 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
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
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,55 @@ | ||
<?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 Version3700Date20240506161400 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; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -217,6 +217,7 @@ public function testCreate(): void { | |
$message->setType(LocalMessage::TYPE_DRAFT); | ||
$message->setSendAt(null); | ||
$message->setUpdatedAt(123456); | ||
$message->setRequestMdn(false); | ||
$to = [['label' => 'Lewis', 'email' => '[email protected]']]; | ||
$cc = [['label' => 'Pierre', 'email' => '[email protected]']]; | ||
|
||
|
@@ -264,6 +265,7 @@ public function testCreateFromDraft(): void { | |
$message->setType(LocalMessage::TYPE_DRAFT); | ||
$message->setSendAt(null); | ||
$message->setUpdatedAt(123456); | ||
$message->setRequestMdn(false); | ||
$to = [['label' => 'Lewis', 'email' => '[email protected]']]; | ||
$cc = [['label' => 'Pierre', 'email' => '[email protected]']]; | ||
|
||
|
@@ -298,7 +300,8 @@ public function testCreateFromDraft(): void { | |
$message->getInReplyToMessageId(), | ||
null, | ||
null, | ||
1 | ||
1, | ||
false | ||
); | ||
|
||
$this->assertEquals($expected, $actual); | ||
|
@@ -316,6 +319,7 @@ public function testCreateWithEmptyRecipients(): void { | |
$message->setType(LocalMessage::TYPE_DRAFT); | ||
$message->setSendAt(null); | ||
$message->setUpdatedAt(123456); | ||
$message->setRequestMdn(false); | ||
|
||
$account = new Account(new MailAccount()); | ||
$this->accountService->expects(self::once()) | ||
|
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 |
---|---|---|
|
@@ -283,6 +283,7 @@ public function testCreate(): void { | |
$message->setSmimeEncrypt(false); | ||
$message->setInReplyToMessageId('abc'); | ||
$message->setType(LocalMessage::TYPE_OUTGOING); | ||
$message->setRequestMdn(false); | ||
$to = [['label' => 'Lewis', 'email' => '[email protected]']]; | ||
$cc = [['label' => 'Pierre', 'email' => '[email protected]']]; | ||
|
||
|