mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 05:54:38 +03:00
webmail: more helpful error message when emptying a mailbox that is already empty
and mention in a tooltip too that "empty mailbox" only affects messages in the mailbox, not submailboxes or their messages. prompted by a question on matrix/irc
This commit is contained in:
@ -1276,9 +1276,13 @@ func (Webmail) MailboxEmpty(ctx context.Context, mailboxID int64) {
|
||||
qm.FilterEqual("Expunged", false)
|
||||
qm.SortAsc("UID")
|
||||
qm.Gather(&expunged)
|
||||
_, err = qm.UpdateNonzero(store.Message{ModSeq: modseq, Expunged: true})
|
||||
n, err := qm.UpdateNonzero(store.Message{ModSeq: modseq, Expunged: true})
|
||||
xcheckf(ctx, err, "deleting messages")
|
||||
|
||||
if n == 0 {
|
||||
xcheckf(ctx, errors.New("no messages in mailbox"), "emptying mailbox")
|
||||
}
|
||||
|
||||
// Remove Recipients.
|
||||
anyIDs := make([]any, len(expunged))
|
||||
for i, m := range expunged {
|
||||
|
Reference in New Issue
Block a user