]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_gline.c
m_away.c derived from ratbox3 - looks much better and do not use deprecated DupString.
[irc/rqf/shadowircd.git] / modules / m_gline.c
index 92d87d2e41706e288826536fac6995074591ef79..4f39befc142359d6f01368db73e957f1f0b01dc7 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 #include "stdinc.h"
-#include "tools.h"
 #include "s_gline.h"
 #include "channel.h"
 #include "client.h"
@@ -36,7 +35,6 @@
 #include "ircd.h"
 #include "hostmask.h"
 #include "numeric.h"
-#include "commio.h"
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "scache.h"
@@ -47,6 +45,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 +557,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 +587,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 +597,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 +650,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 +669,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));
@@ -680,7 +679,7 @@ majority_gline(struct Client *source_p, const char *user,
        pending->last_gline_time = CurrentTime;
        pending->time_request1 = CurrentTime;
 
-       dlinkAddAlloc(pending, &pending_glines);
+       rb_dlinkAddAlloc(pending, &pending_glines);
 
        return NO;
 }
@@ -695,14 +694,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;
 
@@ -721,7 +720,8 @@ remove_temp_gline(const char *user, const char *host)
                                                (struct sockaddr *)&caddr, bits))
                        continue;
 
-               dlinkDestroy(ptr, &glines);
+               rb_dlinkDestroy(ptr, &glines);
+               remove_reject_mask(aconf->user, aconf->host);
                delete_one_address_conf(aconf->host, aconf);
                return YES;
        }