Merge pull request #233 from bitfehler/bitfehler/fetch-modseq

Expose MODSEQ attribute in FETCH responses
This commit is contained in:
Jon Gjengset 2022-07-16 07:27:17 -07:00 committed by GitHub
commit 68031592a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,6 +115,17 @@ impl<'a> Fetch<'a> {
&self.flags[..]
}
/// Contains the mod sequence of the performed operation if in response to a `STORE` or
/// `UID STORE` with `UNCHANGEDSINCE` in the query arguments.
/// `UNCHANGEDSINCE` and the inclusion of the mod sequence in the response are part of the
/// [QRESYNC](https://tools.ietf.org/html/rfc7162#section-3.1.3) extension.
pub fn mod_seq(&self) -> Option<u64> {
self.fetch.iter().find_map(|av| match av {
AttributeValue::ModSeq(mod_seq) => Some(*mod_seq),
_ => None,
})
}
/// The bytes that make up the header of this message, if `BODY[HEADER]`, `BODY.PEEK[HEADER]`,
/// or `RFC822.HEADER` was included in the `query` argument to `FETCH`.
pub fn header(&self) -> Option<&[u8]> {