MailKit icon indicating copy to clipboard operation
MailKit copied to clipboard

README has obsolete API in it

Open alex-jitbit opened this issue 3 years ago • 6 comments
trafficstars

Describe the bug You've removed AddFlags API from IMailFolder but the README still has an old example

Please provide an updated example if possible

alex-jitbit avatar Jan 24 '22 20:01 alex-jitbit

I assume that this code:

imap.Inbox.AddFlags(uids, MailKit.MessageFlags.Deleted, true);

Should new be

imap.Inbox.Store(uids, new MailKit.StoreFlagsRequest(MailKit.StoreAction.Add, MailKit.MessageFlags.Deleted));

alex-jitbit avatar Jan 24 '22 20:01 alex-jitbit

Oh, I didn't realize that simply adding using MailKit fixes this, because it makes IMailFolderExtensions visible.

alex-jitbit avatar Jan 24 '22 21:01 alex-jitbit

Sorry for the false alarm

alex-jitbit avatar Jan 24 '22 21:01 alex-jitbit

I think it would actually be closer to this (but your assumption is 99% correct):

imap.Inbox.Store(uids, new MailKit.StoreFlagsRequest(MailKit.StoreAction.Add, MailKit.MessageFlags.Deleted) { Silent = true });

jstedfast avatar Jan 24 '22 21:01 jstedfast

No worries, the docs should be updated for sure.

jstedfast avatar Jan 24 '22 21:01 jstedfast

I've updated the README.md for this particular API change, but I need to still audit the rest of the docs

jstedfast avatar Jan 25 '22 23:01 jstedfast