]> jfr.im git - solanum.git/blobdiff - modules/m_whowas.c
whois: bring permissions check in line with the same one in m_privs
[solanum.git] / modules / m_whowas.c
index c0f10b66a708801a099fe49322868bc2013fb33c..1e9933c65d857f67ac23ca607c1b66ca62781dfe 100644 (file)
@@ -57,7 +57,7 @@ DECLARE_MODULE_AV1(whowas, NULL, NULL, whowas_clist, NULL, NULL, "$Revision: 171
 */
 static int
 m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
-{      
+{
        struct Whowas *temp;
        int cur = 0;
        int max = -1, found = 0;
@@ -117,7 +117,9 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
                        sendto_one(source_p, form_str(RPL_WHOWASUSER),
                                   me.name, source_p->name, temp->name,
                                   temp->username, temp->hostname, temp->realname);
-                       if (MyOper(source_p) && !EmptyString(temp->sockhost))
+                       if (!EmptyString(temp->sockhost) &&
+                                       strcmp(temp->sockhost, "0") &&
+                                       show_ip_whowas(temp, source_p))
 #if 0
                                sendto_one(source_p, form_str(RPL_WHOWASREAL),
                                           me.name, source_p->name, temp->name,
@@ -143,10 +145,10 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
        }
 
        if(!found)
-               sendto_one(source_p, form_str(ERR_WASNOSUCHNICK), 
+               sendto_one(source_p, form_str(ERR_WASNOSUCHNICK),
                           me.name, source_p->name, nick);
 
-       sendto_one(source_p, form_str(RPL_ENDOFWHOWAS), 
+       sendto_one(source_p, form_str(RPL_ENDOFWHOWAS),
                   me.name, source_p->name, parv[1]);
        return 0;
 }