webmail: when marking message as unread, also clear its (non)junk flags

This commit is contained in:
Mechiel Lukkien 2024-11-28 18:24:03 +01:00
parent ee48cf0dfd
commit 1f604c6a3d
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -2435,7 +2435,7 @@ const cmdHelp = async () => {
['q', 'move to junk folder'],
['Q', 'mark not junk'],
['a', 'move to archive folder'],
['M', 'mark unread'],
['M', 'mark unread and clear (non)junk flags'],
['m', 'mark read'],
['u', 'to next unread message'],
['p', 'to root of thread or previous thread'],
@ -4110,7 +4110,7 @@ const newMsgView = (miv, msglistView, listMailboxes, possibleLabels, messageLoad
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk) {
window.setTimeout(async () => {
const mailboxIsReject = () => !!listMailboxes().find(mb => mb.ID === miv.messageitem.Message.MailboxID && mb.Name === rejectsMailbox);
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk && miv.messageitem.Message.ID === msglistView.activeMessageID() && !mailboxIsReject()) {
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk && miv.messageitem.Message.Seen && miv.messageitem.Message.ID === msglistView.activeMessageID() && !mailboxIsReject()) {
await withStatus('Marking current message as not junk', client.FlagsAdd([miv.messageitem.Message.ID], ['$notjunk']));
}
}, 5 * 1000);
@ -4191,7 +4191,7 @@ const newMsglistView = (msgElem, activeMailbox, listMailboxes, setLocationHash,
};
const cmdMarkNotJunk = async () => { await withStatus('Marking as not junk', client.FlagsAdd(mlv.selected().map(miv => miv.messageitem.Message.ID), ['$notjunk'])); };
const cmdMarkRead = async () => { await withStatus('Marking as read', client.FlagsAdd(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen'])); };
const cmdMarkUnread = async () => { await withStatus('Marking as not read', client.FlagsClear(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen'])); };
const cmdMarkUnread = async () => { await withStatus('Marking as not read', client.FlagsClear(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen', '$junk', '$notjunk'])); };
const cmdMute = async () => {
const l = mlv.selected();
await withStatus('Muting thread', client.ThreadMute(l.map(miv => miv.messageitem.Message.ID), true));

View file

@ -1225,7 +1225,7 @@ const cmdHelp = async () => {
['q', 'move to junk folder'],
['Q', 'mark not junk'],
['a', 'move to archive folder'],
['M', 'mark unread'],
['M', 'mark unread and clear (non)junk flags'],
['m', 'mark read'],
['u', 'to next unread message'],
['p', 'to root of thread or previous thread'],
@ -3612,7 +3612,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk) {
window.setTimeout(async () => {
const mailboxIsReject = () => !!listMailboxes().find(mb => mb.ID === miv.messageitem.Message.MailboxID && mb.Name === rejectsMailbox)
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk && miv.messageitem.Message.ID === msglistView.activeMessageID() && !mailboxIsReject()) {
if (!miv.messageitem.Message.Junk && !miv.messageitem.Message.Notjunk && miv.messageitem.Message.Seen && miv.messageitem.Message.ID === msglistView.activeMessageID() && !mailboxIsReject()) {
await withStatus('Marking current message as not junk', client.FlagsAdd([miv.messageitem.Message.ID], ['$notjunk']))
}
}, 5*1000)
@ -3762,7 +3762,7 @@ const newMsglistView = (msgElem: HTMLElement, activeMailbox: () => api.Mailbox |
}
const cmdMarkNotJunk = async () => { await withStatus('Marking as not junk', client.FlagsAdd(mlv.selected().map(miv => miv.messageitem.Message.ID), ['$notjunk'])) }
const cmdMarkRead = async () => { await withStatus('Marking as read', client.FlagsAdd(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen'])) }
const cmdMarkUnread = async () => { await withStatus('Marking as not read', client.FlagsClear(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen'])) }
const cmdMarkUnread = async () => { await withStatus('Marking as not read', client.FlagsClear(mlv.selected().map(miv => miv.messageitem.Message.ID), ['\\seen', '$junk', '$notjunk'])) }
const cmdMute = async () => {
const l = mlv.selected()
await withStatus('Muting thread', client.ThreadMute(l.map(miv => miv.messageitem.Message.ID), true))