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:
authorDaniel Kesselberg <mail@danielkesselberg.de>2021-06-01 17:45:23 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2021-06-01 21:09:16 +0300
commit13b816ac66f5932a80607bff57d75e67e75dadb9 (patch)
tree3659e8cb28bc5ac8fde09ad1de3aedf22d1837f6 /lib/Contracts
parentb53e6e707dff206db8bad30910b696e680ee05bf (diff)
Move create and update tag to mail manager
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/Contracts')
-rw-r--r--lib/Contracts/IMailManager.php31
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/Contracts/IMailManager.php b/lib/Contracts/IMailManager.php
index 34458c862..76eb2f1d5 100644
--- a/lib/Contracts/IMailManager.php
+++ b/lib/Contracts/IMailManager.php
@@ -23,14 +23,14 @@ declare(strict_types=1);
namespace OCA\Mail\Contracts;
-use OCA\Mail\Db\Tag;
use OCA\Mail\Account;
use OCA\Mail\Db\Mailbox;
use OCA\Mail\Db\Message;
-use OCA\Mail\Service\Quota;
-use OCA\Mail\Model\IMAPMessage;
+use OCA\Mail\Db\Tag;
use OCA\Mail\Exception\ClientException;
use OCA\Mail\Exception\ServiceException;
+use OCA\Mail\Model\IMAPMessage;
+use OCA\Mail\Service\Quota;
use OCP\AppFramework\Db\DoesNotExistException;
interface IMailManager {
@@ -237,7 +237,30 @@ interface IMailManager {
* @param string $imapLabel
* @param string $userId
* @return Tag
- * @throws DoesNotExistException
+ * @throws ClientException
*/
public function getTagByImapLabel(string $imapLabel, string $userId): Tag;
+
+ /**
+ * Create a mail tag
+ *
+ * @param string $userId
+ * @param string $displayName
+ * @param string $color
+ * @return Tag
+ * @throws ClientException if display name does not work as imap label
+ */
+ public function createTag(string $displayName, string $color, string $userId): Tag;
+
+ /**
+ * Update a mail tag
+ *
+ * @param string $userId
+ * @param int $id
+ * @param string $displayName
+ * @param string $color
+ * @return Tag
+ * @throws ClientException if the given tag does not exist
+ */
+ public function updateTag(int $id, string $displayName, string $color, string $userId): Tag;
}