From af7aaa84440fcfa9c3b51be51a454336eab610c0 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 6 Apr 2008 12:04:25 -0500 Subject: [PATCH] fix whois :) --- include/client.h | 5 ++++- include/numeric.h | 2 ++ modules/m_whois.c | 4 ++++ src/messages.tab | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/client.h b/include/client.h index ead280e9..d5d15f50 100644 --- a/include/client.h +++ b/include/client.h @@ -449,7 +449,7 @@ struct exit_client_hook /* user information flags, only settable by remote mode or local oper */ #define UMODE_OPER 0x100000 /* Operator */ #define UMODE_ADMIN 0x200000 /* Admin on server */ -#define UMODE_SSLCLIENT 0x400000 /* using SSL */ +#define UMODE_SSLCLIENT 0x1000000 /* using SSL */ #define UMODE_ALL UMODE_SERVNOTICE @@ -531,6 +531,9 @@ struct exit_client_hook #define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE) #define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE) #define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE) +#define IsSSLClient(x) ((x)->umodes & UMODE_SSLCLIENT) +#define SetSSLClient(x) ((x)->umodes |= UMODE_SSLCLIENT) +#define ClearSSLClient(x) ((x)->umodes &= ~UMODE_SSLCLIENT) #define SendWallops(x) ((x)->umodes & UMODE_WALLOP) #define SendLocops(x) ((x)->umodes & UMODE_LOCOPS) #define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE) diff --git a/include/numeric.h b/include/numeric.h index c5350086..af9435d0 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -307,6 +307,8 @@ extern const char *form_str(int); #define ERR_HELPNOTFOUND 524 +#define RPL_WHOISSECURE 671 /* Unreal3.2 --nenolod */ + #define RPL_MODLIST 702 #define RPL_ENDOFMODLIST 703 diff --git a/modules/m_whois.c b/modules/m_whois.c index 868d199c..53b4b250 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -327,6 +327,10 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) GlobalSetOptions.operstring)); } + if(IsSSLClient(target_p)) + sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE), + target_p->name); + if(MyClient(target_p)) { if (IsDynSpoof(target_p) && (IsOper(source_p) || source_p == target_p)) diff --git a/src/messages.tab b/src/messages.tab index 0c978365..be7ef806 100644 --- a/src/messages.tab +++ b/src/messages.tab @@ -692,7 +692,7 @@ static const char * replies[] = { /* 668 */ NULL, /* 669 */ NULL, /* 670 */ NULL, -/* 671 */ NULL, +/* 671 RPL_WHOISSECURE, */ "%s :is using a secure connection", /* 672 */ NULL, /* 673 */ NULL, /* 674 */ NULL,