From 3e81a09d779f1681374df9eba0ad035c65067e51 Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 15 Sep 2005 01:52:29 +0000 Subject: add support to "mark mail as replied" git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3169 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mail.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 1f60177a..30e9b06c 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -925,9 +925,25 @@ mailtitle(void) static void maildoent(int num, fileheader_t * ent) { - char *title, *mark, *color = NULL, type = "+ Mm"[(ent->filemode & 3)]; + char *title, *mark, *color = NULL, type = ' '; char datepart[6]; + if (ent->filemode & FILE_MARKED) + { + type = (ent->filemode & FILE_READ) ? + 'm' : 'M'; + } + else if (ent->filemode & FILE_REPLIED) + { + type = (ent->filemode & FILE_READ) ? + 'r' : 'R'; + } + else + { + type = (ent->filemode & FILE_READ) ? + ' ' : '+'; + } + if (TagNum && !Tagger(atoi(ent->filename + 2), 0, TAG_NIN)) type = 'D'; @@ -1083,7 +1099,7 @@ mail_read(int ent, fileheader_t * fhdr, const char *direct) /* in boards/mail 回信給原作者,轉信站亦可 */ int -mail_reply(int ent, const fileheader_t * fhdr, const char *direct) +mail_reply(int ent, fileheader_t * fhdr, const char *direct) { char uid[STRLEN]; char *t; @@ -1132,6 +1148,16 @@ mail_reply(int ent, const fileheader_t * fhdr, const char *direct) case -3: prints("使用者 [%s] 無法收信", uid); break; + + case 0: + /* success */ + if ( (curredit & EDIT_MAIL) && + !(fhdr->filemode & FILE_REPLIED)) + { + fhdr->filemode |= FILE_REPLIED; + substitute_ref_record(direct, fhdr, ent); + } + break; } curredit = ent; pressanykey(); -- cgit v1.2.3