projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor clarification in mh-alias(5)
[mmh]
/
sbr
/
seq_setunseen.c
diff --git
a/sbr/seq_setunseen.c
b/sbr/seq_setunseen.c
index
2bb09b9
..
e628393
100644
(file)
--- a/
sbr/seq_setunseen.c
+++ b/
sbr/seq_setunseen.c
@@
-13,12
+13,11
@@
** We scan through the folder and act upon all messages
** that are marked with the SELECT_UNSEEN bit.
**
** We scan through the folder and act upon all messages
** that are marked with the SELECT_UNSEEN bit.
**
-** If seen == 1, delete messages from unseen sequence.
-** If seen == 0, add messages to unseen sequence.
+** Either add messages to or (if doadd is false) delete messages from
+** the unseen sequence(s).
*/
*/
-
void
void
-seq_setunseen(struct msgs *mp, int seen)
+seq_setunseen(struct msgs *mp, int doadd)
{
int n;
char **ap, *cp, *dp;
{
int n;
char **ap, *cp, *dp;
@@
-44,7
+43,13
@@
seq_setunseen(struct msgs *mp, int seen)
** bit set to/from each of these sequences.
*/
for (; *ap; ap++) {
** bit set to/from each of these sequences.
*/
for (; *ap; ap++) {
- if (seen) {
+ 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++) {
/* make sure sequence exists first */
if (seq_getnum(mp, *ap) != -1) {
for (n = mp->lowsel; n <= mp->hghsel; n++) {
@@
-53,12
+58,6
@@
seq_setunseen(struct msgs *mp, int seen)
}
}
}
}
}
}
- } else {
- for (n = mp->lowmsg; n <= mp->hghmsg; n++) {
- if (is_unseen(mp, n)) {
- seq_addmsg(mp, *ap, n, -1, 0);
- }
- }
}
}
}
}