Merge pull request #233 from bitfehler/bitfehler/fetch-modseq
Expose MODSEQ attribute in FETCH responses
This commit is contained in:
commit
68031592a8
1 changed files with 11 additions and 0 deletions
|
|
@ -115,6 +115,17 @@ impl<'a> Fetch<'a> {
|
||||||
&self.flags[..]
|
&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]`,
|
/// 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`.
|
/// or `RFC822.HEADER` was included in the `query` argument to `FETCH`.
|
||||||
pub fn header(&self) -> Option<&[u8]> {
|
pub fn header(&self) -> Option<&[u8]> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue