-
Notifications
You must be signed in to change notification settings - Fork 328
imapserver: add CONDSTORE support #687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
372f854
28d3ff2
b0192bf
90b7214
722e434
3b836ae
9f95505
8c2c342
f5944fb
1c633b4
26ef5e5
7989c1a
26ca9ad
5c7ca57
abc01d5
f7c946c
0ef099f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,6 +328,37 @@ func readSearchKeyWithAtom(criteria *imap.SearchCriteria, dec *imapwire.Decoder, | |
criteria.Or = append(criteria.Or, or) | ||
case "$": | ||
criteria.UID = append(criteria.UID, imap.SearchRes()) | ||
case "MODSEQ": | ||
if !dec.ExpectSP() { | ||
return dec.Err() | ||
} | ||
var quotedName, name string | ||
var metadataType imap.SearchCriteriaMetadataType | ||
if dec.Quoted("edName) { | ||
name = quotedName | ||
if !dec.ExpectSP() { | ||
return dec.Err() | ||
} | ||
var typeName string | ||
if !dec.ExpectAtom(&typeName) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this can be combined with |
||
return dec.Err() | ||
} | ||
metadataType = imap.SearchCriteriaMetadataType(strings.ToLower(typeName)) | ||
if !dec.ExpectSP() { | ||
return dec.Err() | ||
} | ||
} | ||
|
||
var modSeq int64 | ||
if !dec.ExpectNumber64(&modSeq) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason to not use |
||
return dec.Err() | ||
} | ||
|
||
criteria.ModSeq = &imap.SearchCriteriaModSeq{ | ||
ModSeq: uint64(modSeq), | ||
MetadataName: name, | ||
MetadataType: metadataType, | ||
} | ||
default: | ||
seqSet, err := imapwire.ParseSeqSet(key) | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,9 @@ func (c *Conn) writeStatus(data *imap.StatusData, options *imap.StatusOptions) e | |
if options.NumRecent { | ||
listEnc.Item().Atom("RECENT").SP().Number(*data.NumRecent) | ||
} | ||
if options.HighestModSeq { | ||
listEnc.Item().Atom("HIGHESTMODSEQ").SP().Number64(int64(data.HighestModSeq)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to use |
||
} | ||
listEnc.End() | ||
|
||
return enc.CRLF() | ||
|
@@ -115,6 +118,8 @@ func readStatusItem(dec *imapwire.Decoder, options *imap.StatusOptions) error { | |
options.DeletedStorage = true | ||
case "RECENT": | ||
options.NumRecent = true | ||
case "HIGHESTMODSEQ": | ||
options.HighestModSeq = true | ||
default: | ||
return &imap.Error{ | ||
Type: imap.StatusResponseTypeBad, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need two variables for the name here? A single should be enough?
If
Quoted
doesn't find a quoted string, it leaves the pointer unchanged.