Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public function mdn(int $id): JSONResponse {

try {
$this->mailTransmission->sendMdn($account, $mailbox, $message);
$this->mailManager->flagMessage($account, $mailbox->getName(), $message->getUid(), 'mdnsent', true);
$this->mailManager->flagMessage($account, $mailbox->getName(), $message->getUid(), '$mdnsent', true);
} catch (ServiceException $ex) {
$this->logger->error('Sending mdn failed: ' . $ex->getMessage());
throw $ex;
Expand Down
6 changes: 4 additions & 2 deletions lib/Db/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Message extends Entity implements JsonSerializable {
'$junk',
'$notjunk',
'$phishing',
'mdnsent',
'$mdnsent',
Tag::LABEL_IMPORTANT,
'$important' // @todo remove this when we have removed all references on IMAP to $important @link https://github.com/nextcloud/mail/issues/25
];
Expand Down Expand Up @@ -287,6 +287,8 @@ public function setFlag(string $flag, bool $value = true) {
$this->setFlagJunk($value);
} elseif ($flag === '$notjunk') {
$this->setFlagNotjunk($value);
} elseif ($flag === '$mdnsent') {
$this->setFlagMdnsent($value);
} else {
$this->setter(
$this->columnToProperty("flag_$flag"),
Expand Down Expand Up @@ -339,7 +341,7 @@ public function jsonSerialize() {
'important' => ($this->getFlagImportant() === true),
'$junk' => ($this->getFlagJunk() === true),
'$notjunk' => ($this->getFlagNotjunk() === true),
'mdnsent' => ($this->getFlagMdnsent() === true),
'$mdnsent' => ($this->getFlagMdnsent() === true),
],
'tags' => $indexed,
'from' => $this->getFrom()->jsonSerialize(),
Expand Down
10 changes: 7 additions & 3 deletions lib/Model/IMAPMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function getFlags(): array {
'draft' => in_array(Horde_Imap_Client::FLAG_DRAFT, $this->flags),
'forwarded' => in_array(Horde_Imap_Client::FLAG_FORWARDED, $this->flags),
'hasAttachments' => $this->hasAttachments,
'mdnsent' => in_array(Horde_Imap_Client::FLAG_MDNSENT, $this->flags, true),
'$mdnsent' => in_array(Horde_Imap_Client::FLAG_MDNSENT, $this->flags, true),
'important' => in_array(Tag::LABEL_IMPORTANT, $this->flags, true)
];
}
Expand Down Expand Up @@ -535,8 +535,11 @@ public function toDbMessage(int $mailboxId, MailAccount $account): Message {
$msg->setFlagJunk(
in_array(Horde_Imap_Client::FLAG_JUNK, $flags, true)
|| in_array('junk', $flags, true)
);
$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"
); // While this is not a standard IMAP Flag, Thunderbird uses it to mark "junk"
$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"
$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));
Expand All @@ -551,6 +554,7 @@ public function toDbMessage(int $mailboxId, MailAccount $account): Message {
Horde_Imap_Client::FLAG_DELETED,
Horde_Imap_Client::FLAG_DRAFT,
Horde_Imap_Client::FLAG_JUNK,
'junk', // While this is not a standard IMAP Flag, Thunderbird uses it to mark "junk"
Horde_Imap_Client::FLAG_NOTJUNK,
'nonjunk', // While this is not a standard IMAP Flag, Thunderbird uses it to mark "not junk"
'$phishing', // Horde has no const for this flag yet
Expand Down
4 changes: 2 additions & 2 deletions src/components/MdnRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
computed: {
...mapStores(useMainStore),
mdnSent() {
return this.message.flags.mdnsent
return this.message.flags.$mdnsent
},
},

Expand All @@ -62,7 +62,7 @@ export default {

try {
await sendMdn(this.message.databaseId)
this.mainStore.flagEnvelopeMutation({ envelope: this.message, flag: 'mdnsent', value: true })
this.mainStore.flagEnvelopeMutation({ envelope: this.message, flag: '$mdnsent', value: true })
} catch (error) {
logger.error('could not send mdn', error)
showError(t('mail', 'Could not send mdn'))
Expand Down
Loading