summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c37
-rw-r--r--mbbsd/talk.c10
2 files changed, 23 insertions, 24 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 59cc974f..9b223c23 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.13 2002/03/19 04:47:34 in2 Exp $ */
+/* $Id: mbbsd.c,v 1.14 2002/03/20 05:23:19 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -369,7 +369,7 @@ static int add_history_water(water_t *w, msgque_t *msg)
static int
add_history(msgque_t *msg)
{
- int i = 0, j;
+ int i = 0, j, waterinit = 0;
water_t *tmp;
if( WATERMODE(WATER_ORIG) || WATERMODE(WATER_NEW) )
add_history_water(&water[0], msg);
@@ -377,24 +377,25 @@ add_history(msgque_t *msg)
for(i = 0 ; i < 5 && swater[i] ; i++ )
if( swater[i]->pid == msg->pid )
break;
- if( i != 5 ){
- if( !swater[i] ){
- water_usies = i + 1;
- swater[i] = &water[i + 1];
- strcpy(swater[i]->userid, msg->userid);
- swater[i]->pid = msg->pid;
- swater[i]->uin = (userinfo_t *)search_ulist_pid(msg->pid);
- }
- tmp = swater[i];
- }
- else{
- tmp = swater[4];
- memset(swater[4], 0, sizeof (water_t));
- strcpy(swater[4]->userid, msg->userid);
- swater[4]->pid = msg->pid;
- swater[4]->uin = (userinfo_t *)search_ulist_pid(msg->pid);
+ if( i == 5 ){
+ waterinit = 1;
i = 4;
+ memset(swater[4], 0, sizeof(water_t));
+ }
+ else if( !swater[i] ){
+ water_usies = i + 1;
+ swater[i] = &water[i + 1];
+ waterinit = 1;
}
+ tmp = swater[i];
+
+ if( waterinit ){
+ memcpy(swater[i]->userid, msg->userid, sizeof(swater[i]->userid));
+ swater[i]->pid = msg->pid;
+ }
+
+ if( !swater[i]->uin )
+ swater[i]->uin = currutmp;
for( j = i ; j > 0 ; j-- )
swater[j] = swater[j - 1];
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index eb4ff2f0..6f1648f9 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.15 2002/03/19 14:34:41 ptt Exp $ */
+/* $Id: talk.c,v 1.16 2002/03/20 05:23:19 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -308,7 +308,8 @@ int isvisible_stat(userinfo_t * me, userinfo_t * uentp, int fri_stat)
if (PERM_HIDE(uentp) && !(PERM_HIDE(me)))/* 對方紫色隱形而你沒有 */
return 0;
else if ((me->userlevel & PERM_SYSOP) ||
- ((fri_stat & HRM) && (fri_stat & HFM))) /* 站長看的見任何人 */
+ ((fri_stat & HRM) && (fri_stat & HFM)))
+ /* 站長看的見任何人 */
return 1;
if (uentp->invisible && !(me->userlevel & PERM_SEECLOAK)) return 0;
@@ -470,12 +471,10 @@ void water_scr(water_t *tw, int which, char type)
else{
move(8 + which, 28);
prints("123456789012345678901234567890");
- // refresh();
move(8 + which, 28);
prints("\033[1;37;44m %c %-13s \033[0m",
tw->uin ? ' ' : 'x',
tw->userid);
- // refresh();
}
}
@@ -504,7 +503,7 @@ void my_write2(void)
if( swater[i]->uin &&
(swater[i]->pid != swater[i]->uin->pid ||
strcmp(swater[i]->userid, swater[i]->uin->userid)) )
- swater[i]->uin = NULL;
+ swater[i]->uin = (userinfo_t*)search_ulist_pid(swater[i]->pid);
water_scr(swater[i], i, 0);
}
move(15, 4);
@@ -556,7 +555,6 @@ void my_write2(void)
else
msg[0] = 0;
move(0, 0);prints("\033[m"); clrtoeol();
- refresh();
sprintf(genbuf, "攻擊 %s:", tw->userid);
if( !oldgetdata(0, 0, genbuf, msg,
80-strlen(tw->userid)-6, DOECHO) )