commit 7cc0e47fa896d9261d8f6e9787ffd6a36a746dd1
parent bb70a84b1ffa914a1043f521940d8293423aab1b
Author: rsc <devnull@localhost>
Date: Sat, 23 Jun 2007 06:14:23 +0000
add Get, Refresh commands; refresh at startup
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/cmd/acme/mail/mail.c b/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();
}
@@ -441,6 +442,25 @@ mboxcommand(Window *w, char *s)
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)