]> jfr.im git - solanum.git/blobdiff - extensions/m_sendbans.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / extensions / m_sendbans.c
index 00ff7da8c619242e56cc23266298e3b9929a77f2..9320444786a0fbd213d48ee853665360cb3d9b52 100644 (file)
 #include "msg.h"
 #include "hash.h"
 #include "modules.h"
+#include "messages.h"
+#include "irc_radixtree.h"
 
-static int mo_sendbans(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 
 struct Message sendbans_msgtab = {
-       "SENDBANS", 0, 0, 0, MFLG_SLOW,
+       "SENDBANS", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_sendbans, 2}}
 };
 
@@ -81,13 +83,14 @@ static const char *expand_xline(const char *mask)
        return buf;
 }
 
-static int mo_sendbans(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static int mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct ConfItem *aconf;
        rb_dlink_node *ptr;
        int i, count;
        const char *target, *mask2;
        struct Client *server_p;
+       struct irc_radixtree_iteration_state state;
 
        if (!IsOperRemoteBan(source_p))
        {
@@ -138,31 +141,29 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
                sendto_match_servs(source_p, target,
                                CAP_ENCAP, NOCAPS,
                                "ENCAP %s RESV 0 %s 0 :%s",
-                               target, aconf->name, aconf->passwd);
+                               target, aconf->host, aconf->passwd);
        }
 
-       HASH_WALK(i, R_MAX, ptr, resvTable)
+       IRC_RADIXTREE_FOREACH(aconf, &state, resv_tree)
        {
-               aconf = ptr->data;
                if (aconf->hold)
                        continue;
                sendto_match_servs(source_p, target,
                                CAP_ENCAP, NOCAPS,
                                "ENCAP %s RESV 0 %s 0 :%s",
-                               target, aconf->name, aconf->passwd);
+                               target, aconf->host, aconf->passwd);
        }
-       HASH_WALK_END
 
        RB_DLINK_FOREACH(ptr, xline_conf_list.head)
        {
                aconf = ptr->data;
                if (aconf->hold)
                        continue;
-               mask2 = expand_xline(aconf->name);
+               mask2 = expand_xline(aconf->host);
                if (mask2 == NULL)
                {
                        sendto_one_notice(source_p, ":Skipping xline [%s]",
-                                       aconf->name);
+                                       aconf->host);
                        continue;
                }
                sendto_match_servs(source_p, target,