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
path: root/lib/Model
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2021-06-15 13:37:10 +0300
committerAnna Larch <anna@nextcloud.com>2021-06-15 17:08:19 +0300
commit93519a7212296975ffc322138de682b56aeda37b (patch)
treeb534c1c4d81d88d3d9d88342841bdda0a3a59b19 /lib/Model
parent7504e511515cdb2b553b3d2656eae4acd8bb3e5a (diff)
Cast Evolution Labels to our implementation
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/IMAPMessage.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php
index 23f872738..9c919e3a1 100644
--- a/lib/Model/IMAPMessage.php
+++ b/lib/Model/IMAPMessage.php
@@ -727,7 +727,7 @@ class IMAPMessage implements IMessage, JsonSerializable {
);
$msg->setFlagNotjunk(in_array(Horde_Imap_Client::FLAG_NOTJUNK, $flags, true) || in_array('nonjunk', $flags, true));// While this is not a standard IMAP Flag, Thunderbird uses it to mark "not junk"
// @todo remove this as soon as possible @link https://github.com/nextcloud/mail/issues/25
- $msg->setFlagImportant(in_array('$important', $flags, true) || in_array(Tag::LABEL_IMPORTANT, $flags, true));
+ $msg->setFlagImportant(in_array('$important', $flags, true) || in_array('$labelimportant', $flags, true) || in_array(Tag::LABEL_IMPORTANT, $flags, true));
$msg->setFlagAttachments(false);
$msg->setFlagMdnsent(in_array(Horde_Imap_Client::FLAG_MDNSENT, $flags, true));
@@ -765,6 +765,7 @@ class IMAPMessage implements IMessage, JsonSerializable {
* display_name like 'xxx'
*
* @link https://github.com/nextcloud/mail/issues/25
+ * @link https://github.com/nextcloud/mail/issues/5150
*
* @param string[] $tags
* @return Tag[]
@@ -772,10 +773,21 @@ class IMAPMessage implements IMessage, JsonSerializable {
private function generateTagEntites(array $tags, string $userId): array {
$t = [];
foreach ($tags as $keyword) {
- // Map the old $important to $label1 until we have caught them all
- if ($keyword === '$important') {
+ if ($keyword === '$important' || $keyword === '$labelimportant') {
$keyword = Tag::LABEL_IMPORTANT;
}
+ if ($keyword === '$labelwork') {
+ $keyword = Tag::LABEL_WORK;
+ }
+ if ($keyword === '$labelpersonal') {
+ $keyword = Tag::LABEL_PERSONAL;
+ }
+ if ($keyword === '$labeltodo') {
+ $keyword = Tag::LABEL_TODO;
+ }
+ if ($keyword === '$labellater') {
+ $keyword = Tag::LABEL_LATER;
+ }
$displayName = str_replace('_', ' ', $keyword);
$displayName = strtoupper($displayName);