X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/6faf3f4d40993bf22b734579569c16b0617cba04..3e06a4c8031a0143a4f017ce2d9262a8bd43be6c:/modules/m_whois.c diff --git a/modules/m_whois.c b/modules/m_whois.c index 333c86a..476a959 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -242,6 +242,11 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) int extra_space = 0; int i; char *m; + int showsecret = 0; + struct Metadata *md; + + if(ConfigFileEntry.secret_channels_in_whois && IsOperSpy(source_p)) + showsecret = 1; if(target_p->user == NULL) { @@ -281,7 +286,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) visible = ShowChannel(source_p, chptr); - if(visible || operspy) + if(visible || operspy || showsecret) { if((cur_len + strlen(chptr->chname) + 3) > (BUFSIZE - 5)) { @@ -291,7 +296,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) } tlen = rb_sprintf(t, "%s%s%s ", - visible ? "" : "!", + visible ? "" : "*", find_channel_status(msptr, 1), chptr->chname); t += tlen; @@ -318,6 +323,8 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) IsService(target_p) ? ConfigFileEntry.servicestring : (IsAdmin(target_p) ? GlobalSetOptions.adminstring : GlobalSetOptions.operstring)); + if(md = user_metadata_find(target_p, "SWHOIS")) + sendto_one_numeric(source_p, 320, "%s :%s", target_p->name, md->value); } if(IsSSLClient(target_p))