From 807197a6bf8a378ea8fd0ce2f3d372ba847434d2 Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 28 Feb 2007 11:03:15 +0000 Subject: [PATCH] major simplifications to Iterator api darcs-hash:20070228110315-5007d-96c409d8119f77ff27c9646269595587ab400dd0.gz --- src/org/ibex/mail/Query.java | 12 +- src/org/ibex/mail/protocol/GMail.java | 2 +- src/org/ibex/mail/protocol/IMAP.java | 46 ++++---- src/org/ibex/mail/protocol/SMTP.java | 2 +- src/org/ibex/mail/target/FileBasedMailbox.java | 15 ++- src/org/ibex/mail/target/Mailbox.java | 124 +++------------------ src/org/ibex/mail/target/MailmanArchives.java | 20 +--- src/org/ibex/mail/target/MessageArrayMailbox.java | 19 +--- src/org/ibex/mail/target/SqliteJdbcMailbox.java | 7 +- 9 files changed, 69 insertions(+), 178 deletions(-) diff --git a/src/org/ibex/mail/Query.java b/src/org/ibex/mail/Query.java index 14f3e09..87837f9 100644 --- a/src/org/ibex/mail/Query.java +++ b/src/org/ibex/mail/Query.java @@ -105,12 +105,12 @@ public class Query { (earliest == null || it.cur().arrival.after(earliest)); case HEADER: return it.cur().headers.get(key) != null && ((String)it.cur().headers.get(key)).toLowerCase().indexOf(text.toLowerCase()) != -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(); + case DELETED: return it.getFlag(Mailbox.Flag.DELETED); + case SEEN: return it.getFlag(Mailbox.Flag.SEEN); + case FLAGGED: return it.getFlag(Mailbox.Flag.FLAGGED); + case DRAFT: return it.getFlag(Mailbox.Flag.DRAFT); + case ANSWERED: return it.getFlag(Mailbox.Flag.ANSWERED); + case RECENT: return it.getFlag(Mailbox.Flag.RECENT); // FIXME: super inefficient case BODY: throw new RuntimeException("BODY searches are not supported because they are slow"); diff --git a/src/org/ibex/mail/protocol/GMail.java b/src/org/ibex/mail/protocol/GMail.java index c43df9f..1a5d4ef 100644 --- a/src/org/ibex/mail/protocol/GMail.java +++ b/src/org/ibex/mail/protocol/GMail.java @@ -127,7 +127,7 @@ public class GMail extends Account { for(int i=0; i