]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_whois.c
Add some ircd-seven love to CREDITS.
[irc/rqf/shadowircd.git] / modules / m_whois.c
index b37a4dae3bdc6de153b49a2a642f2c4d22a17e4c..ed0d79982d9645b87613c3d02f4402d6906c57c3 100644 (file)
@@ -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))
                                {
@@ -313,11 +318,16 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
 
        if(IsOper(target_p))
        {
-               sendto_one_numeric(source_p, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
-                                  target_p->name,
-                                  IsService(target_p) ? ConfigFileEntry.servicestring :
-                                  (IsAdmin(target_p) ? GlobalSetOptions.adminstring :
-                                   GlobalSetOptions.operstring));
+               if(md = user_metadata_find(target_p, "OPERSTRING"))
+                       sendto_one_numeric(source_p, 313, "%s :%s", target_p->name, md->value);
+               else
+                       sendto_one_numeric(source_p, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
+                                       target_p->name,
+                                       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))