summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-13 23:22:21 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-13 23:22:21 +0800
commit4bc35b3870807886f1019cf52ad8e91d150774ef (patch)
tree72d8a05b274b439c175486d086e0ceeb3f811c34 /mbbsd
parenta3b209f669a99367136225cf890487df69dfabe0 (diff)
downloadpttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar.gz
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar.bz2
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar.lz
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar.xz
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.tar.zst
pttbbs-4bc35b3870807886f1019cf52ad8e91d150774ef.zip
changes mailalert to 1 bit only.
reserved other 7 trigers for updating current status on the fly when user is online. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3223 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/chat.c6
-rw-r--r--mbbsd/mail.c8
-rw-r--r--mbbsd/mbbsd.c2
-rw-r--r--mbbsd/menu.c4
-rw-r--r--mbbsd/register.c2
-rw-r--r--mbbsd/talk.c2
6 files changed, 11 insertions, 13 deletions
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index e736e387..917f8c8d 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -314,7 +314,6 @@ t_chat(void)
struct hostent *h;
int cfd, cmdpos, ch;
int currchar;
- int newmail;
int chatting = YEA;
char fpath[80];
struct ChatBuf chatbuf;
@@ -375,7 +374,7 @@ t_chat(void)
add_io(cfd, 0);
- newmail = currchar = 0;
+ currchar = 0;
cmdpos = -1;
memset(lastcmd, 0, sizeof(lastcmd));
@@ -440,8 +439,7 @@ t_chat(void)
continue;
}
- if (!newmail && currutmp->mailalert) {
- newmail = 1;
+ if (ISNEWMAIL(currutmp)) {
printchatline("◆ 噹!郵差又來了...");
}
if (ch == I_OTHERDATA) {/* incoming */
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 56784a24..0b04a245 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -103,7 +103,7 @@ mailalert(const char *userid)
n = count_logins(tuid, 0);
for (i = 1; i <= n; i++)
if ((uentp = (userinfo_t *) search_ulistn(tuid, i)))
- uentp->mailalert = 1;
+ uentp->alerts |= ALERT_NEW_MAIL;
return 0;
}
@@ -880,7 +880,7 @@ m_new(void)
return -1;
}
curredit = 0;
- currutmp->mailalert = load_mailalert(cuser.userid);
+ currutmp->alerts |= load_mailalert(cuser.userid);
while (arg.delcnt--)
delete_record(currmaildir, sizeof(fileheader_t), arg.delmsgs[arg.delcnt]);
if(arg.delmsgs)
@@ -1597,7 +1597,7 @@ m_read(void)
i_read(RMAIL, currmaildir, mailtitle, maildoent, mail_comms, -1);
currbid = back_bid;
curredit = 0;
- currutmp->mailalert = load_mailalert(cuser.userid);
+ currutmp->alerts |= load_mailalert(cuser.userid);
return 0;
} else {
outs("您沒有來信");
@@ -1879,7 +1879,7 @@ load_mailalert(const char *userid)
read(fd, &my_mail, sizeof(fileheader_t));
if (!(my_mail.filemode & FILE_READ)) {
close(fd);
- return 1;
+ return ALERT_NEW_MAIL;
}
lseek(fd, -(off_t) 2 * sizeof(fileheader_t), SEEK_CUR);
}
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 593208d5..15625061 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -838,7 +838,7 @@ setup_utmp(int mode)
uinfo.pid = currpid = getpid();
uinfo.uid = usernum;
uinfo.mode = currstat = mode;
- uinfo.mailalert = load_mailalert(cuser.userid);
+ uinfo.alerts |= load_mailalert(cuser.userid);
uinfo.userlevel = cuser.userlevel;
uinfo.sex = cuser.sex % 8;
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index 5b4c8494..17d51a8b 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -66,7 +66,7 @@ showtitle(const char *title, const char *mid)
mlen = strlen(mid);
}
#else
- if (currutmp->mailalert) {
+ if (ISNEWMAIL(currutmp)) {
mid = " 郵差來按鈴囉 ";
mid_attr = ANSI_COLOR(41;5);
mlen = strlen(mid);
@@ -548,7 +548,7 @@ static const commands_t moneylist[] = {
};
int main_menu(void) {
- domenu(M_MMENU, "主功\能表", (currutmp->mailalert ? 'M' : 'C'), cmdlist);
+ domenu(M_MMENU, "主功\能表", (ISNEWMAIL(currutmp) ? 'M' : 'C'), cmdlist);
return 0;
}
diff --git a/mbbsd/register.c b/mbbsd/register.c
index 2ec74ff6..1a35c7bc 100644
--- a/mbbsd/register.c
+++ b/mbbsd/register.c
@@ -301,7 +301,7 @@ check_register(void)
* 避免使用者被退回註冊單後,在知道退回的原因之前,
* 又送出一次註冊單。
*/
- if (currutmp->mailalert)
+ if (ISNEWMAIL(currutmp))
m_read();
stand_title("請詳細填寫個人資料");
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 2c5d7527..91cb17cc 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -454,7 +454,7 @@ my_query(const char *uident)
(uentp && isvisible_stat(currutmp, uentp, fri_stat)) ?
modestring(uentp, 0) : "不在站上");
- outs(((uentp && uentp->mailalert) || load_mailalert(muser.userid))
+ outs(((uentp && ISNEWMAIL(uentp)) || load_mailalert(muser.userid))
? "《私人信箱》有新進信件還沒看\n" :
"《私人信箱》所有信件都看過了\n");
prints("《上次上站》%-28.28s《上次故鄉》%s\n",