[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c,1.63,1.64

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


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

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



Index: mbox-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- mbox-storage.c	27 Jul 2003 03:12:13 -0000	1.63
+++ mbox-storage.c	24 Aug 2003 12:45:33 -0000	1.64
@@ -757,17 +757,24 @@
 }
 
 static void mbox_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, ibox->index->mailbox_path);
+	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);
+	else
+		index_mailbox_check_add(ibox, ibox->index->mailbox_path, FALSE);
 }
 
 static int mbox_storage_lock(struct mailbox *box,



More information about the dovecot-cvs mailing list