IMAP: clean up imports and comments
authoradam <adam@megacz.com>
Sat, 17 Mar 2007 08:54:29 +0000 (08:54 +0000)
committeradam <adam@megacz.com>
Sat, 17 Mar 2007 08:54:29 +0000 (08:54 +0000)
darcs-hash:20070317085429-5007d-5a969d0629379d119a940aa059645692f1e17d35.gz

src/org/ibex/mail/IMAP.java

index 0779956..9038cc1 100644 (file)
@@ -45,13 +45,6 @@ public class IMAP {
     public IMAP() { }
     public static final float version = (float)0.2;
 
-    // FIXME this is evil
-    public static String getBodyString(Message m) {
-        StringBuffer sb = new StringBuffer();
-        m.getBody().getStream().transcribe(sb);
-        return sb.toString();
-    }
-
     // API Class //////////////////////////////////////////////////////////////////////////////
 
     public static interface Client {
@@ -183,6 +176,7 @@ public class IMAP {
         public void delete(Mailbox m) { if (!m.equals(inbox)) m.destroy(false); else throw new Bad("can't delete inbox"); }
         public void create(String m) { mailbox(m, true, false); }
         public void append(String m,int f,Date a,String b) { try {
+            // FIXME: more efficient streaming here?
             mailbox(m,false).insert(Message.newMessage(new Fountain.StringFountain(b)), f | Mailbox.Flag.RECENT);
         } catch (Message.Malformed e) { throw new No(e.getMessage()); } }
         public void check() { }
@@ -224,7 +218,7 @@ public class IMAP {
             for(Mailbox.Iterator it = selected().iterator(q);it.next();) {
                 // FIXME: what's going on here with the recent flag?
                 //boolean recent = it.getFlag(Mailbox.Flag.RECENT);
-                try { throw new Exception("flags " + flags); } catch (Exception e) { Log.error(this, e); }
+                //try { throw new Exception("flags " + flags); } catch (Exception e) { Log.error(this, e); }
                 if (style == -1)     it.setFlags(it.getFlags() & ~flags);
                 else if (style == 0) it.setFlags(flags);
                 else if (style == 1) it.setFlags(it.getFlags() | flags);
@@ -262,7 +256,11 @@ public class IMAP {
         Login auth;
         public Listener(Login auth) { api = new IMAP.MailboxWrapper(this.auth = auth, this); }
         Parser.Token token() { return parser.token(); }
-        void println(String s) { conn.println(s); }
+        Parser.Token token(boolean freak) { return parser.token(freak); }
+        void println(String s) {
+            conn.println(s);
+            Log.info("", s);
+        }
         void newline() { parser.newline(); }
         Query query(int max) { return parser.query(max, maxn(true)); }