]> jfr.im git - solanum.git/blobdiff - modules/m_whois.c
override: only engage override code if we're needing to authorize a WRITE to a channe...
[solanum.git] / modules / m_whois.c
index 65b169b0f2169bbca787b1426a6f56460c89d04e..a5515ed0934619eae193d6a0115b85b182ad2165 100644 (file)
@@ -45,6 +45,7 @@
 #include "s_newconf.h"
 #include "ipv4_from_ipv6.h"
 #include "ratelimit.h"
+#include "s_assert.h"
 
 static void do_whois(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 static void single_whois(struct Client *source_p, struct Client *target_p, int operspy);
@@ -94,7 +95,7 @@ m_whois(struct Client *client_p, struct Client *source_p, int parc, const char *
                        {
                                sendto_one(source_p, form_str(RPL_LOAD2HI),
                                           me.name, source_p->name, "WHOIS");
-                               sendto_one_numeric(source_p, RPL_ENDOFWHOIS, 
+                               sendto_one_numeric(source_p, RPL_ENDOFWHOIS,
                                                   form_str(RPL_ENDOFWHOIS), parv[2]);
                                return 0;
                        }
@@ -139,18 +140,18 @@ ms_whois(struct Client *client_p, struct Client *source_p, int parc, const char
        if((target_p = find_client(parv[1])) == NULL)
        {
                sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-                                  form_str(ERR_NOSUCHSERVER), 
+                                  form_str(ERR_NOSUCHSERVER),
                                   IsDigit(parv[1][0]) ? "*" : parv[1]);
                return 0;
        }
 
        /* if parv[1] isnt my client, or me, someone else is supposed
-        * to be handling the request.. so send it to them 
+        * to be handling the request.. so send it to them
         */
        if(!MyClient(target_p) && !IsMe(target_p))
        {
-               sendto_one(target_p, ":%s WHOIS %s :%s", 
-                          get_id(source_p, target_p), 
+               sendto_one(target_p, ":%s WHOIS %s :%s",
+                          get_id(source_p, target_p),
                           get_id(target_p, target_p), parv[2]);
                return 0;
        }
@@ -167,8 +168,8 @@ ms_whois(struct Client *client_p, struct Client *source_p, int parc, const char
 
 /* do_whois
  *
- * inputs      - pointer to 
- * output      - 
+ * inputs      - pointer to
+ * output      -
  * side effects -
  */
 static void
@@ -206,10 +207,10 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char
        }
        else
                sendto_one_numeric(source_p, ERR_NOSUCHNICK,
-                                  form_str(ERR_NOSUCHNICK), 
+                                  form_str(ERR_NOSUCHNICK),
                                   nick);
 
-       sendto_one_numeric(source_p, RPL_ENDOFWHOIS, 
+       sendto_one_numeric(source_p, RPL_ENDOFWHOIS,
                           form_str(RPL_ENDOFWHOIS), parv[1]);
        return;
 }
@@ -248,11 +249,11 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
        }
 
        sendto_one_numeric(source_p, RPL_WHOISUSER, form_str(RPL_WHOISUSER),
-                          target_p->name, target_p->username, 
+                          target_p->name, target_p->username,
                           target_p->host, target_p->info);
 
-       cur_len = mlen = rb_sprintf(buf, form_str(RPL_WHOISCHANNELS), 
-                                   get_id(&me, source_p), get_id(source_p, source_p), 
+       cur_len = mlen = rb_sprintf(buf, form_str(RPL_WHOISCHANNELS),
+                                   get_id(&me, source_p), get_id(source_p, source_p),
                                    target_p->name);
 
        /* Make sure it won't overflow when sending it to the client
@@ -361,9 +362,9 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
 #endif /* RB_IPV6 */
 
                sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
-                                  target_p->name, 
-                                  rb_current_time() - target_p->localClient->last, 
-                                  target_p->localClient->firsttime);
+                                  target_p->name,
+                                  (long)(rb_current_time() - target_p->localClient->last),
+                                  (unsigned long)target_p->localClient->firsttime);
        }
        else
        {
@@ -382,7 +383,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
                        sendto_one_numeric(source_p, RPL_WHOISACTUALLY,
                                           form_str(RPL_WHOISACTUALLY),
                                           target_p->name, target_p->sockhost);
-                       
+
                }
        }