commit 7cc0e47fa896d9261d8f6e9787ffd6a36a746dd1 from: rsc date: Sat Jun 23 06:14:23 2007 UTC add Get, Refresh commands; refresh at startup commit - bb70a84b1ffa914a1043f521940d8293423aab1b commit + 7cc0e47fa896d9261d8f6e9787ffd6a36a746dd1 blob - 8f165fe1fc9ee11f91ef9d88c6f99cb69c66fe71 blob + c61f0c126e264ba37dc588f02fcf8b7a7a54c00e --- src/cmd/acme/mail/mail.c +++ src/cmd/acme/mail/mail.c @@ -233,6 +233,7 @@ threadmain(int argc, char *argv[]) proccreate(plumbproc, nil, STACK); proccreate(plumbshowproc, nil, STACK); threadcreate(plumbshowthread, nil, STACK); + fswrite(mbox.ctlfd, "refresh", 7); /* ... and use this thread to read the messages */ plumbthread(); } @@ -439,8 +440,27 @@ mboxcommand(Window *w, char *s) } if(strcmp(s, "Put") == 0){ rewritembox(wbox, &mbox); + return 1; + } + if(strcmp(s, "Get") == 0){ + if(mbox.dirty){ + mbox.dirty = 0; + fprint(2, "mail: mailbox not written\n"); + return 1; + } + winsetaddr(w, ",", 1); + if(w->data == nil) + w->data = winopenfile(w, "data"); + fswrite(w->data, "", 0); + mesgmenu(wbox, &mbox); + winclean(wbox); + fswrite(mbox.ctlfd, "refresh", 7); return 1; } + if(strcmp(s, "Refresh") == 0){ + fswrite(mbox.ctlfd, "refresh", 7); + return 1; + } if(strcmp(s, "Delmesg") == 0){ save = nil; if(nargs > 1)