+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
package org.ibex.mail;
import java.util.*;
import org.ibex.mail.target.*;
(earliest==null||it.cur().date.after(earliest));
case ARRIVAL: return (latest == null || it.cur().arrival.before(latest)) &&
(earliest == null || it.cur().arrival.after(earliest));
- case SIZE: return it.cur().size() >= min && it.cur().size() <= max;
case HEADER: return it.cur().headers.get(key) != null &&
((String)it.cur().headers.get(key)).toLowerCase().indexOf(text.toLowerCase()) != -1;
- case BODY: return it.cur().body.toLowerCase().indexOf(text.toLowerCase()) != -1;
- case FULL: return it.cur().body.toLowerCase().indexOf(text.toLowerCase()) != -1 ||
- it.cur().allHeaders.indexOf(text) != -1;
case DELETED: return it.deleted();
case SEEN: return it.seen();
case FLAGGED: return it.flagged();
case DRAFT: return it.draft();
case ANSWERED: return it.answered();
case RECENT: return it.recent();
+
+ // FIXME: super inefficient
+ case BODY: throw new RuntimeException("BODY searches are not supported because they are slow");
+ case FULL: throw new RuntimeException("FULL searches are not supported because they are slow");
+ case SIZE: throw new RuntimeException("SIZE searches are not supported because Adam is lame");
+ //return it.cur().size() >= min && it.cur().size() <= max;
+
default: throw new Error("this should not happen");
}
}