- for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++)
- if (is_unseen (mp, msgnum))
- seq_addmsg (mp, *ap, msgnum, -1, 0);
+ /* not set in profile, thus use the default */
+ dp = mh_xstrdup(seq_unseen);
+ }
+ if (!(ap = brkstring(dp, " ", "\n")) || !*ap) {
+ /* contains no sequence name, i.e. we're finished */
+ mh_free0(&dp);
+ return;
+ }
+
+ /*
+ ** Now add/delete each message which has the SELECT_UNSEEN
+ ** bit set to/from each of these sequences.
+ */
+ for (; *ap; ap++) {
+ if (doadd) {
+ for (n = mp->lowmsg; n <= mp->hghmsg; n++) {
+ if (is_unseen(mp, n)) {
+ seq_addmsg(mp, *ap, n, -1, 0);
+ }
+ }
+ } else {
+ /* make sure sequence exists first */
+ if (seq_getnum(mp, *ap) != -1) {
+ for (n = mp->lowsel; n <= mp->hghsel; n++) {
+ if (is_unseen(mp, n)) {
+ seq_delmsg(mp, *ap, n);
+ }
+ }
+ }
+ }