summaryrefslogtreecommitdiffstats
path: root/mbbsd/mail.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-12 19:55:00 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-12 19:55:00 +0800
commit728e27e6f357fa2e00177f949ffed0d830fd004d (patch)
tree527bde4005feb7ab777751f1626f082447a88fed /mbbsd/mail.c
parent0c4c72121c0afc0cca3a4cac6ac70b120cd235c3 (diff)
downloadpttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.gz
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.bz2
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.lz
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.xz
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.zst
pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.zip
- (internal) use new visio/vfooter() API to display footers
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4146 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mail.c')
-rw-r--r--mbbsd/mail.c68
1 files changed, 18 insertions, 50 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index b81b1e3a..6edb68db 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -903,7 +903,8 @@ read_new_mail(void * voidfptr, void *optarg)
return more_result;
}
- outmsglr(MSG_MAILER, MSG_MAILER_LEN, "", 0);
+ vfooter(" 信件處理 ",
+ " (R)回信 (x)站內轉寄 (y)回群組信 (d/D)刪信");
switch (igetch()) {
case 'r':
@@ -1141,70 +1142,37 @@ int b_call_in(int ent, const fileheader_t * fhdr, const char *direct);
static int
mail_read(int ent, fileheader_t * fhdr, const char *direct)
{
- char buf[PATHLEN];
- char done, delete_it, replied;
+ char buf[PATHLEN];
+ int done;
- clear();
+ // in current design, mail_read is ok for single entry.
setdirpath(buf, direct, fhdr->filename);
strlcpy(currtitle, subject(fhdr->title), sizeof(currtitle));
- done = delete_it = replied = NA;
- while (!done) {
- int more_result = more(buf, YEA);
- /* whether success or not, update flag.
- * or users may bug about "black-hole" mails
- * and blinking notification */
- if( !(fhdr->filemode & FILE_READ))
- {
- fhdr->filemode |= FILE_READ;
- substitute_ref_record(direct, fhdr, ent);
- }
- switch (more_result) {
+ /* whether success or not, update flag.
+ * or users may bug about "black-hole" mails
+ * and blinking notification */
+ if( !(fhdr->filemode & FILE_READ))
+ {
+ fhdr->filemode |= FILE_READ;
+ substitute_ref_record(direct, fhdr, ent);
+ }
+ done = more(buf, YEA);
+ // quick control
+ switch (done) {
case -1:
/* no such file */
clear();
vmsg("此封信無內容。");
return FULLUPDATE;
- case RET_DOREPLY:
+ case RET_DOREPLY:
mail_reply(ent, fhdr, direct);
return FULLUPDATE;
case RET_DOREPLYALL:
multi_reply(ent, fhdr, direct);
return FULLUPDATE;
- case RET_DORECOMMEND: // we don't accept this.
- return FULLUPDATE;
- case 0:
- break;
- default:
- return more_result;
- }
- outmsglr(MSG_MAILER, MSG_MAILER_LEN, "", 0);
-
- switch (igetch()) {
- case 'r':
- case 'R':
- replied = YEA;
- mail_reply(ent, fhdr, direct);
- break;
- case 'y':
- multi_reply(ent, fhdr, direct);
- break;
- case 'x':
- m_forward(ent, fhdr, direct);
- break;
- case 'd':
- delete_it = YEA;
- default:
- done = YEA;
- }
}
- if (delete_it)
- mail_del(ent, fhdr, direct);
- else {
- fhdr->filemode |= FILE_READ;
- substitute_ref_record(direct, fhdr, ent);
- }
- return FULLUPDATE;
+ return done;
}
static int