summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-16 01:37:12 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-16 01:37:12 +0800
commitc46fffb99342eee4d4eeec4e8a4707a294f0b3b7 (patch)
treed55327167136fd6f9ee6d10b51875a6fb1455d5e /mbbsd/mbbsd.c
parent5d8da62f46b60e5c4f6f86f08603e3f4286c86dc (diff)
downloadpttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar.gz
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar.bz2
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar.lz
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar.xz
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.tar.zst
pttbbs-c46fffb99342eee4d4eeec4e8a4707a294f0b3b7.zip
add some comments for ofo water mode.
set nkwbd default to 5, 5 git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1484 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index d2f4aa87..2c2d6cbf 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -365,15 +365,38 @@ write_request(int sig)
reentrant_write_request = 1;
#endif
if (WATERMODE(WATER_OFO)) {
- if( (msgcount = currutmp->msgcount) > 0 ){
- for( i = 0 ; i < msgcount ; ++i ){
+ /* 如果目前正在回水球模式的話, 就不能進行 add_history() ,
+ 因為會改寫 water[], 而使回水球目的爛掉, 所以分成幾種情況考慮.
+ sig != 0表真的有水球進來, 故顯示.
+ sig == 0表示沒有水球進來, 不過之前尚有水球還沒寫到 water[].
+ */
+ static int alreadyshow = 0;
+
+ if( sig ){ /* 真的有水球進來 */
+
+ /* 若原來正在 REPLYING , 則改成 RECVINREPLYING,
+ 這樣在回水球結束後, 會再呼叫一次 write_request(0) */
+ if( wmofo == REPLYING )
+ wmofo = RECVINREPLYING;
+
+ /* 顯示 */
+ for( ; alreadyshow < currutmp->msgcount && alreadyshow < MAX_MSGS
+ ; ++alreadyshow ){
bell();
- show_call_in(1, i);
+ show_call_in(1, alreadyshow);
refresh();
- add_history(&currutmp->msgs[i]);
}
+ }
+
+ /* 看看是不是要把 currutmp->msg 拿回 water[] (by add_history())
+ 須要是不在回水球中 (NOTREPLYING) */
+ if( wmofo == NOTREPLYING &&
+ (msgcount = currutmp->msgcount) > 0 ){
+ for( i = 0 ; i < msgcount ; ++i )
+ add_history(&currutmp->msgs[i]);
if( (currutmp->msgcount -= msgcount) < 0 )
currutmp->msgcount = 0;
+ alreadyshow = 0;
}
} else {
if (currutmp->mode != 0 &&