From 5dd1b69630a1614dd3cf7705c254e3f68d2a498d Mon Sep 17 00:00:00 2001 From: ptt Date: Thu, 13 Oct 2005 16:19:19 +0000 Subject: fix bug about mailalert git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3224 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mail.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mbbsd/mail.c') diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 0b04a245..b0d9941b 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -863,6 +863,13 @@ read_new_mail(void * voidfptr, void *optarg) return 0; } +void setmailalert() +{ + if(load_mailalert(cuser.userid)) + currutmp->alerts |= ALERT_NEW_MAIL; + else + currutmp->alerts &= ~ALERT_NEW_MAIL; +} int m_new(void) { @@ -880,7 +887,7 @@ m_new(void) return -1; } curredit = 0; - currutmp->alerts |= load_mailalert(cuser.userid); + setmailalert(); while (arg.delcnt--) delete_record(currmaildir, sizeof(fileheader_t), arg.delmsgs[arg.delcnt]); if(arg.delmsgs) @@ -1597,7 +1604,7 @@ m_read(void) i_read(RMAIL, currmaildir, mailtitle, maildoent, mail_comms, -1); currbid = back_bid; curredit = 0; - currutmp->alerts |= load_mailalert(cuser.userid); + setmailalert(); return 0; } else { outs("您沒有來信"); -- cgit v1.2.3