summaryrefslogtreecommitdiffstats
path: root/mbbsd/chat.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-18 13:49:40 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-18 13:49:40 +0800
commitc77c6cf22be895bb34192df420a9a141fe4a9d2c (patch)
treeffbb5a3bc61d8d8a181853ffceacb2eb7f8c59a0 /mbbsd/chat.c
parent18f83795218bf3ea80255e9e84781ffa306921c5 (diff)
downloadpttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar.gz
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar.bz2
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar.lz
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar.xz
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.tar.zst
pttbbs-c77c6cf22be895bb34192df420a9a141fe4a9d2c.zip
- xchat: fix "waterball exists forever" issue, and prevent printing mail alerts all the time.
- visio: improve history navigation ordering git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4187 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chat.c')
-rw-r--r--mbbsd/chat.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index 4e931199..915ff749 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -312,10 +312,10 @@ t_chat(void)
char chatroom[IDLEN+1] = "";/* Chat-Room Name */
char inbuf[80], chatid[20] = "", *ptr = "";
- struct sockaddr_in sin;
+ char hasnewmail = 0;
+ char fpath[PATHLEN];
int cfd;
int chatting = YEA;
- char fpath[PATHLEN];
struct ChatBuf chatbuf;
ChatCbParam vgetparam = {0};
@@ -347,20 +347,12 @@ t_chat(void)
memset(&chatbuf, 0, sizeof(chatbuf));
outs(" 驅車前往 請梢候........ ");
- memset(&sin, 0, sizeof sin);
-#ifdef __FreeBSD__
- sin.sin_len = sizeof(sin);
-#endif
- sin.sin_family = PF_INET;
- sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- sin.sin_port = htons(NEW_CHATPORT);
- cfd = socket(sin.sin_family, SOCK_STREAM, 0);
- if (connect(cfd, (struct sockaddr *) & sin, sizeof sin) != 0) {
+ cfd = toconnect(XCHATD_ADDR);
+ if (cfd < 0) {
outs("\n "
"哇! 沒人在那邊耶...要有那地方的人先去開門啦!...");
system("bin/xchatd");
pressanykey();
- close(cfd);
return -1;
}
@@ -428,7 +420,7 @@ t_chat(void)
vgetparam.chatting = &chatting;
while (chatting) {
- print_chatid(chatid);
+ print_chatid(chatid); clrtobot();
move(b_lines-1, chatid_len);
// chatid_len = 10, quote(:) occupies 1, so 79-11=68
@@ -481,7 +473,16 @@ t_chat(void)
// print mail message if possible.
if (ISNEWMAIL(currutmp))
- printchatline("◆ 噹!郵差又來了...");
+ {
+ if (!hasnewmail)
+ {
+ printchatline("◆ 您有未讀的新信件。");
+ hasnewmail = 1;
+ }
+ } else {
+ if (hasnewmail)
+ hasnewmail = 0;
+ }
}
close(cfd);