Draft
Conversation
87739c8 to
dced9c5
Compare
909d447 to
e94c14b
Compare
9541b7a to
2e4a744
Compare
2e4a744 to
017bda2
Compare
vanished kwarg to #uid_fetch
017bda2 to
5c8c0e9
Compare
Collaborator
Author
|
@shugo Before I merge this, do you have any thoughts on the |
5c8c0e9 to
5ad5cbb
Compare
vanished kwarg to #uid_fetchvanished keyword to #uid_fetch
5ad5cbb to
129fbda
Compare
The `vanished` kwarg to `#uid_fetch` can be used to request a list all of the message UIDs in `set` that have been expunged since `changedsince`. Setting `vanished` to true prepends a `VanishedData` object to the returned array. If the server does not return a `VANISHED` response, an empty `VanishedData` object will still be added. _The +QRESYNC+ capabability must be enabled._ [RFC7162](https://rfc-editor.org/rfc/rfc7162) For example: ```ruby imap.enable("QRESYNC") # must enable before selecting the mailbox imap.select("INBOX") # the first value in the returned array is a VanishedData object vanished, *fetched = imap.uid_fetch(301..500, %w[FLAGS], changedsince: 12345, vanished: true) ```
129fbda to
67abeb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
vanishedkwarg to#uid_fetchcan be used to request a list all of the message UIDs insetthat have been expunged sincechangedsince. Settingvanishedto true prepends aVanishedDataobject to the returned array. If the server does not return aVANISHEDresponse, an emptyVanishedDataobject will still be added.For example:
The
QRESYNCcapabability must be enabled. RFC7162Alternatives for return type
This PR chose to prepend a
VanishedDataobject to the returned array. Because it only does this when thevanished: truekwarg is sent, it should be fully backward compatible. Other API choices were considered:[vanished, fetched_array]. I strongly prefer a flat array of responses ([vanished, *fetched_array]). IMO, it's more consistent with the original API, and just as easy to work with.FetchResulttype, with a#vanishedmethod.SearchResult. That was done to minimize any backward compatibility issues. Also, there's no simple way to distinguish between a modseq integer and a UID or sequence number. But I'd prefer not to subclass Array.vanished. I'd prefer to always returnFetchResultaccording to afetch_resultconfig option. And that wouldn't be backward compatible enough to enable by default for the next release.