]> jfr.im git - solanum.git/blobdiff - modules/m_whowas.c
m_info: Correct description of general::client_exit like in example confs.
[solanum.git] / modules / m_whowas.c
index 5ad67dfd3132642b29fd1c09aaa9b10c4fbf05fc..eb32ede286908426cdfdd5a26bb785c8c9b1b68b 100644 (file)
@@ -53,7 +53,6 @@ DECLARE_MODULE_AV1(whowas, NULL, NULL, whowas_clist, NULL, NULL, "$Revision: 171
 
 /*
 ** m_whowas
-**      parv[0] = sender prefix
 **      parv[1] = nickname queried
 */
 static int
@@ -65,6 +64,7 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
        char *p;
        const char *nick;
        char tbuf[26];
+       long sendq_limit;
 
        static time_t last_used = 0L;
 
@@ -97,12 +97,20 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
 
        nick = parv[1];
 
+       sendq_limit = get_sendq(client_p) * 9 / 10;
+
        temp = WHOWASHASH[hash_whowas_name(nick)];
        found = 0;
        for (; temp; temp = temp->next)
        {
                if(!irccmp(nick, temp->name))
                {
+                       if(cur > 0 && rb_linebuf_len(&client_p->localClient->buf_sendq) > sendq_limit)
+                       {
+                               sendto_one(source_p, form_str(ERR_TOOMANYMATCHES),
+                                          me.name, source_p->name, "WHOWAS");
+                               break;
+                       }
                        sendto_one(source_p, form_str(RPL_WHOWASUSER),
                                   me.name, source_p->name, temp->name,
                                   temp->username, temp->hostname, temp->realname);
@@ -116,6 +124,10 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
                                                   form_str(RPL_WHOISACTUALLY),
                                                   temp->name, temp->sockhost);
 #endif
+                       if (!EmptyString(temp->suser))
+                               sendto_one_numeric(source_p, RPL_WHOISLOGGEDIN,
+                                                  "%s %s :was logged in as",
+                                                  temp->name, temp->suser);
                        sendto_one_numeric(source_p, RPL_WHOISSERVER,
                                           form_str(RPL_WHOISSERVER),
                                           temp->name, temp->servername,