Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2928:3470bb04fb57 HEAD
RETR: Don't bother adding \Seen flag to message if it's already there.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 04 Dec 2004 21:46:59 +0200 |
parents | 6e2129a4a595 |
children | ba9062032877 |
files | src/pop3/commands.c |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pop3/commands.c Sat Dec 04 20:51:26 2004 +0200 +++ b/src/pop3/commands.c Sat Dec 04 21:46:59 2004 +0200 @@ -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;