]> jfr.im git - solanum.git/blobdiff - extensions/m_findforwards.c
Stop using chm_nosuch as a sentinel value (#53)
[solanum.git] / extensions / m_findforwards.c
index 09a655193e0e85d12eea36d9077f8c367666d8f4..9be22defa9fab444d1410a2ad465559b65058b95 100644 (file)
@@ -34,7 +34,9 @@
 #include "packet.h"
 #include "messages.h"
 
-static int m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
+static const char findfowards_desc[] = "Allows operators to find forwards to a given channel";
+
+static void m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                        int parc, const char *parv[]);
 
 struct Message findforwards_msgtab = {
@@ -44,13 +46,13 @@ struct Message findforwards_msgtab = {
 
 mapi_clist_av1 findforwards_clist[] = { &findforwards_msgtab, NULL };
 
-DECLARE_MODULE_AV2(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, NULL, NULL, NULL);
+DECLARE_MODULE_AV2(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, NULL, NULL, findfowards_desc);
 
 /*
 ** mo_findforwards
 **      parv[1] = channel
 */
-static int
+static void
 m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static time_t last_used = 0;
@@ -62,27 +64,27 @@ m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
        *p = '\0';
 
        /* Allow ircops to search for forwards to nonexistent channels */
-       if(!IsOper(source_p))
+       if(!IsOperGeneral(source_p))
        {
                if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL)
                {
                        sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
                                        form_str(ERR_NOTONCHANNEL), parv[1]);
-                       return 0;
+                       return;
                }
 
                if(!is_chanop(msptr))
                {
                        sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
                                        me.name, source_p->name, parv[1]);
-                       return 0;
+                       return;
                }
 
                if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
                {
                        sendto_one(source_p, form_str(RPL_LOAD2HI),
                                        me.name, source_p->name, "FINDFORWARDS");
-                       return 0;
+                       return;
                }
                else
                        last_used = rb_current_time();
@@ -109,6 +111,4 @@ m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
                *(--p) = '\0';
 
        sendto_one_notice(source_p, ":Forwards for %s: %s", parv[1], buf);
-
-       return 0;
 }