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:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-10-15 12:24:38 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-10-30 19:16:24 +0300
commit15867528b25cad3e1262014d0fa4f967a73d64be (patch)
tree6dd7c46876325acf8aad147b9ef791a73376c102 /lib/Events
parentfe074001833362fa1eb4d18576131b0678907fb5 (diff)
Store special mailboxes as preference of the account
… instead of using a fragile autodetection every time we need one of those. We will still try to auto-detect the mailboxes but the users will have to option to change the destinations. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Events')
-rw-r--r--lib/Events/MailboxesSynchronizedEvent.php47
-rw-r--r--lib/Events/MessageSentEvent.php3
2 files changed, 50 insertions, 0 deletions
diff --git a/lib/Events/MailboxesSynchronizedEvent.php b/lib/Events/MailboxesSynchronizedEvent.php
new file mode 100644
index 000000000..d6e971ad1
--- /dev/null
+++ b/lib/Events/MailboxesSynchronizedEvent.php
@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @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 OCP\EventDispatcher\Event;
+
+/**
+ * @psalm-immutable
+ */
+class MailboxesSynchronizedEvent extends Event {
+
+ /** @var Account */
+ private $account;
+
+ public function __construct(Account $account) {
+ parent::__construct();
+ $this->account = $account;
+ }
+
+ public function getAccount(): Account {
+ return $this->account;
+ }
+}
diff --git a/lib/Events/MessageSentEvent.php b/lib/Events/MessageSentEvent.php
index a2973cb8c..07bb965ff 100644
--- a/lib/Events/MessageSentEvent.php
+++ b/lib/Events/MessageSentEvent.php
@@ -33,6 +33,9 @@ use OCA\Mail\Model\NewMessageData;
use OCA\Mail\Model\RepliedMessageData;
use OCP\EventDispatcher\Event;
+/**
+ * @psalm-immutable
+ */
class MessageSentEvent extends Event {
/** @var Account */