From d461358bf1c0f776b796a35afb25848748655edc Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 4 May 2002 02:43:36 +0000 Subject: [PATCH] * Make stealth mode available to all users * <.W>holist tealth mode command in the client --- citadel/citadel.c | 4 ++++ citadel/citadel.rc | 1 + citadel/client_chat.c | 32 ++++++++++++++++++++++++++++++++ citadel/client_chat.h | 1 + citadel/help/summary | 2 ++ citadel/serv_chat.c | 10 ++++------ citadel/serv_rwho.c | 22 ++++++++++------------ 7 files changed, 54 insertions(+), 18 deletions(-) diff --git a/citadel/citadel.c b/citadel/citadel.c index 09961d8eb..cf8e5b5ce 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1612,6 +1612,10 @@ PWOK: quiet_mode(); break; + case 93: + stealth_mode(); + break; + case 50: enter_config(2); break; diff --git a/citadel/citadel.rc b/citadel/citadel.rc index 6f0fb0a44..6721f8a5d 100644 --- a/citadel/citadel.rc +++ b/citadel/citadel.rc @@ -301,6 +301,7 @@ cmd=79,0,&.,&Wholist,&Long cmd=75,0,&.,&Wholist,&Roomname cmd=76,0,&.,&Wholist,&Hostname cmd=91,0,&.,&Wholist,&Active +cmd=93,0,&.,&Wholist,&Stealth mode # # Command 69 allows the user to enter a server command directly. It is diff --git a/citadel/client_chat.c b/citadel/client_chat.c index 7c4b02c56..b5d867fe4 100644 --- a/citadel/client_chat.c +++ b/citadel/client_chat.c @@ -314,3 +314,35 @@ void quiet_mode(void) scr_printf("Quiet mode disabled (other users may page you)\n"); } } + + +void stealth_mode(void) +{ + int qstate; + char buf[SIZ]; + + serv_puts("STEL 2"); + serv_gets(buf); + if (buf[0] != '2') { + scr_printf("%s\n", &buf[4]); + return; + } + qstate = atoi(&buf[4]); + if (qstate == 0) + qstate = 1; + else + qstate = 0; + snprintf(buf, sizeof buf, "STEL %d", qstate); + serv_puts(buf); + serv_gets(buf); + if (buf[0] != '2') { + scr_printf("%s\n", &buf[4]); + return; + } + qstate = atoi(&buf[4]); + if (qstate) { + scr_printf("Stealth mode enabled (you are invisible)\n"); + } else { + scr_printf("Stealth mode disabled (you are listed as online)\n"); + } +} diff --git a/citadel/client_chat.h b/citadel/client_chat.h index 927cd4f40..2c427692a 100644 --- a/citadel/client_chat.h +++ b/citadel/client_chat.h @@ -2,5 +2,6 @@ void chatmode(void); void page_user(void); void quiet_mode(void); +void stealth_mode(void); extern char last_paged[]; diff --git a/citadel/help/summary b/citadel/help/summary index 94ff37a79..d951fbd7f 100644 --- a/citadel/help/summary +++ b/citadel/help/summary @@ -76,6 +76,8 @@ commands are available: actual name of the room you're in) <.> holist ostname Masquerade your host name <.> nter sername Masquerade your user name (Aides only) + <.> holist tealth mode Enter/exit "stealth mode" (when in stealth + mode you are invisible on the wholist) Floor commands (if using floor mode) diff --git a/citadel/serv_chat.c b/citadel/serv_chat.c index 99732cf55..d8cbc80a6 100644 --- a/citadel/serv_chat.c +++ b/citadel/serv_chat.c @@ -702,18 +702,16 @@ void cmd_dexp(char *argbuf) { int new_state; - if (!CC->logged_in) { - cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN); - return; - } + if (CtdlAccessCheck(ac_logged_in)) return; new_state = extract_int(argbuf, 0); if ((new_state == 0) || (new_state == 1)) { CC->disable_exp = new_state; - } - cprintf("%d %d\n", CIT_OK, CC->disable_exp); } + cprintf("%d %d\n", CIT_OK, CC->disable_exp); +} + /* * Request client termination diff --git a/citadel/serv_rwho.c b/citadel/serv_rwho.c index bdfec24fd..0da0e3f42 100644 --- a/citadel/serv_rwho.c +++ b/citadel/serv_rwho.c @@ -232,22 +232,20 @@ void cmd_stel(char *cmdbuf) int requested_mode; requested_mode = extract_int(cmdbuf,0); - if (requested_mode !=0) requested_mode = 1; - if (CtdlAccessCheck(ac_aide)) return; - - if (CC->cs_flags & CS_STEALTH) { - if (requested_mode == 0) - CC->cs_flags = CC->cs_flags-CS_STEALTH; - } - else { - if (requested_mode == 1) - CC->cs_flags = CC->cs_flags|CS_STEALTH; - } + if (CtdlAccessCheck(ac_logged_in)) return; - cprintf("%d Ok\n",CIT_OK); + if (requested_mode == 1) { + CC->cs_flags = CC->cs_flags | CS_STEALTH; + } + if (requested_mode == 0) { + CC->cs_flags = CC->cs_flags & ~CS_STEALTH; } + cprintf("%d %d\n", CIT_OK, + ((CC->cs_flags & CS_STEALTH) ? 1 : 0) ); +} + -- 2.30.2