From 8e1d5dc85591c3d290d340c7bf1a10f0bf85b8a3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 25 Feb 2000 06:14:06 +0000 Subject: [PATCH] * Modularized the RWHO (Read WHO is online) command, basically as a pilot for modularizing all "non-API" functionality. --- citadel/ChangeLog | 5 +++ citadel/Makefile.in | 9 ++++- citadel/citserver.c | 92 +-------------------------------------------- citadel/citserver.h | 4 +- citadel/room_ops.c | 4 +- citadel/serv_chat.h | 1 - 6 files changed, 18 insertions(+), 97 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index b66ee38d1..10957e74d 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 1.469 2000/02/25 06:14:05 ajc +* Modularized the RWHO (Read WHO is online) command, basically as a pilot + for modularizing all "non-API" functionality. + Revision 1.468 2000/02/24 03:44:00 ajc * Implemented holdoff time (15 minutes) for SMTP send retry. * Implemented "try for 3 days and then give up" on SMTP send. @@ -1658,3 +1662,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 02e401d15..7daefb1d8 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -29,6 +29,7 @@ SERV_MODULES=modules/serv_chat$(SO) modules/serv_vcard$(SO) \ modules/serv_upgrade$(SO) \ modules/serv_smtp$(SO) modules/serv_pop3$(SO) \ modules/serv_inetcfg$(SO) \ + modules/serv_rwho$(SO) \ modules/serv_expire$(SO) $(SERV_ICQ) UTIL_TARGETS=aidepost netmailer netproc netsetup msgform readlog rcit \ stats citmail netpoll mailinglist userlist sendcommand \ @@ -75,7 +76,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \ whobbs.c sendcommand.c mime_parser.c base64.c qpdecode.c getutline.c \ auth.c chkpwd.c client_icq.c html.c vcard.c serv_upgrade.c \ serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \ - domain.c clientsocket.c serv_inetcfg.c + domain.c clientsocket.c serv_inetcfg.c serv_rwho.c DEP_FILES=$(SOURCES:.c=.d) @@ -149,6 +150,12 @@ modules/serv_inetcfg.so: serv_inetcfg.mo modules/serv_inetcfg.mo: serv_inetcfg.mo ln -f serv_inetcfg.mo modules +modules/serv_rwho.so: serv_rwho.mo + $(LINK_SHARED) -o modules/serv_rwho.so serv_rwho.mo + +modules/serv_rwho.mo: serv_rwho.mo + ln -f serv_rwho.mo modules + modules/serv_expire.so: serv_expire.mo $(LINK_SHARED) -o modules/serv_expire.so serv_expire.mo diff --git a/citadel/citserver.c b/citadel/citserver.c index 5e508ec56..bcba39ebc 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -371,7 +371,7 @@ void cmd_uchg(char *argbuf) * returns an asterisk if there are any express messages waiting, * space otherwise. */ -char check_express(void) { +char CtdlCheckExpress(void) { if (CC->FirstExpressMessage == NULL) { return(' '); } @@ -659,90 +659,6 @@ void GenerateRoomDisplay(char *real_room, } -/* - * who's online - */ -void cmd_rwho(void) { - struct CitContext *cptr; - int spoofed = 0; - int aide; - char un[40]; - char real_room[ROOMNAMELEN], room[ROOMNAMELEN]; - char host[40], flags[5]; - - aide = CC->usersupp.axlevel >= 6; - cprintf("%d%c \n", LISTING_FOLLOWS, check_express() ); - - for (cptr = ContextList; cptr != NULL; cptr = cptr->next) - { - flags[0] = '\0'; - spoofed = 0; - - if (cptr->cs_flags & CS_POSTING) - strcat(flags, "*"); - else - strcat(flags, "."); - - if (cptr->fake_username[0]) - { - strcpy(un, cptr->fake_username); - spoofed = 1; - } - else - strcpy(un, cptr->curr_user); - - if (cptr->fake_hostname[0]) - { - strcpy(host, cptr->fake_hostname); - spoofed = 1; - } - else - strcpy(host, cptr->cs_host); - - GenerateRoomDisplay(real_room, cptr, CC); - - if (cptr->fake_roomname[0]) { - strcpy(room, cptr->fake_roomname); - spoofed = 1; - } - else { - strcpy(room, real_room); - } - - if ((aide) && (spoofed)) - strcat(flags, "+"); - - if ((cptr->cs_flags & CS_STEALTH) && (aide)) - strcat(flags, "-"); - - if (((cptr->cs_flags&CS_STEALTH)==0) || (aide)) - { - cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n", - cptr->cs_pid, un, room, - host, cptr->cs_clientname, - (long)(cptr->lastidle), - cptr->lastcmdname, flags); - } - if ((spoofed) && (aide)) - { - cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n", - cptr->cs_pid, cptr->curr_user, - real_room, - cptr->cs_host, cptr->cs_clientname, - (long)(cptr->lastidle), - cptr->lastcmdname, flags); - - } - } - - /* Now it's magic time. Before we finish, call any EVT_RWHO hooks - * so that external paging modules such as serv_icq can add more - * content to the Wholist. - */ - PerformSessionHooks(EVT_RWHO); - cprintf("000\n"); - } - /* * Terminate another running session @@ -973,7 +889,7 @@ void do_command_loop(void) { } if (!strncasecmp(cmdbuf,"NOOP",4)) { - cprintf("%d%cok\n",OK,check_express()); + cprintf("%d%cok\n",OK,CtdlCheckExpress()); } else if (!strncasecmp(cmdbuf,"QUIT",4)) { @@ -1170,10 +1086,6 @@ void do_command_loop(void) { cmd_netf(&cmdbuf[5]); } - else if (!strncasecmp(cmdbuf,"RWHO",4)) { - cmd_rwho(); - } - else if (!strncasecmp(cmdbuf,"OPEN",4)) { cmd_open(&cmdbuf[5]); } diff --git a/citadel/citserver.h b/citadel/citserver.h index e4f772d65..9724a6428 100644 --- a/citadel/citserver.h +++ b/citadel/citserver.h @@ -14,7 +14,6 @@ void cmd_iden (char *argbuf); void cmd_stel (char *cmdbuf); void cmd_mesg (char *mname); void cmd_emsg (char *mname); -void cmd_rwho (void); void cmd_term (char *cmdbuf); void cmd_more (void); void cmd_echo (char *etext); @@ -34,6 +33,5 @@ void citproto_begin_session(void); void GenerateRoomDisplay(char *real_room, struct CitContext *viewed, struct CitContext *viewer); - - extern int do_defrag; +char CtdlCheckExpress(void); diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 61315accc..2fadd7f18 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -680,7 +680,7 @@ void usergoto(char *where, int display_result) if (display_result) cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d\n", - OK, check_express(), + OK, CtdlCheckExpress(), truncated_roomname, new_messages, total_messages, info, CC->quickroom.QRflags, @@ -896,7 +896,7 @@ void cmd_getr(void) } getroom(&CC->quickroom, CC->quickroom.QRname); cprintf("%d%c%s|%s|%s|%d|%d|%d\n", - OK, check_express(), + OK, CtdlCheckExpress(), CC->quickroom.QRname, ((CC->quickroom.QRflags & QR_PASSWORDED) ? CC->quickroom.QRpasswd : ""), ((CC->quickroom.QRflags & QR_DIRECTORY) ? CC->quickroom.QRdirname : ""), diff --git a/citadel/serv_chat.h b/citadel/serv_chat.h index d7fd9847f..855b9ac38 100644 --- a/citadel/serv_chat.h +++ b/citadel/serv_chat.h @@ -5,7 +5,6 @@ t_context *find_context (char **unstr); void do_chat_listing (int allflag); void cmd_chat (char *argbuf); void cmd_pexp (char *argbuf); /* arg unused */ -char check_express (void); void cmd_sexp (char *argbuf); void delete_express_messages(void); void cmd_gexp(char *); -- 2.30.2