Skip to content
Snippets Groups Projects
Commit 2b081844 authored by deuce's avatar deuce
Browse files

Add support for search rages specified both by offset and by UID... ie:

1 UID SEARCH 1:100 UID 500:600

This may fix the iOS problems with the IMAP service.
parent 11355f97
No related branches found
No related tags found
No related merge requests found
......@@ -1620,6 +1620,7 @@ function do_search(args, uid)
var failed;
var idx,hdr,body;
var result=[];
var offsets=index.offsets;
function get_func(args)
{
......@@ -1803,14 +1804,18 @@ function do_search(args, uid)
return([type,search]);
}
if(args[0].search(/^(?:(?:[0-9]+|\*)(?::(?:[0-9]+|\*))?,)*(?:(?:[0-9]+|\*)(?::(?:[0-9]+|\*))?)$/)==0) {
offsets=parse_seq_set(args.shift(), false);
}
while(args.length) {
i=get_func(args);
search_set[i[0]].push(i[1]);
}
for(i in index.offsets) {
for(i in offsets) {
failed=false;
idx=index.idx[index.offsets[i]];
idx=index.idx[offsets[i]];
if(search_set.idx.length > 0) {
for(j in search_set.idx) {
if(search_set.idx[j](idx)==false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment