]> jfr.im git - solanum.git/blobdiff - modules/m_whowas.c
m_whois: show services even if they lack opernames
[solanum.git] / modules / m_whowas.c
index 929334bb175a3e661649bf8c380b5dd10a7dbc21..1566f4021b17558e21648d2520c989d839e65916 100644 (file)
@@ -25,7 +25,6 @@
 #include "stdinc.h"
 #include "whowas.h"
 #include "client.h"
-#include "common.h"
 #include "hash.h"
 #include "match.h"
 #include "ircd.h"
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
+#include "s_newconf.h"
 
-static int m_whowas(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char whowas_desc[] =
+       "Provides the WHOWAS command to display information on a disconnected user";
+
+static void m_whowas(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message whowas_msgtab = {
        "WHOWAS", 0, 0, 0, 0,
@@ -47,13 +50,14 @@ struct Message whowas_msgtab = {
 };
 
 mapi_clist_av1 whowas_clist[] = { &whowas_msgtab, NULL };
-DECLARE_MODULE_AV1(whowas, NULL, NULL, whowas_clist, NULL, NULL, "$Revision: 1717 $");
+
+DECLARE_MODULE_AV2(whowas, NULL, NULL, whowas_clist, NULL, NULL, NULL, NULL, whowas_desc);
 
 /*
 ** m_whowas
 **      parv[1] = nickname queried
 */
-static int
+static void
 m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        rb_dlink_list *whowas_list;
@@ -67,7 +71,7 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
 
        static time_t last_used = 0L;
 
-       if(MyClient(source_p) && !IsOper(source_p))
+       if(MyClient(source_p) && !IsOperGeneral(source_p))
        {
                if(last_used + (parc > 3 ? ConfigFileEntry.pace_wait :
                                                ConfigFileEntry.pace_wait_simple
@@ -77,7 +81,7 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
                                   me.name, source_p->name, "WHOWAS");
                        sendto_one_numeric(source_p, RPL_ENDOFWHOWAS, form_str(RPL_ENDOFWHOWAS),
                                   parv[1]);
-                       return 0;
+                       return;
                }
                else
                        last_used = rb_current_time();
@@ -89,7 +93,7 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
 
        if(parc > 3)
                if(hunt_server(client_p, source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv))
-                       return 0;
+                       return;
 
        if(!MyClient(source_p) && (max <= 0 || max > 20))
                max = 20;
@@ -106,7 +110,7 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
        {
                sendto_one_numeric(source_p, ERR_WASNOSUCHNICK, form_str(ERR_WASNOSUCHNICK), nick);
                sendto_one_numeric(source_p, RPL_ENDOFWHOWAS, form_str(RPL_ENDOFWHOWAS), parv[1]);
-               return 0;
+               return;
        }
 
        RB_DLINK_FOREACH(ptr, whowas_list->head)
@@ -145,5 +149,4 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
        }
 
        sendto_one_numeric(source_p, RPL_ENDOFWHOWAS, form_str(RPL_ENDOFWHOWAS), parv[1]);
-       return 0;
 }