mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 03:26:37 +03:00
imapserver: implement NOTIFY extension from RFC 5465
NOTIFY is like IDLE, but where IDLE watches just the selected mailbox, NOTIFY can watch all mailboxes. With NOTIFY, a client can also ask a server to immediately return configurable fetch attributes for new messages, e.g. a message preview, certain header fields, or simply the entire message. Mild testing with evolution and fairemail.
This commit is contained in:
@ -472,7 +472,7 @@ func (w Webmail) MessageCompose(ctx context.Context, m ComposeMessage, mailboxID
|
||||
err = tx.Update(&mb)
|
||||
xcheckf(ctx, err, "updating sent mailbox for counts")
|
||||
|
||||
changes = append(changes, nm.ChangeAddUID(), mb.ChangeCounts())
|
||||
changes = append(changes, nm.ChangeAddUID(mb), mb.ChangeCounts())
|
||||
})
|
||||
newIDs = nil
|
||||
|
||||
@ -1063,7 +1063,6 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
rm.ModSeq = modseq
|
||||
err := tx.Update(&rm)
|
||||
xcheckf(ctx, err, "updating flags of replied/forwarded message")
|
||||
changes = append(changes, rm.ChangeFlags(oflags))
|
||||
|
||||
// Update modseq of mailbox of replied/forwarded message.
|
||||
rmb, err := store.MailboxID(tx, rm.MailboxID)
|
||||
@ -1072,6 +1071,8 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
err = tx.Update(&rmb)
|
||||
xcheckf(ctx, err, "update modseq of mailbox of replied/forwarded message")
|
||||
|
||||
changes = append(changes, rm.ChangeFlags(oflags, rmb))
|
||||
|
||||
err = acc.RetrainMessages(ctx, log, tx, []store.Message{rm})
|
||||
xcheckf(ctx, err, "retraining messages after reply/forward")
|
||||
}
|
||||
@ -1145,7 +1146,7 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
err = tx.Update(&sentmb)
|
||||
xcheckf(ctx, err, "updating sent mailbox for counts")
|
||||
|
||||
changes = append(changes, sentm.ChangeAddUID(), sentmb.ChangeCounts())
|
||||
changes = append(changes, sentm.ChangeAddUID(sentmb), sentmb.ChangeCounts())
|
||||
})
|
||||
newIDs = nil
|
||||
|
||||
|
Reference in New Issue
Block a user