summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/proto.h2
-rw-r--r--include/pttstruct.h5
-rw-r--r--mbbsd/mail.c30
3 files changed, 32 insertions, 5 deletions
diff --git a/include/proto.h b/include/proto.h
index b34cfab1..ce0c49f7 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -345,7 +345,7 @@ int mail_muser(const userec_t muser, const char *title, const char *filename);
int mail_id(const char* id, const char *title, const char *filename, const char *owner);
int m_read(void);
int doforward(const char *direct, const fileheader_t *fh, int mode);
-int mail_reply(int ent, const fileheader_t *fhdr, const char *direct);
+int mail_reply(int ent, fileheader_t *fhdr, const char *direct);
int bsmtp(const char *fpath, const char *title, const char *rcpt, int method);
void hold_mail(const char *fpath, const char *receiver);
void m_init(void);
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 7a699bc5..52b7881a 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -266,11 +266,12 @@ typedef struct fileheader_t {
#define FILE_LOCAL 0x1 /* local saved, non-mail */
#define FILE_READ 0x1 /* already read, mail only */
-#define FILE_MARKED 0x2 /* opus: 0x8 <- what? */
+#define FILE_MARKED 0x2 /* non-mail + mail */
#define FILE_DIGEST 0x4 /* digest, non-mail */
+#define FILE_REPLIED 0x4 /* replied, mail only */
#define FILE_BOTTOM 0x8 /* push_bottom, non-mail */
#define FILE_MULTI 0x8 /* multi send, mail only */
-#define FILE_SOLVED 0x10 /* problem solved, sysop/BM only */
+#define FILE_SOLVED 0x10 /* problem solved, sysop/BM non-mail only */
#define FILE_HIDE 0x20 /* hide, in announce */
#define FILE_BID 0x20 /* bid, in non-announce */
#define FILE_BM 0x40 /* BM only, in announce */
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();