- /*
- * Now add/delete each message which has the SELECT_UNSEEN
- * bit set to/from each of these sequences.
- */
- for (; *ap; ap++) {
- if (seen) {
- /* make sure sequence exists first */
- if (seq_getnum(mp, *ap) != -1)
- for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
- if (is_unseen (mp, msgnum))
- seq_delmsg (mp, *ap, msgnum);
- } else {
- for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++)
- if (is_unseen (mp, msgnum))
- seq_addmsg (mp, *ap, msgnum, -1, 0);
+ /*
+ ** 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);
+ }
+ }
+ }
+ }