]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_monitor.c
Only count throttle entries that cause rejection in /stats t.
[irc/rqf/shadowircd.git] / modules / m_monitor.c
index 989c3efd46689f79bea5b9089c61976e7c3eabca..a6ce57551657b85a2bc7a085f121d2194017394c 100644 (file)
@@ -31,7 +31,6 @@
  */
 
 #include "stdinc.h"
-#include "tools.h"
 #include "client.h"
 #include "msg.h"
 #include "parse.h"
@@ -74,12 +73,12 @@ add_monitor(struct Client *client_p, const char *nicks)
 
        tmp = LOCAL_COPY(nicks);
 
-       for(name = strtoken(&p, tmp, ","); name; name = strtoken(&p, NULL, ","))
+       for(name = rb_strtok_r(tmp, ",", &p); name; name = rb_strtok_r(NULL, ",", &p))
        {
                if(EmptyString(name) || strlen(name) > NICKLEN-1)
                        continue;
 
-               if(dlink_list_length(&client_p->localClient->monitor_list) >=
+               if(rb_dlink_list_length(&client_p->localClient->monitor_list) >=
                        ConfigFileEntry.max_monitor)
                {
                        char buf[100];
@@ -90,9 +89,9 @@ add_monitor(struct Client *client_p, const char *nicks)
                                sendto_one(client_p, "%s", offbuf);
 
                        if(p)
-                               snprintf(buf, sizeof(buf), "%s,%s", name, p);
+                               rb_snprintf(buf, sizeof(buf), "%s,%s", name, p);
                        else
-                               snprintf(buf, sizeof(buf), "%s", name);
+                               rb_snprintf(buf, sizeof(buf), "%s", name);
 
                        sendto_one(client_p, form_str(ERR_MONLISTFULL),
                                        me.name, client_p->name,
@@ -103,11 +102,11 @@ add_monitor(struct Client *client_p, const char *nicks)
                monptr = find_monitor(name, 1);
 
                /* already monitoring this nick */
-               if(dlinkFind(client_p, &monptr->users))
+               if(rb_dlinkFind(client_p, &monptr->users))
                        continue;
 
-               dlinkAddAlloc(client_p, &monptr->users);
-               dlinkAddAlloc(monptr, &client_p->localClient->monitor_list);
+               rb_dlinkAddAlloc(client_p, &monptr->users);
+               rb_dlinkAddAlloc(monptr, &client_p->localClient->monitor_list);
 
                if((target_p = find_named_person(name)) != NULL)
                {
@@ -166,12 +165,12 @@ del_monitor(struct Client *client_p, const char *nicks)
        char *tmp;
        char *p;
 
-       if(!dlink_list_length(&client_p->localClient->monitor_list))
+       if(!rb_dlink_list_length(&client_p->localClient->monitor_list))
                return;
 
        tmp = LOCAL_COPY(nicks);
 
-       for(name = strtoken(&p, tmp, ","); name; name = strtoken(&p, NULL, ","))
+       for(name = rb_strtok_r(tmp, ",", &p); name; name = rb_strtok_r(NULL, ",", &p))
        {
                if(EmptyString(name))
                        continue;
@@ -180,8 +179,8 @@ del_monitor(struct Client *client_p, const char *nicks)
                if((monptr = find_monitor(name, 0)) == NULL)
                        continue;
 
-               dlinkFindDestroy(client_p, &monptr->users);
-               dlinkFindDestroy(monptr, &client_p->localClient->monitor_list);
+               rb_dlinkFindDestroy(client_p, &monptr->users);
+               rb_dlinkFindDestroy(monptr, &client_p->localClient->monitor_list);
        }
 }
 
@@ -191,10 +190,10 @@ list_monitor(struct Client *client_p)
        char buf[BUFSIZE];
        struct monitor *monptr;
        char *nbuf;
-       dlink_node *ptr;
+       rb_dlink_node *ptr;
        int mlen, arglen, cur_len;
 
-       if(!dlink_list_length(&client_p->localClient->monitor_list))
+       if(!rb_dlink_list_length(&client_p->localClient->monitor_list))
        {
                sendto_one(client_p, form_str(RPL_ENDOFMONLIST),
                                me.name, client_p->name);
@@ -205,7 +204,7 @@ list_monitor(struct Client *client_p)
                                me.name, client_p->name, "");
        nbuf = buf + mlen;
 
-       DLINK_FOREACH(ptr, client_p->localClient->monitor_list.head)
+       RB_DLINK_FOREACH(ptr, client_p->localClient->monitor_list.head)
        {
                monptr = ptr->data;
 
@@ -241,7 +240,7 @@ show_monitor_status(struct Client *client_p)
        char *onptr, *offptr;
        int cur_onlen, cur_offlen;
        int mlen, arglen;
-       dlink_node *ptr;
+       rb_dlink_node *ptr;
 
        mlen = cur_onlen = sprintf(onbuf, form_str(RPL_MONONLINE),
                                        me.name, client_p->name, "");
@@ -251,7 +250,7 @@ show_monitor_status(struct Client *client_p)
        onptr = onbuf + mlen;
        offptr = offbuf + mlen;
 
-       DLINK_FOREACH(ptr, client_p->localClient->monitor_list.head)
+       RB_DLINK_FOREACH(ptr, client_p->localClient->monitor_list.head)
        {
                monptr = ptr->data;