diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-06 15:23:10 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-06 15:23:10 +0800 |
commit | 3dd483238d0ba18b39cd725a6d8b729ef62a1951 (patch) | |
tree | aa84409cc17ec7073cd82940aea84284859e0838 /mbbsd | |
parent | 94afb5747513bf5f9ac2084839131659e8c08e28 (diff) | |
download | pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar.gz pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar.bz2 pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar.lz pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar.xz pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.tar.zst pttbbs-3dd483238d0ba18b39cd725a6d8b729ef62a1951.zip |
dirty fix search in userlist
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1036 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/talk.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 08ef5020..239c2ded 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.110 2003/05/18 07:20:29 in2 Exp $ */ +/* $Id: talk.c,v 1.111 2003/07/06 07:23:10 in2 Exp $ */ #include "bbs.h" #define QCAST int (*)(const void *, const void *) @@ -1824,9 +1824,8 @@ userlist(void) static char show_uid = 0; static char show_board = 0; static char show_pid = 0; - char genbuf[256]; - int page, offset, pickup_way, ch, leave, redraw, redrawall, - fri_stat; + char genbuf[256], skippickup = 0, redraw, redrawall; + int page, offset, pickup_way, ch, leave, fri_stat; int nfriend, myfriend, friendme, bfriend, badfriend, i; time_t lastupdate; @@ -1843,8 +1842,9 @@ userlist(void) * leave: 離開使用者名單 */ while (!leave) { - pickup(currpickup, pickup_way, &page, - &nfriend, &myfriend, &friendme, &bfriend, &badfriend); + if( !skippickup ) + pickup(currpickup, pickup_way, &page, + &nfriend, &myfriend, &friendme, &bfriend, &badfriend); draw_pickup(redrawall, currpickup, pickup_way, page, show_mode, show_uid, show_board, show_pid, myfriend, friendme, bfriend, badfriend); @@ -1866,7 +1866,7 @@ userlist(void) continue; } } - redraw = redrawall = 0; + skippickup = redraw = redrawall = 0; lastupdate = now; while (!redraw) { ch = cursor_key(offset + 3, 0); @@ -2012,21 +2012,38 @@ userlist(void) if (si >= 0) { pickup_t friends[MAX_FRIEND + 1]; int nGots, i; - fi = SHM->sorted[SHM->currsorted][0][si] - - &SHM->uinfo[0]; + userinfo_t **utmp = + SHM->sorted[SHM->currsorted] + [((pickup_way == 0) ? 0 : (pickup_way - 1))]; + + fi = utmp[si] - &SHM->uinfo[0]; nGots = pickup_myfriend(friends, &myfriend, &friendme, &badfriend); for (i = 0; i < nGots; ++i) if (friends[i].uoffset == fi) break; - if (i != nGots) { + + fi = 0; + offset = 0; + if( i != nGots ){ page = i / nPickups; - offset = i % nPickups; - } else { + for( ; i < nGots && fi < nPickups ; ++i ) + if( isvisible(currutmp, friends[i].ui) ) + currpickup[fi++] = friends[i]; + i = 0; + } + else{ page = (si + nGots) / nPickups; - offset = (si + nGots) % nPickups; + i = si; } + + for( ; fi < nPickups && i < SHM->UTMPnumber ; ++i ) + if( isvisible(currutmp, utmp[i]) ){ + currpickup[fi].ui = utmp[i]; + currpickup[fi++].friend = 0; + } + skippickup = 1; } redrawall = redraw = 1; } |