]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_accept.c
Add helpfiles for all extensions that provide commands.
[irc/rqf/shadowircd.git] / modules / m_accept.c
index cc5a8eb11979f60f3b87059f2083588488b88de7..07c2227dd4d57fe582dc715fac39b2118ec22785 100644 (file)
@@ -34,7 +34,6 @@
 #include "send.h"
 #include "msg.h"
 #include "parse.h"
-#include "sprintf_irc.h"
 #include "modules.h"
 
 static int m_accept(struct Client *, struct Client *, int, const char **);
@@ -55,7 +54,6 @@ DECLARE_MODULE_AV1(accept, NULL, NULL, accept_clist, NULL, NULL, "$Revision: 254
 
 /*
  * m_accept - ACCEPT command handler
- *      parv[0] = sender prefix
  *      parv[1] = servername
  */
 static int
@@ -77,7 +75,7 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char
        build_nicklist(source_p, addbuf, delbuf, parv[1]);
 
        /* parse the delete list */
-       for (nick = strtoken(&p, delbuf, ","); nick != NULL; nick = strtoken(&p, NULL, ","))
+       for (nick = rb_strtok_r(delbuf, ",", &p); nick != NULL; nick = rb_strtok_r(NULL, ",", &p))
        {
                /* shouldnt happen, but lets be paranoid */
                if((target_p = find_named_person(nick)) == NULL)
@@ -95,15 +93,15 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char
                        continue;
                }
 
-               dlinkFindDestroy(target_p, &source_p->localClient->allow_list);
-               dlinkFindDestroy(source_p, &target_p->on_allow_list);
+               rb_dlinkFindDestroy(target_p, &source_p->localClient->allow_list);
+               rb_dlinkFindDestroy(source_p, &target_p->on_allow_list);
        }
 
        /* get the number of accepts they have */
        accept_num = rb_dlink_list_length(&source_p->localClient->allow_list);
 
        /* parse the add list */
-       for (nick = strtoken(&p, addbuf, ","); nick; nick = strtoken(&p, NULL, ","))
+       for (nick = rb_strtok_r(addbuf, ",", &p); nick; nick = rb_strtok_r(NULL, ",", &p), accept_num++)
        {
                /* shouldnt happen, but lets be paranoid */
                if((target_p = find_named_person(nick)) == NULL)
@@ -130,7 +128,6 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char
                /* why is this here? */
                /* del_from accept(target_p, source_p); */
                add_accept(source_p, target_p);
-               accept_num++;
        }
 
        return 0;
@@ -154,14 +151,13 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char *
        int lenadd;
        int lendel;
        int del;
-       struct Client *target_p;
        char *n = LOCAL_COPY(nicks);
 
        *addbuf = *delbuf = '\0';
        del = lenadd = lendel = 0;
 
        /* build list of clients to add into addbuf, clients to remove in delbuf */
-       for (name = strtoken(&p, n, ","); name; name = strtoken(&p, NULL, ","), del = 0)
+       for (name = rb_strtok_r(n, ",", &p); name; name = rb_strtok_r(NULL, ",", &p), del = 0)
        {
                if(*name == '-')
                {
@@ -169,7 +165,7 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char *
                        name++;
                }
 
-               if((target_p = find_named_person(name)) == NULL)
+               if(find_named_person(name) == NULL)
                {
                        sendto_one_numeric(source_p, ERR_NOSUCHNICK, 
                                           form_str(ERR_NOSUCHNICK), name);
@@ -208,8 +204,8 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char *
 static void
 add_accept(struct Client *source_p, struct Client *target_p)
 {
-       dlinkAddAlloc(target_p, &source_p->localClient->allow_list);
-       dlinkAddAlloc(source_p, &target_p->on_allow_list);
+       rb_dlinkAddAlloc(target_p, &source_p->localClient->allow_list);
+       rb_dlinkAddAlloc(source_p, &target_p->on_allow_list);
 }
 
 
@@ -249,7 +245,7 @@ list_accepts(struct Client *source_p)
                                *nicks = '\0';
                        }
 
-                       len += ircsnprintf(nicks + len, sizeof(nicks) - len, "%s ", target_p->name);
+                       len += rb_snprintf(nicks + len, sizeof(nicks) - len, "%s ", target_p->name);
                        count++;
                }
        }