[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c,1.52,1.53

cras at procontrol.fi cras at procontrol.fi
Sun Aug 24 16:45:36 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage/index/maildir
In directory danu:/tmp/cvs-serv7906/src/lib-storage/index/maildir

Modified Files:
	maildir-storage.c 
Log Message:
IDLE uses now IO_*_NOTIFY to get instant notifying of mails.



Index: maildir-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- maildir-storage.c	27 Jul 2003 03:12:13 -0000	1.52
+++ maildir-storage.c	24 Aug 2003 12:45:33 -0000	1.53
@@ -753,21 +753,29 @@
 }
 
 static void maildir_storage_auto_sync(struct mailbox *box,
-				      enum mailbox_sync_type sync_type,
+				      enum mailbox_sync_flags flags,
 				      unsigned int min_newmail_notify_interval)
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
-	ibox->autosync_type = sync_type;
 	ibox->min_newmail_notify_interval = min_newmail_notify_interval;
 
-        index_mailbox_check_remove_all(ibox);
-	if (sync_type != MAILBOX_SYNC_NONE) {
-		index_mailbox_check_add(ibox,
-			t_strconcat(ibox->index->mailbox_path, "/new", NULL));
-		index_mailbox_check_add(ibox,
-			t_strconcat(ibox->index->mailbox_path, "/cur", NULL));
+	if ((ibox->autosync_flags == 0 && flags == 0) ||
+	    (ibox->autosync_flags != 0 && flags != 0)) {
+		/* flags or interval just changed. or nothing. */
+		ibox->autosync_flags = flags;
+	}
+	ibox->autosync_flags = flags;
+
+	if (flags == 0) {
+		index_mailbox_check_remove_all(ibox);
+		return;
 	}
+
+	index_mailbox_check_add(ibox,
+		t_strconcat(ibox->index->mailbox_path, "/new", NULL), TRUE);
+	index_mailbox_check_add(ibox,
+		t_strconcat(ibox->index->mailbox_path, "/cur", NULL), TRUE);
 }
 
 static int maildir_storage_lock(struct mailbox *box,



More information about the dovecot-cvs mailing list