X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fseq_msgstats.c;h=bfd7fb277b7a7af819b36d5922514b4f31ee3765;hp=6b89d70554b7a20d9de936f3186af0330c13b85b;hb=53774c2aaf168871f5595392c7ffc5ce953f4cf2;hpb=1492dd50aa1043da58809ca0fec18cb6ab9937bc diff --git a/sbr/seq_msgstats.c b/sbr/seq_msgstats.c index 6b89d70..bfd7fb2 100644 --- a/sbr/seq_msgstats.c +++ b/sbr/seq_msgstats.c @@ -27,6 +27,8 @@ void clear_msg_flags(struct msgs *mp, int msgnum) { assert_msg_range(mp, msgnum); + if (mp->msgstats[msgnum - mp->lowoff]) + mp->msgflags |= SEQMOD; mp->msgstats[msgnum - mp->lowoff] = 0; } @@ -98,6 +100,11 @@ void set_selected(struct msgs *mp, int msgnum) { assert_msg_range(mp, msgnum); + + if (is_selected(mp, msgnum)) { + return; + } + mp->msgstats[msgnum - mp->lowoff] |= SELECTED; if (mp->lowsel == 0 || msgnum < mp->lowsel) { mp->lowsel = msgnum; @@ -126,19 +133,17 @@ void unset_selected(struct msgs *mp, int msgnum) { assert_msg_range(mp, msgnum); + + if (!is_selected(mp, msgnum)) { + return; + } + mp->msgstats[msgnum - mp->lowoff] &= ~SELECTED; if (mp->numsel > 0) { mp->numsel--; } } -void -unset_unseen(struct msgs *mp, int msgnum) -{ - assert_msg_range(mp, msgnum); - mp->msgstats[msgnum - mp->lowoff] &= ~SELECT_UNSEEN; -} - /* ** private/public sequences