diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-11-08 17:51:38 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-11-08 17:51:38 +0000 |
commit | ac7f555ff35a091d8a641f6795d15ed059508339 (patch) | |
tree | 1cd1c5771ae63174db8c318767a041e54d68ffd7 | |
parent | 040365d88ab2187347e94fa561e7887f140f7fff (diff) |
- Administrators are now able to see user modes a user has set via /whois
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2530 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | include/numeric.h | 1 | ||||
-rw-r--r-- | modules/m_whois.c | 16 | ||||
-rw-r--r-- | src/numeric.c | 2 |
4 files changed, 21 insertions, 2 deletions
@@ -3,9 +3,11 @@ o) Added usermode +W. Users connected via a webirc gateway get this mode set by servers. o) /WHOIS now shows if a client is connected via a webirc gateway -o) Admins may now see +s channels a user is in with /WHOIS. +o) Administrators may now see +s channels a user is in with /WHOIS. Secret channels are prepended with a tilde in the /WHOIS reply. +o) Administrators are now able to see all the user modes a user has + set via /whois -- ircd-hybrid-8.1.8 Release Notes diff --git a/include/numeric.h b/include/numeric.h index abdcd5e..f247719 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -119,6 +119,7 @@ extern const char *form_str(unsigned int); #define RPL_WHOISREGNICK 307 #define RPL_WHOISADMIN 308 +#define RPL_WHOISMODES 310 #define RPL_WHOISUSER 311 #define RPL_WHOISSERVER 312 #define RPL_WHOISOPERATOR 313 diff --git a/modules/m_whois.c b/modules/m_whois.c index e01901b..95ee280 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -33,6 +33,7 @@ #include "conf.h" #include "s_misc.h" #include "s_serv.h" +#include "s_user.h" #include "send.h" #include "irc_string.h" #include "parse.h" @@ -134,6 +135,21 @@ whois_person(struct Client *source_p, struct Client *target_p) me.name, source_p->name, target_p->name, "User connected using a webirc gateway"); + if (HasUMode(source_p, UMODE_ADMIN) || source_p == target_p) + { + unsigned int i = 0; + char *m = buf; + *m++ = '+'; + + for (i = 0; i < 128; ++i) + if (HasUMode(target_p, user_modes[i])) + *m++ = (char)i; + *m = '\0'; + + sendto_one(source_p, form_str(RPL_WHOISMODES), me.name, + source_p->name, target_p->name, buf); + } + if (target_p->sockhost[0] && strcmp(target_p->sockhost, "0")) { if (HasUMode(source_p, UMODE_ADMIN) || source_p == target_p) diff --git a/src/numeric.c b/src/numeric.c index 6bd7883..af850c0 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -337,7 +337,7 @@ static const char *const replies[] = { /* 307 RPL_WHOISREGNICK */ ":%s 307 %s %s :has identified for this nick", /* 308 RPL_WHOISADMIN */ ":%s 313 %s %s :is a Server Administrator", /* 309 */ NULL, -/* 310 */ NULL, +/* 310 RPL_WHOISMODES */ ":%s 310 %s %s :is using modes %s", /* 311 RPL_WHOISUSER */ ":%s 311 %s %s %s %s * :%s", /* 312 RPL_WHOISSERVER */ ":%s 312 %s %s %s :%s", /* 313 RPL_WHOISOPERATOR */ ":%s 313 %s %s :is an IRC Operator", |