changeset 8723:eaffedbc23f2 HEAD

pop3: Fix to previous changes: Update \Seen flags even when not using QUIT.
author Timo Sirainen <tss@iki.fi>
date Thu, 05 Feb 2009 11:54:53 -0500
parents fbc3e829ade6
children 3453dbc2e42e
files src/pop3/client.c src/pop3/client.h src/pop3/commands.c
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3/client.c	Wed Feb 04 17:50:05 2009 -0500
+++ b/src/pop3/client.c	Thu Feb 05 11:54:53 2009 -0500
@@ -272,6 +272,9 @@
 
 void client_destroy(struct client *client, const char *reason)
 {
+	if (client->seen_change_count > 0)
+		client_update_mails(client);
+
 	if (!client->disconnected) {
 		if (reason == NULL)
 			reason = client_get_disconnect_reason(client);
--- a/src/pop3/client.h	Wed Feb 04 17:50:05 2009 -0500
+++ b/src/pop3/client.h	Thu Feb 05 11:54:53 2009 -0500
@@ -66,6 +66,7 @@
 void client_send_storage_error(struct client *client);
 
 bool client_handle_input(struct client *client);
+bool client_update_mails(struct client *client);
 
 void clients_init(void);
 void clients_deinit(void);
--- a/src/pop3/commands.c	Wed Feb 04 17:50:05 2009 -0500
+++ b/src/pop3/commands.c	Thu Feb 05 11:54:53 2009 -0500
@@ -195,7 +195,7 @@
 	return search_args;
 }
 
-static bool update_mails(struct client *client)
+bool client_update_mails(struct client *client)
 {
 	struct mail_search_args *search_args;
 	struct mail_search_context *ctx;
@@ -226,13 +226,14 @@
 	}
 	mail_free(&mail);
 
+	client->seen_change_count = 0;
 	return mailbox_search_deinit(&ctx) == 0;
 }
 
 static int cmd_quit(struct client *client, const char *args ATTR_UNUSED)
 {
 	if (client->deleted || client->seen_bitmask != NULL) {
-		if (!update_mails(client)) {
+		if (!client_update_mails(client)) {
 			client_send_storage_error(client);
 			client_disconnect(client,
 				"Storage error during logout.");