From 72ad5c04fe9d122492425996c87bb9d925fc9f30 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 28 Dec 2015 01:33:09 -0600 Subject: [PATCH] whois: list active operator block and privset when appropriate --- include/messages.h | 1 + include/numeric.h | 1 + modules/m_whois.c | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/include/messages.h b/include/messages.h index f7806949..f8bd3477 100644 --- a/include/messages.h +++ b/include/messages.h @@ -97,6 +97,7 @@ #define NUMERIC_STR_317 "%s %ld %lu :seconds idle, signon time" #define NUMERIC_STR_318 "%s :End of /WHOIS list." #define NUMERIC_STR_319 ":%s 319 %s %s :" +#define NUMERIC_STR_320 "%s: %s" #define NUMERIC_STR_321 ":%s 321 %s Channel :Users Name" #define NUMERIC_STR_322 ":%s 322 %s %s%s %lu :%s" #define NUMERIC_STR_323 ":%s 323 %s :End of /LIST" diff --git a/include/numeric.h b/include/numeric.h index 18ea7194..29ea398c 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -145,6 +145,7 @@ #define RPL_ENDOFWHOIS 318 #define RPL_WHOISCHANNELS 319 +#define RPL_WHOISSPECIAL 320 #define RPL_LISTSTART 321 #define RPL_LIST 322 diff --git a/modules/m_whois.c b/modules/m_whois.c index 1fec2246..c58f7d83 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -319,6 +319,16 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) GlobalSetOptions.operstring)); } + if(MyClient(target_p) && !EmptyString(target_p->localClient->opername) && + (IsOperAdmin(source_p) || IsAdmin(source_p) || (source_p == target_p))) + { + char buf[512]; + rb_snprintf(buf, sizeof(buf), "Opered as %s, privset %s", + target_p->localClient->opername, target_p->localClient->privset->name); + sendto_one_numeric(source_p, RPL_WHOISSPECIAL, form_str(RPL_WHOISSPECIAL), + target_p->name, buf); + } + if(IsSSLClient(target_p)) { char cbuf[256] = "is using a secure connection";