]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_kline.c
Reverting some changed related not to moving on libratbox3 but using ratbox3 source!
[irc/rqf/shadowircd.git] / modules / m_kline.c
index 0a39dab15d5254aae9a6c5bc41619cb775cc202c..faa6ad795f0f3e47e65c3206edd4a9cc60e1e5bf 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 #include "stdinc.h"
-#include "tools.h"
 #include "channel.h"
 #include "class.h"
 #include "client.h"
@@ -35,7 +34,6 @@
 #include "ircd.h"
 #include "hostmask.h"
 #include "numeric.h"
-#include "commio.h"
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "s_log.h"
@@ -45,7 +43,6 @@
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
-#include "event.h"
 #include "reject.h"
 
 static int mo_kline(struct Client *, struct Client *, int, const char **);
@@ -181,8 +178,8 @@ mo_kline(struct Client *client_p, struct Client *source_p,
        current_date = smalldate();
        aconf = make_conf();
        aconf->status = CONF_KILL;
-       DupString(aconf->host, host);
-       DupString(aconf->user, user);
+       aconf->host = rb_strdup(host);
+       aconf->user = rb_strdup(user);
        aconf->port = 0;
 
        /* Look for an oper reason */
@@ -192,7 +189,7 @@ mo_kline(struct Client *client_p, struct Client *source_p,
                oper_reason++;
 
                if(!EmptyString(oper_reason))
-                       DupString(aconf->spasswd, oper_reason);
+                       aconf->spasswd = rb_strdup(oper_reason);
        }
 
        if(tkline_time > 0)
@@ -200,13 +197,13 @@ mo_kline(struct Client *client_p, struct Client *source_p,
                rb_snprintf(buffer, sizeof(buffer),
                           "Temporary K-line %d min. - %s (%s)",
                           (int) (tkline_time / 60), reason, current_date);
-               DupString(aconf->passwd, buffer);
+               aconf->passwd = rb_strdup(buffer);
                apply_tkline(source_p, aconf, reason, oper_reason, current_date, tkline_time);
        }
        else
        {
                rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
-               DupString(aconf->passwd, buffer);
+               aconf->passwd = rb_strdup(buffer);
                apply_kline(source_p, aconf, reason, oper_reason, current_date);
        }
 
@@ -214,7 +211,7 @@ mo_kline(struct Client *client_p, struct Client *source_p,
        {
                if(kline_queued == 0)
                {
-                       eventAddOnce("check_klines", check_klines_event, NULL,
+                       rb_event_addonce("check_klines", check_klines_event, NULL,
                                     ConfigFileEntry.kline_delay);
                        kline_queued = 1;
                }
@@ -296,8 +293,8 @@ handle_remote_kline(struct Client *source_p, int tkline_time,
        aconf = make_conf();
 
        aconf->status = CONF_KILL;
-       DupString(aconf->user, user);
-       DupString(aconf->host, host);
+       aconf->user = rb_strdup(user);
+       aconf->host = rb_strdup(host);
 
        /* Look for an oper reason */
        if((oper_reason = strchr(reason, '|')) != NULL)
@@ -306,7 +303,7 @@ handle_remote_kline(struct Client *source_p, int tkline_time,
                oper_reason++;
 
                if(!EmptyString(oper_reason))
-                       DupString(aconf->spasswd, oper_reason);
+                       aconf->spasswd = rb_strdup(oper_reason);
        }
 
        current_date = smalldate();
@@ -316,13 +313,13 @@ handle_remote_kline(struct Client *source_p, int tkline_time,
                rb_snprintf(buffer, sizeof(buffer),
                           "Temporary K-line %d min. - %s (%s)",
                           (int) (tkline_time / 60), reason, current_date);
-               DupString(aconf->passwd, buffer);
+               aconf->passwd = rb_strdup(buffer);
                apply_tkline(source_p, aconf, reason, oper_reason, current_date, tkline_time);
        }
        else
        {
                rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
-               DupString(aconf->passwd, buffer);
+               aconf->passwd = rb_strdup(buffer);
                apply_kline(source_p, aconf, reason, oper_reason, current_date);
        }
 
@@ -330,7 +327,7 @@ handle_remote_kline(struct Client *source_p, int tkline_time,
        {
                if(kline_queued == 0)
                {
-                       eventAddOnce("check_klines", check_klines_event, NULL,
+                       rb_event_addonce("check_klines", check_klines_event, NULL,
                                     ConfigFileEntry.kline_delay);
                        kline_queued = 1;
                }
@@ -511,7 +508,7 @@ static void
 apply_tkline(struct Client *source_p, struct ConfItem *aconf,
             const char *reason, const char *oper_reason, const char *current_date, int tkline_time)
 {
-       aconf->hold = CurrentTime + tkline_time;
+       aconf->hold = rb_current_time() + tkline_time;
        add_temp_kline(aconf);
 
        /* no oper reason.. */
@@ -931,7 +928,7 @@ remove_temp_kline(struct Client *source_p, struct ConfItem *aconf)
                                ilog(L_KLINE, "UK %s %s %s",
                                        get_oper_name(source_p),
                                        aconf->user, aconf->host);
-                               dlinkDestroy(ptr, &temp_klines[i]);
+                               rb_dlinkDestroy(ptr, &temp_klines[i]);
                                remove_reject_mask(aconf->user, aconf->host);
                                delete_one_address_conf(aconf->host, aconf);
                                return YES;