~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH hydroxide] imap: fix not being able to delete mails and [2000] IDs required

Details
Message ID
<20201217121602.25993-1-mrvikxd@gmail.com>
DKIM signature
pass
Download raw message
Patch: +8 -2
From: MrViK <mrvikxd@gmail.com>

* Advertise imap.DeletedFlag on permanent flags
* Check if `mbox.deleted` has elements before sending API request
---
 imap/mailbox.go | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/imap/mailbox.go b/imap/mailbox.go
index 84bf4f8..1068c28 100644
--- a/imap/mailbox.go
+++ b/imap/mailbox.go
@@ -62,7 +62,7 @@ func (mbox *mailbox) Info() (*imap.MailboxInfo, error) {
func (mbox *mailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error) {
	mbox.u.Lock()
	flags := []string{imap.SeenFlag, imap.DeletedFlag}
	permFlags := []string{imap.SeenFlag}
	permFlags := []string{imap.SeenFlag, imap.DeletedFlag}
	for _, flag := range mbox.u.flags {
		flags = append(flags, flag)
		permFlags = append(permFlags, flag)
@@ -550,8 +550,14 @@ func (mbox *mailbox) Expunge() error {
		return err
	}

	apiIDs := make([]string, 0, len(mbox.deleted))
	mbox.Lock()
	if len(mbox.deleted) == 0 {
		mbox.Unlock()
		return nil // Nothing to do
	}

	apiIDs := make([]string, 0, len(mbox.deleted))

	for apiID := range mbox.deleted {
		apiIDs = append(apiIDs, apiID)
	}
-- 
2.29.2
Details
Message ID
<ke-GgRxHatwfzOsXHC7wx2LYuVduyrQL-NBO0IkM-ne9qX_t84iUJvI1_rtZM-EbRVw1U_336zCiBcOpGc0MBGastDQ_94tPPApUIYR3F8s=@emersion.fr>
In-Reply-To
<20201217121602.25993-1-mrvikxd@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Thanks for the patch, pushed!
Reply to thread Export thread (mbox)