]> jfr.im git - solanum.git/blobdiff - modules/m_xline.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / modules / m_xline.c
index f04ef51be6c21b8d33756fe232a991e9abd90df5..b3650ed2e258b90d04fcd6b5f126eab3b2550a5e 100644 (file)
 #include "bandbi.h"
 #include "operhash.h"
 
-static int mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int ms_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int me_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int mo_unxline(struct Client *client_p, struct Client *source_p, int parc,
+static int mo_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int ms_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int me_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mo_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc,
                      const char *parv[]);
-static int ms_unxline(struct Client *client_p, struct Client *source_p, int parc,
+static int ms_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc,
                      const char *parv[]);
-static int me_unxline(struct Client *client_p, struct Client *source_p, int parc,
+static int me_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc,
                      const char *parv[]);
 
 struct Message xline_msgtab = {
-       "XLINE", 0, 0, 0, MFLG_SLOW,
+       "XLINE", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, {ms_xline, 5}, {ms_xline, 5}, {me_xline, 5}, {mo_xline, 3}}
 };
 
 struct Message unxline_msgtab = {
-       "UNXLINE", 0, 0, 0, MFLG_SLOW,
+       "UNXLINE", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, {ms_unxline, 3}, {ms_unxline, 3}, {me_unxline, 2}, {mo_unxline, 2}}
 };
 
@@ -100,7 +100,7 @@ static void remove_xline(struct Client *source_p, const char *name,
  * parv[3] - reason
  */
 static int
-mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mo_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct ConfItem *aconf;
        const char *name;
@@ -187,7 +187,7 @@ mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char
  * handles a remote xline
  */
 static int
-ms_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* parv[0]  parv[1]      parv[2]  parv[3]  parv[4]
         * oper     target serv  xline    type     reason
@@ -206,7 +206,7 @@ ms_xline(struct Client *client_p, struct Client *source_p, int parc, const char
 }
 
 static int
-me_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+me_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* time name type :reason */
        if(!IsPerson(source_p))
@@ -388,7 +388,7 @@ cluster_xline(struct Client *source_p, int temp_time, const char *name, const ch
  * parv[1] - thing to unxline
  */
 static int
-mo_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mo_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        int propagated = 1;
 
@@ -426,7 +426,7 @@ mo_unxline(struct Client *client_p, struct Client *source_p, int parc, const cha
  * handles a remote unxline
  */
 static int
-ms_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* parv[0]  parv[1]        parv[2]
         * oper     target server  gecos
@@ -444,7 +444,7 @@ ms_unxline(struct Client *client_p, struct Client *source_p, int parc, const cha
 }
 
 static int
-me_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+me_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* name */
        if(!IsPerson(source_p))
@@ -471,6 +471,7 @@ remove_xline(struct Client *source_p, const char *name, int propagated)
 {
        struct ConfItem *aconf;
        rb_dlink_node *ptr;
+       time_t now;
 
        RB_DLINK_FOREACH(ptr, xline_conf_list.head)
        {
@@ -493,8 +494,9 @@ remove_xline(struct Client *source_p, const char *name, int propagated)
                                                       "%s has removed the global X-Line for: [%s]",
                                                       get_oper_name(source_p), name);
                                ilog(L_KLINE, "UX %s %s", get_oper_name(source_p), name);
-                               if(aconf->created < rb_current_time())
-                                       aconf->created = rb_current_time();
+                               now = rb_current_time();
+                               if(aconf->created < now)
+                                       aconf->created = now;
                                else
                                        aconf->created++;
                                aconf->hold = aconf->created;
@@ -508,7 +510,7 @@ remove_xline(struct Client *source_p, const char *name, int propagated)
                                                0,
                                                (int)(aconf->lifetime - aconf->created));
                                remove_reject_mask(aconf->host, NULL);
-                               deactivate_conf(aconf, ptr);
+                               deactivate_conf(aconf, ptr, now);
                                return;
                        }
                        else if(propagated && rb_dlink_list_length(&cluster_conf_list))