[dovecot-cvs] dovecot/src/imap imap-sync.c,1.1,1.2

cras at dovecot.org cras at dovecot.org
Sun Jul 18 15:37:01 EEST 2004


Update of /home/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv12564

Modified Files:
	imap-sync.c 
Log Message:
Don't send EXISTS after each EXPUNGE.



Index: imap-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/imap-sync.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- imap-sync.c	12 Jul 2004 11:35:50 -0000	1.1
+++ imap-sync.c	18 Jul 2004 12:36:59 -0000	1.2
@@ -16,7 +16,7 @@
 	struct mail *mail;
         const struct mail_full_flags *mail_flags;
 	string_t *str;
-	uint32_t seq;
+	uint32_t seq, messages_count;
 
 	if (client->mailbox != box) {
 		/* mailbox isn't selected - we only wish to sync the mailbox
@@ -29,6 +29,7 @@
 
 	t_push();
 	str = t_str_new(256);
+	messages_count = client->messages_count;
 
 	t = mailbox_transaction_begin(box, FALSE);
 	ctx = mailbox_sync_init(box, flags);
@@ -50,6 +51,7 @@
 			}
 			break;
 		case MAILBOX_SYNC_TYPE_EXPUNGE:
+			messages_count -= sync_rec.seq2 - sync_rec.seq1 + 1;
 			for (seq = sync_rec.seq2; seq >= sync_rec.seq1; seq--) {
 				str_truncate(str, 0);
 				str_printfa(str, "* %u EXPUNGE", seq);
@@ -67,8 +69,8 @@
 
 	mailbox_transaction_commit(t);
 
-	if (status.messages != client->messages_count) {
-                client->messages_count = status.messages;
+	client->messages_count = status.messages;
+	if (status.messages != messages_count) {
 		str_truncate(str, 0);
 		str_printfa(str, "* %u EXISTS", status.messages);
 		client_send_line(client, str_c(str));



More information about the dovecot-cvs mailing list