[dovecot-cvs] dovecot/src/pop3 commands.c,1.33,1.34

cras at dovecot.org cras at dovecot.org
Sat Dec 4 21:47:01 EET 2004


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv11848

Modified Files:
	commands.c 
Log Message:
RETR: Don't bother adding \Seen flag to message if it's already there.



Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/commands.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- commands.c	10 Oct 2004 16:25:06 -0000	1.33
+++ commands.c	4 Dec 2004 19:46:59 -0000	1.34
@@ -337,6 +337,7 @@
 {
         struct fetch_context *ctx;
 	struct mail *mail;
+	const struct mail_full_flags *flags;
 
 	ctx = i_new(struct fetch_context, 1);
 
@@ -357,12 +358,16 @@
 	}
 
 	if (body_lines == (uoff_t)-1 && !no_flag_updates) {
-		/* mark the message seen with RETR command */
-		struct mail_full_flags seen_flag;
-		memset(&seen_flag, 0, sizeof(seen_flag));
-		seen_flag.flags = MAIL_SEEN;
+		flags = mail->get_flags(mail);
 
-		(void)mail->update_flags(mail, &seen_flag, MODIFY_ADD);
+		if (flags != NULL && (flags->flags & MAIL_SEEN) == 0) {
+			/* mark the message seen with RETR command */
+			struct mail_full_flags seen_flag;
+			memset(&seen_flag, 0, sizeof(seen_flag));
+			seen_flag.flags = MAIL_SEEN;
+
+			(void)mail->update_flags(mail, &seen_flag, MODIFY_ADD);
+		}
 	}
 
 	ctx->body_lines = body_lines;



More information about the dovecot-cvs mailing list