]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_gline.c
dlink -> rb_dlink
[irc/rqf/shadowircd.git] / modules / m_gline.c
index 92d87d2e41706e288826536fac6995074591ef79..22cf9cc4f6cae9eea06b5fd8c518d0ae9c46ad04 100644 (file)
@@ -47,6 +47,7 @@
 #include "parse.h"
 #include "modules.h"
 #include "s_log.h"
+#include "reject.h"
 
 static int mo_gline(struct Client *, struct Client *, int, const char **);
 static int mc_gline(struct Client *, struct Client *, int, const char **);
@@ -558,7 +559,7 @@ set_local_gline(struct Client *source_p, const char *user,
                        DupString(aconf->spasswd, oper_reason);
        }
 
-       ircsnprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
+       rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
 
        DupString(aconf->passwd, buffer);
        DupString(aconf->user, user);
@@ -588,7 +589,7 @@ static int
 majority_gline(struct Client *source_p, const char *user,
               const char *host, const char *reason)
 {
-       dlink_node *pending_node;
+       rb_dlink_node *pending_node;
        struct gline_pending *pending;
 
        /* to avoid desync.. --fl */
@@ -598,7 +599,7 @@ majority_gline(struct Client *source_p, const char *user,
        if(find_is_glined(host, user))
                return NO;
 
-       DLINK_FOREACH(pending_node, pending_glines.head)
+       RB_DLINK_FOREACH(pending_node, pending_glines.head)
        {
                pending = pending_node->data;
 
@@ -651,7 +652,7 @@ majority_gline(struct Client *source_p, const char *user,
                                strlcpy(pending->oper_host2, source_p->host,
                                        sizeof(pending->oper_host2));
                                DupString(pending->reason2, reason);
-                               pending->oper_server2 = find_or_add(source_p->servptr->name);
+                               pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
                                pending->last_gline_time = CurrentTime;
                                pending->time_request2 = CurrentTime;
                                return NO;
@@ -670,7 +671,7 @@ majority_gline(struct Client *source_p, const char *user,
        strlcpy(pending->oper_host1, source_p->host,
                sizeof(pending->oper_host1));
 
-       pending->oper_server1 = find_or_add(source_p->servptr->name);
+       pending->oper_server1 = scache_get_name(source_p->servptr->serv->nameinfo);
 
        strlcpy(pending->user, user, sizeof(pending->user));
        strlcpy(pending->host, host, sizeof(pending->host));
@@ -695,14 +696,14 @@ static int
 remove_temp_gline(const char *user, const char *host)
 {
        struct ConfItem *aconf;
-       dlink_node *ptr;
+       rb_dlink_node *ptr;
        struct irc_sockaddr_storage addr, caddr;
        int bits, cbits;
        int mtype, gtype;
 
        mtype = parse_netmask(host, (struct sockaddr *)&addr, &bits);
 
-       DLINK_FOREACH(ptr, glines.head)
+       RB_DLINK_FOREACH(ptr, glines.head)
        {
                aconf = ptr->data;
 
@@ -722,6 +723,7 @@ remove_temp_gline(const char *user, const char *host)
                        continue;
 
                dlinkDestroy(ptr, &glines);
+               remove_reject_mask(aconf->user, aconf->host);
                delete_one_address_conf(aconf->host, aconf);
                return YES;
        }