Skip to content

Commit 0537d10

Browse files
committed
Parse HIGHESTMODSEQ into Mailbox.highest_modseq
1 parent 5898f9c commit 0537d10

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,7 @@ mod tests {
17001700
permanent_flags: vec![],
17011701
uid_next: Some(2),
17021702
uid_validity: Some(1257842737),
1703+
highest_modseq: None,
17031704
};
17041705
let mailbox_name = "INBOX";
17051706
let command = format!("A0001 EXAMINE {}\r\n", quote!(mailbox_name));
@@ -1723,6 +1724,7 @@ mod tests {
17231724
* OK [UNSEEN 1] First unseen.\r\n\
17241725
* OK [UIDVALIDITY 1257842737] UIDs valid\r\n\
17251726
* OK [UIDNEXT 2] Predicted next UID\r\n\
1727+
* OK [HIGHESTMODSEQ 90060115205545359] Highest mailbox modsequence\r\n\
17261728
A0001 OK [READ-ONLY] Select completed.\r\n"
17271729
.to_vec();
17281730
let expected_mailbox = Mailbox {
@@ -1746,6 +1748,7 @@ mod tests {
17461748
],
17471749
uid_next: Some(2),
17481750
uid_validity: Some(1257842737),
1751+
highest_modseq: Some(90060115205545359),
17491752
};
17501753
let mailbox_name = "INBOX";
17511754
let command = format!("A0001 SELECT {}\r\n", quote!(mailbox_name));

src/parse.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ pub(crate) async fn parse_mailbox<T: Stream<Item = io::Result<ResponseData>> + U
220220
Some(ResponseCode::UidNext(unext)) => {
221221
mailbox.uid_next = Some(*unext);
222222
}
223+
Some(ResponseCode::HighestModSeq(highest_modseq)) => {
224+
mailbox.highest_modseq = Some(*highest_modseq);
225+
}
223226
Some(ResponseCode::Unseen(n)) => {
224227
mailbox.unseen = Some(*n);
225228
}

src/types/mailbox.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub struct Mailbox {
3535
/// The unique identifier validity value. See [`Uid`] for more details. If this is missing,
3636
/// the server does not support unique identifiers.
3737
pub uid_validity: Option<u32>,
38+
39+
/// Highest mailbox mod-sequence as defined in [RFC-7162](https://tools.ietf.org/html/rfc7162).
40+
pub highest_modseq: Option<u64>,
3841
}
3942

4043
impl fmt::Display for Mailbox {

0 commit comments

Comments
 (0)