-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(outbox): add status for messages
and try resending failed messages at POF Signed-off-by: Anna Larch <[email protected]>
- Loading branch information
1 parent
a865c99
commit c35fe55
Showing
16 changed files
with
620 additions
and
345 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
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,42 @@ | ||
<?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\Events; | ||
|
||
use OCA\Mail\Db\LocalMessage; | ||
use OCP\EventDispatcher\Event; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
class OutboxMessageStatusChangeEvent extends Event { | ||
|
||
public function __construct(private LocalMessage $message) { | ||
} | ||
|
||
public function getMessage(): LocalMessage { | ||
return $this->message; | ||
} | ||
|
||
public function setMessage(LocalMessage $message): void { | ||
$this->message = $message; | ||
Check failure on line 40 in lib/Events/OutboxMessageStatusChangeEvent.php GitHub Actions / static-psalm-analysis dev-masterInaccessibleProperty
Check failure on line 40 in lib/Events/OutboxMessageStatusChangeEvent.php GitHub Actions / static-psalm-analysis dev-stable27InaccessibleProperty
Check failure on line 40 in lib/Events/OutboxMessageStatusChangeEvent.php GitHub Actions / static-psalm-analysis dev-stable26InaccessibleProperty
Check failure on line 40 in lib/Events/OutboxMessageStatusChangeEvent.php GitHub Actions / static-psalm-analysis dev-stable28InaccessibleProperty
|
||
} | ||
} |
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,47 @@ | ||
<?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\Listener; | ||
|
||
use OCA\Mail\Db\LocalMessage; | ||
use OCA\Mail\Db\LocalMessageMapper; | ||
use OCA\Mail\Events\OutboxMessageStatusChangeEvent; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
|
||
/** | ||
* @template-implements IEventListener<Event|OutboxMessageStatusChangeEvent> | ||
*/ | ||
class OutboxStatusChangeListener implements IEventListener { | ||
|
||
public function __construct(private LocalMessageMapper $messageMapper) { | ||
} | ||
|
||
public function handle(Event $event): void { | ||
if (!($event instanceof OutboxMessageStatusChangeEvent)) { | ||
return; | ||
} | ||
|
||
$message = $event->getMessage(); | ||
$this->messageMapper->update($message); | ||
|
||
} | ||
} |
Oops, something went wrong.