From: Art Cancro Date: Wed, 9 Sep 2009 03:58:12 +0000 (+0000) Subject: * For ctdlsetseen_answered we truncate the firstirst token and then stop; for ctdlset... X-Git-Tag: v7.86~864 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a3f60a519e73a10ec6399db0349838798d7d8c1b;p=citadel.git * For ctdlsetseen_answered we truncate the firstirst token and then stop; for ctdlsetseen_seen we truncate, process, then truncate again. * Also reinstate the 'w' variable and use it to avoid writing to disk if we didn't change anything. --- diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 066e1382b..a46067550 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -505,6 +505,9 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, } while (StrLength(vset) > SIZ) { + StrBufRemove_token(vset, 0, ','); + w = 1; + /* * If we're truncating the sequence set of messages marked with the 'seen' flag, * we want the earliest messages (the truncated ones) to be marked, not unmarked. @@ -513,7 +516,6 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, if (which_set == ctdlsetseen_seen) { StrBuf *first_tok; first_tok = NewStrBuf(); - StrBufRemove_token(vset, 0, ','); StrBufExtract_token(first_tok, vset, 0, ','); StrBufRemove_token(vset, 0, ','); @@ -548,7 +550,9 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, free(is_set); free(msglist); - CtdlSetRelationship(&vbuf, which_user, which_room); + if (w) { + CtdlSetRelationship(&vbuf, which_user, which_room); + } FreeStrBuf(&vset); }