Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-11-03 17:17:51 +0300
committerAnna Larch <anna@nextcloud.com>2022-11-10 23:46:33 +0300
commit7738e90c2ea18dff0a57e1ea47b195c8b544bfdb (patch)
treeca2eb238cd31bf216c75e7d88b91c6c82ebb170a /lib/Events
parentcecf046ba532b6bfd452b57f2b126941448ab0fe (diff)
Local Draft Handling Backend
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Events')
-rw-r--r--lib/Events/DraftMessageCreatedEvent.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/Events/DraftMessageCreatedEvent.php b/lib/Events/DraftMessageCreatedEvent.php
new file mode 100644
index 000000000..efd92290b
--- /dev/null
+++ b/lib/Events/DraftMessageCreatedEvent.php
@@ -0,0 +1,56 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright 2022 Anna Larch <anna.larch@gmx.net>
+ *
+ * @author 2022 Anna Larch <anna.larch@gmx.net>
+ *
+ * @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\Events;
+
+use OCA\Mail\Account;
+use OCA\Mail\Db\Message;
+use OCP\EventDispatcher\Event;
+
+/**
+ * @psalm-immutable
+ */
+class DraftMessageCreatedEvent extends Event {
+ /** @var Account */
+ private $account;
+
+ /** @var Message */
+ private $draft;
+
+ public function __construct(Account $account,
+ Message $draft) {
+ parent::__construct();
+ $this->account = $account;
+ $this->draft = $draft;
+ }
+
+ public function getAccount(): Account {
+ return $this->account;
+ }
+
+ public function getDraft(): ?Message {
+ return $this->draft;
+ }
+}