File tree Expand file tree Collapse file tree 1 file changed +22
-14
lines changed Expand file tree Collapse file tree 1 file changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -28,31 +28,39 @@ pub struct Fetch {
28
28
/// A number expressing the [RFC-2822](https://tools.ietf.org/html/rfc2822) size of the message.
29
29
/// Only present if `RFC822.SIZE` was specified in the query argument to `FETCH`.
30
30
pub size : Option < u32 > ,
31
+
32
+ /// A number expressing the [RFC-7162](https://tools.ietf.org/html/rfc7162) mod-sequence
33
+ /// of the message.
34
+ pub modseq : Option < u64 > ,
31
35
}
32
36
33
37
impl Fetch {
34
38
pub ( crate ) fn new ( response : ResponseData ) -> Self {
35
- let ( message, uid, size) = if let Response :: Fetch ( message, attrs) = response. parsed ( ) {
36
- let mut uid = None ;
37
- let mut size = None ;
38
-
39
- for attr in attrs {
40
- match attr {
41
- AttributeValue :: Uid ( id) => uid = Some ( * id) ,
42
- AttributeValue :: Rfc822Size ( sz) => size = Some ( * sz) ,
43
- _ => { }
39
+ let ( message, uid, size, modseq) =
40
+ if let Response :: Fetch ( message, attrs) = response. parsed ( ) {
41
+ let mut uid = None ;
42
+ let mut size = None ;
43
+ let mut modseq = None ;
44
+
45
+ for attr in attrs {
46
+ match attr {
47
+ AttributeValue :: Uid ( id) => uid = Some ( * id) ,
48
+ AttributeValue :: Rfc822Size ( sz) => size = Some ( * sz) ,
49
+ AttributeValue :: ModSeq ( ms) => modseq = Some ( * ms) ,
50
+ _ => { }
51
+ }
44
52
}
45
- }
46
- ( * message, uid, size)
47
- } else {
48
- unreachable ! ( )
49
- } ;
53
+ ( * message, uid, size, modseq)
54
+ } else {
55
+ unreachable ! ( )
56
+ } ;
50
57
51
58
Fetch {
52
59
response,
53
60
message,
54
61
uid,
55
62
size,
63
+ modseq,
56
64
}
57
65
}
58
66
You can’t perform that action at this time.
0 commit comments