| 345 | } |
| 346 | |
| 347 | static IndexSet * indexSetFromSet(struct mailimap_set * imap_set) |
| 348 | { |
| 349 | IndexSet * indexSet = IndexSet::indexSet(); |
| 350 | for(clistiter * cur = clist_begin(imap_set->set_list) ; cur != NULL ; cur = clist_next(cur)) { |
| 351 | struct mailimap_set_item * item = (struct mailimap_set_item *) clist_content(cur); |
| 352 | if (item->set_last == 0) { |
| 353 | indexSet->addRange(RangeMake(item->set_first, UINT64_MAX)); |
| 354 | } |
| 355 | else { |
| 356 | indexSet->addRange(RangeMake(item->set_first, item->set_last - item->set_first)); |
| 357 | } |
| 358 | } |
| 359 | return indexSet; |
| 360 | } |
| 361 | |
| 362 | void IMAPSession::init() |
| 363 | { |