Skip to content

Commit

Permalink
fixup! fix: honour MDN requests
Browse files Browse the repository at this point in the history
  • Loading branch information
miaulalala committed May 6, 2024
1 parent a281851 commit 9ebdc77
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
57 changes: 57 additions & 0 deletions lib/Migration/Version3700Date20240506161400.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2024 FIXME Your name <[email protected]>
*
* FIXME @author Your name <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 program. 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;
}
}
2 changes: 1 addition & 1 deletion lib/Service/MailTransmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function sendMessage(Account $account, LocalMessage $localMessage): void
$headers['In-Reply-To'] = $inReplyTo;
}

if ($localMessage->getMdnRequested()) {
if ($localMessage->getRequestMdn()) {
$headers[Horde_Mime_Mdn::MDN_HEADER] = $from->first()->toHorde();
}

Expand Down

0 comments on commit 9ebdc77

Please sign in to comment.