use lastModified() to record SEEN bit on FileBasedMailbox
[org.ibex.mail.git] / src / org / ibex / mail / FileBasedMailbox.java
index 79f9567..2a614d7 100644 (file)
@@ -144,7 +144,8 @@ public class FileBasedMailbox extends Mailbox.Default {
             f.renameTo(new File(fullname));
             uidNext++;
             f = new File(fullname);
-            if ((flags & Mailbox.Flag.SEEN) == Mailbox.Flag.SEEN) f.setLastModified(MAGIC_DATE);
+            if ((flags & Mailbox.Flag.SEEN) == 0)  f.setLastModified(MAGIC_DATE);
+            else if (f.lastModified()==MAGIC_DATE) f.setLastModified(System.currentTimeMillis());
         } catch (IOException e) { throw new MailException.IOException(e); }
         Log.info(this, path + " <= " + message.summary());
     }
@@ -162,7 +163,6 @@ public class FileBasedMailbox extends Mailbox.Default {
         private File file() { return new File(path.getAbsolutePath() + slash + files[cur]); }
         public boolean done() { return cur >= files.length; }
         public boolean next() { cur++; return !done(); }
-        public boolean seen() { return false; }
         public boolean recent() { return false; }
         public int nntpNumber() { return cur+1; }  // FIXME: lame
         public int imapNumber() { return cur+1; }  // EUDORA insists that message numbers start at 1, not 0