diff options
author | Ori Bernstein <ori@eigenstate.org> | 2019-12-09 12:46:27 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2019-12-09 12:46:27 -0800 |
commit | f7431283d906b1cd7e53eed47af055a5132bbfae (patch) | |
tree | 0cf610c006a09a3d9e9fd30a89286265ca25a38b /sys/src/cmd/upas/fs/mbox.c | |
parent | 55af35eeeb3026ee9aba3658b7ba12d6ea3a5015 (diff) |
upas/fs plumb flag changes.
This patch makes 3 changes:
- It makes upas/fs send plumb messages when a message
changes in the background (eg, someone on another imap
connection opens a message and sets the read flag)
- It makes faces not complain when it gets one of these
new modify messages.
- It makes acme/Mail update the flags in the display
when it gets one of these messages.
Diffstat (limited to 'sys/src/cmd/upas/fs/mbox.c')
-rw-r--r-- | sys/src/cmd/upas/fs/mbox.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/src/cmd/upas/fs/mbox.c b/sys/src/cmd/upas/fs/mbox.c index c97bb8d9c..f7b56643e 100644 --- a/sys/src/cmd/upas/fs/mbox.c +++ b/sys/src/cmd/upas/fs/mbox.c @@ -58,9 +58,6 @@ static Mailboxinit *boxinit[] = { static void delmessage(Mailbox*, Message*); static void mailplumb(Mailbox*, Message*); -/* - * do we want to plumb flag changes? - */ char* syncmbox(Mailbox *mb, int doplumb) { @@ -90,16 +87,13 @@ syncmbox(Mailbox *mb, int doplumb) cachehash(mb, m); m->cstate |= Cnew; n++; - } else if(!doplumb) - m->cstate &= ~Cnew; - if(m->cstate & Cnew){ - if(ensurecache(mb, m) == 0){ - if(doplumb) - mailplumb(mb, m); - msgdecref(mb, m); - } - m->cstate &= ~Cnew; } + if((m->cstate & (Cnew|Cmod)) && ensurecache(mb, m) == 0){ + if(doplumb) + mailplumb(mb, m); + msgdecref(mb, m); + } + m->cstate &= ~(Cnew|Cmod); } if(m->cstate & Cidxstale) y++; @@ -1555,7 +1549,12 @@ mailplumb(Mailbox *mb, Message *m) a[ai-1].next = &a[ai]; a[++ai].name = "mailtype"; - a[ai].value = !m->inmbox ? "delete": "new"; + if(m->cstate & Cmod) + a[ai].value = "modify"; + else if (!m->inmbox) + a[ai].value = "delete"; + else + a[ai].value = "new"; a[ai-1].next = &a[ai]; snprint(date, sizeof date, "%Δ", m->fileid); |