playing with seen
authoradam <adam@megacz.com>
Sat, 23 Oct 2004 23:58:05 +0000 (23:58 +0000)
committeradam <adam@megacz.com>
Sat, 23 Oct 2004 23:58:05 +0000 (23:58 +0000)
darcs-hash:20041023235805-5007d-62cacdd3b3b19c9b4a7adc408850d01e87f9b502.gz

src/org/ibex/mail/target/FileBasedMailbox.java

index 23f6dc8..5ced682 100644 (file)
@@ -67,14 +67,12 @@ public class FileBasedMailbox extends Mailbox.Default {
             // Make entries for new files which have appeared
             for(String file : new File(dir.getParent()).list()) {
                 File f = new File(dir.getParent() + slash + file);
-                if (file.charAt(0)!='.' && !(f.isDirectory())) {
+                if (file.charAt(0)!='.' && !f.isDirectory()) {
                     Entry e = get(file);
                     if (e == null)
                         prevayler.execute(Entry.create(f));
-                    else if ((f.lastModified() == MAGIC_DATE) != e.seen()) {
-                        Log.warn(this, "changing seen() on uid " + e.uid);
+                    else if ((f.lastModified() == MAGIC_DATE) != e.seen())
                         prevayler.execute(e.seen(f, !e.seen()));
-                    }
                 }
             }
 
@@ -117,6 +115,7 @@ public class FileBasedMailbox extends Mailbox.Default {
 
             public static Transaction create(File f) throws IOException {
                 final boolean seen = f.lastModified() == MAGIC_DATE;
+                Log.error(Entry.class, "create with seen = " + seen);
                 final String name = f.getName();
                 final byte[] header = new MIME.Headers(new Stream(new FileInputStream(f)), true).toString().getBytes();
                 return new Transaction() {