From 1c17784507343fff738deeadc2267c648f06ff2f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 6 Jul 2005 21:41:18 +0000 Subject: [PATCH] * Fixed bug #149 (incorrect sequence set optimization, resulting in messages being marked as read/unread incorrectly during IMAP sessions) --- citadel/ChangeLog | 5 +++++ citadel/citadel.h | 4 ++-- citadel/citadel.nsi | 4 ++-- citadel/citadel.spec | 2 +- citadel/msgbase.c | 26 +++++++++++++++----------- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 96cf16a5e..0d0c6fa8d 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 652.1 2005/07/06 21:41:17 ajc +* Fixed bug #149 (incorrect sequence set optimization, resulting in + messages being marked as read/unread incorrectly during IMAP sessions) + Revision 652.0 2005/07/06 02:28:38 ajc * THIS IS 6.52 @@ -6909,3 +6913,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/citadel.h b/citadel/citadel.h index 8907a4000..468244b8f 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -33,7 +33,7 @@ extern "C" { /* * Text description of this software */ -#define CITADEL "Citadel 6.52" +#define CITADEL "Citadel 6.53" /* * REV_LEVEL is the current version number (multiplied by 100 to avoid having @@ -45,7 +45,7 @@ extern "C" { * usually more strict because you're not really supposed to dump/load and * upgrade at the same time. */ -#define REV_LEVEL 652 /* This version */ +#define REV_LEVEL 653 /* This version */ #define REV_MIN 591 /* Oldest compatible database */ #define EXPORT_REV_MIN 652 /* Oldest compatible export files */ diff --git a/citadel/citadel.nsi b/citadel/citadel.nsi index e4ef32dc6..da8a79fec 100644 --- a/citadel/citadel.nsi +++ b/citadel/citadel.nsi @@ -4,7 +4,7 @@ !include "${NSISDIR}\Contrib\Modern UI\System.nsh" !define MUI_PRODUCT "Citadel" -!define MUI_VERSION "6.52" +!define MUI_VERSION "6.53" !define MUI_WELCOMEPAGE !define MUI_LICENSEPAGE !define MUI_COMPONENTSPAGE @@ -18,7 +18,7 @@ ;!define MUI_ICON "${NSISDIR}\Contrib\Icons\modern-install.ico" ;!define MUI_UNICON "${NSISDIR}\Contrib\Icons\modern-uninstall.ico" -OutFile "citadel-6.52.exe" +OutFile "citadel-6.53.exe" BGGradient off LangString DESC_Citadel ${LANG_ENGLISH} "Citadel client and core libraries (required)" diff --git a/citadel/citadel.spec b/citadel/citadel.spec index 64cdd7ecc..96e6b807f 100644 --- a/citadel/citadel.spec +++ b/citadel/citadel.spec @@ -1,7 +1,7 @@ # $Id$ Summary: Citadel, the flexible, powerful way to build online communities Name: citadel -Version: 6.52 +Version: 6.53 Release: 1 Copyright: GPL Group: Applications/Communications diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 1f3517738..f03ed44a2 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -311,7 +311,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, struct cdbdata *cdbfr; int i, j; int is_seen = 0; - int was_seen = 1; + int was_seen = 0; long lo = (-1L); long hi = (-1L); long t = (-1L); @@ -324,6 +324,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, int num_sets; int s; char setstr[SIZ], lostr[SIZ], histr[SIZ]; + size_t tmp; lprintf(CTDL_DEBUG, "CtdlSetSeen(%ld, %d, %d)\n", target_msgnum, target_setting, which_set); @@ -358,7 +359,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, break; } - lprintf(CTDL_DEBUG, "before optimize: %s\n", vset); + /* lprintf(CTDL_DEBUG, "before optimize: %s\n", vset); */ /* Translate the existing sequence set into an array of booleans */ num_sets = num_tokens(vset, ','); @@ -387,6 +388,8 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, /* Now translate the array of booleans back into a sequence set */ strcpy(vset, ""); + lo = (-1L); + hi = (-1L); for (i=0; i sizeof vset) { @@ -423,17 +425,19 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, "1:%ld,%s", t, vset); safestrncpy(vset, lostr, sizeof vset); } + /* end trim-o-matic code */ + tmp = strlen(vset); if (tmp > 0) { strcat(vset, ","); - tmp++; + ++tmp; } if (lo == hi) { - snprintf(&vset[tmp], sizeof vset - tmp, + snprintf(&vset[tmp], (sizeof vset) - tmp, "%ld", lo); } else { - snprintf(&vset[tmp], sizeof vset - tmp, + snprintf(&vset[tmp], (sizeof vset) - tmp, "%ld:%ld", lo, hi); } lo = (-1L); @@ -454,7 +458,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting, int which_set, } free(is_set); - lprintf(CTDL_DEBUG, " after optimize: %s\n", vset); + /* lprintf(CTDL_DEBUG, " after optimize: %s\n", vset); */ free(msglist); CtdlSetRelationship(&vbuf, ((which_user != NULL) ? which_user : &CC->user), -- 2.39.2