summaryrefslogtreecommitdiffstats
path: root/mbbsd/talk.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-14 17:46:19 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-14 17:46:19 +0800
commitd5ca5ae17d82a49a0308931bf3440328f98b9f21 (patch)
tree26c1d0c48b0d47856ae3c8d97bf6dc01dbf19c5e /mbbsd/talk.c
parent0dc6c8d14fc8a36ac7ae92b468d63b79d7a1790b (diff)
downloadpttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar.gz
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar.bz2
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar.lz
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar.xz
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.tar.zst
pttbbs-d5ca5ae17d82a49a0308931bf3440328f98b9f21.zip
lazily generate �n���� in userlist
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@845 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r--mbbsd/talk.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 9e734457..273dd215 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.107 2003/05/14 08:20:11 in2 Exp $ */
+/* $Id: talk.c,v 1.108 2003/05/14 09:46:19 in2 Exp $ */
#include "bbs.h"
#define QCAST int (*)(const void *, const void *)
@@ -1489,6 +1489,7 @@ descript(int show_mode, userinfo_t * uentp, time_t diff)
* ®Æ (¤£¥]¬AªO¤Í, ªO¤Í¬O¥t¥~¥Í¥X¨Óªº) ¤£¹L friend_online[]¬O unorderªº.
* ©Ò¥H¶·­n¥ý§â©Ò¦³ªº¤H®³¥X¨Ó, ­«·s sort ¤@¦¸.
* ¦n¤Í°Ï (¤¬¬Û¥ô¤@¤è¦³³]¦n¤Í+ ªO¤Í) ³Ì¦h¥u·|¦³ MAX_FRIENDS­Ó
+ * ¦]¬°²£¥Í¦n¤Í°Ïªº cost ¬Û·í°ª, "¯à¤£²£¥Í´N¤£­n²£¥Í"
*
* + «D¦n¤Í°Ï
* ³z¹L shmctl utmpsortd , ©w´Á (³q±`¤@¬í¤@¦¸) ±N¥þ¯¸ªº¤H«ö·Ó¦UºØ¤£¦Pªº¤è
@@ -1610,13 +1611,19 @@ pickup(pickup_t * currpickup, int pickup_way, int *page,
if (friendtotal == 0)
*myfriend = *friendme = 1;
-
- if (cuser.uflag & FRIEND_FLAG ||
- (pickup_way == 0 && *page * nPickups < MAX_FRIEND)) {
- /*
- * [¶Ù! ªB¤Í] mode. we need to pickup ALL friends (from currutmp
- * friend_online), sort, and get pickup from right starting position
- */
+
+ /* ²£¥Í¦n¤Í°Ï */
+ which = *page * nPickups;
+ if( (cuser.uflag & FRIEND_FLAG) || /* ¥uÅã¥Ü¦n¤Í¼Ò¦¡ */
+ ((pickup_way == 0) && /* [¶Ù! ªB¤Í] mode */
+ (
+ /* §tªO¤Í, ¦n¤Í°Ï³Ì¦h¥u·|¦³ (friendtotal + ªO¤Í) ­Ó*/
+ (currutmp->brc_id && which < (friendtotal +
+ bcache[currutmp->brc_id-1].nuser)) ||
+
+ /* ¤£§tªO¤Í, ³Ì¦h¥u·|¦³ friendtotal­Ó */
+ (!currutmp->brc_id && which < friendtotal)
+ ))) {
pickup_t friends[MAX_FRIEND];
*nfriend = pickup_myfriend(friends, myfriend, friendme, badfriend);
@@ -1626,7 +1633,6 @@ pickup(pickup_t * currpickup, int pickup_way, int *page,
else
*bfriend = 0;
*nfriend += *bfriend;
- which = *page * nPickups;
if (*nfriend > which) {
/* ¥u¦³¦b­n¨q¥X¤~¦³¥²­n sort */
qsort(friends, *nfriend, sizeof(pickup_t), sort_cmpfriend);