summaryrefslogtreecommitdiffstats
path: root/mbbsd/talk.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-31 01:37:06 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-31 01:37:06 +0800
commitb8b27d2bcd895e8414dcd8665fe50f3ad82feab4 (patch)
tree370093d0e11d448d0f0b2fe13107d31aa356fc6e /mbbsd/talk.c
parentb3f1cdca4c85eb441129a0798f5cdea14852f439 (diff)
downloadpttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar.gz
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar.bz2
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar.lz
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar.xz
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.tar.zst
pttbbs-b8b27d2bcd895e8414dcd8665fe50f3ad82feab4.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@256 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r--mbbsd/talk.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 2ba53be4..e0cbefea 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.49 2002/05/30 15:53:28 lwms Exp $ */
+/* $Id: talk.c,v 1.50 2002/05/30 17:37:06 ptt Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -1750,6 +1750,21 @@ static void draw_pickup(int drawall, pickup_t *pickup, int pickup_way,
}
}
+int call_in(userinfo_t *uentp, int fri_stat)
+{
+ char genbuf[60];
+ if( HAS_PERM(PERM_LOGINOK) &&
+ uentp->pid != currpid &&
+ strcmp(uentp->userid, cuser.userid) != 0 &&
+ (HAS_PERM(PERM_SYSOP) ||
+ (uentp->pager != 3 &&
+ (fri_stat & HFM || uentp->pager != 4))) ){
+ sprintf(genbuf, "Call-In %s :", uentp->userid);
+ my_write(uentp->pid, genbuf, uentp->userid, 0, NULL);
+ return 1;
+ }
+ return 0;
+}
static void userlist(void)
{
/* 使用者名單:
@@ -2040,7 +2055,7 @@ static void userlist(void)
*ans == 'n')
break;
if( HAS_PERM(PERM_SYSOP) ){
- for( i = 0 ; i < utmpshm->number ; ++i ){
+ for( i = 0 ; i < utmpshm->number && i<1000 ; ++i ){
uentp = utmpshm->sorted[utmpshm->currsorted][0][i];
if( uentp->pid && kill(uentp->pid, 0) != -1 )
my_write(uentp->pid, genbuf,
@@ -2127,19 +2142,9 @@ static void userlist(void)
break;
case 'w':
- if( HAS_PERM(PERM_LOGINOK) &&
- uentp->pid != currpid &&
- strcmp(uentp->userid, cuser.userid) != 0 &&
- (HAS_PERM(PERM_SYSOP) ||
- (uentp->pager != 3 &&
- (fri_stat & HFM || uentp->pager != 4))) ){
- cursor_show(offset + 3, 0);
- sprintf(genbuf, "Call-In %s :", uentp->userid);
- my_write(uentp->pid, genbuf, uentp->userid, 0, NULL);
- redrawall = redraw = 1;
- }
+ if(call_in(uentp,fri_stat))
+ redrawall = redraw = 1;
break;
-
case 'a':
if( HAS_PERM(PERM_LOGINOK) ){
friend_add(uentp->userid, FRIEND_OVERRIDE);