X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fgline.c;h=24be0026a7eb2ecbc04c7331ac6051143c94f5c8;hp=e8c7b29a74729760304bdb86e8a59cadc7f2c70a;hb=73286bcf466860bb2d095e97b1a16e8a135b51d3;hpb=bae6ea42e84d8783475ef65b6911586f42d0318d diff --git a/ircd/gline.c b/ircd/gline.c index e8c7b29..24be002 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -82,11 +82,7 @@ struct Gline* BadChanGlineList = 0; * (x || 1) is used to continue in a logical-and series even when !x. * (x && 0) is used to continue in a logical-or series even when x. */ -#ifdef OLD_OGN_IRCU_COMPAT - #define GL_EXPIRED(gl) ((gl)->gl_lifetime <= CurrentTime) -#else - #define GL_EXPIRED(gl) ((gl)->gl_lifetime <= CurrentTime || (gl)->gl_expire <= CurrentTime) -#endif +#define GL_EXPIRED(gl) ((gl)->gl_lifetime <= CurrentTime || (gl)->gl_expire <= CurrentTime) #define gliter(list, gl, next) \ /* Iterate through the G-lines in the list */ \ for ((gl) = (list); (gl); (gl) = (next)) \ @@ -363,21 +359,12 @@ gline_propagate(struct Client *cptr, struct Client *sptr, struct Gline *gline) assert(gline->gl_lastmod); -#ifdef OLD_OGN_IRCU_COMPAT - sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu :%s", - GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, - gline->gl_host ? "@" : "", - gline->gl_host ? gline->gl_host : "", - gline->gl_expire - CurrentTime, gline->gl_lastmod, - /*gline->gl_lifetime,*/ gline->gl_reason); -#else sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu %Tu :%s", GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "", gline->gl_expire - CurrentTime, gline->gl_lastmod, gline->gl_lifetime, gline->gl_reason); -#endif return 0; } @@ -774,17 +761,6 @@ gline_modify(struct Client *cptr, struct Client *sptr, struct Gline *gline, } } if(expire <= CurrentTime) disable_gl = 1; -#ifdef OLD_OGN_IRCU_COMPAT - /* Compatibility issue: - * The ircu prior to ircu-2.10.12.10 has no lifetime, therefore, we force - * the lifetime to be the same as the expiration time here. This allows to - * remove glines by setting the expiration-time to a smaller value than CurrentTime. - * This has to be removed when the full ircu-2.10.12.10 gline features - * want to be used on the whole network. - */ - lifetime = expire; - flags |= GLINE_LIFETIME; -#endif } else { flags &= ~GLINE_EXPIRE; expire = 0; @@ -802,9 +778,6 @@ gline_modify(struct Client *cptr, struct Client *sptr, struct Gline *gline, lifetime = IRCD_MAX(lifetime, expire); /* set lifetime to the max */ -#ifdef OLD_OGN_IRCU_COMPAT - flags |= GLINE_LIFETIME; -#else /* OK, let's see which is greater... */ if (lifetime > gline->gl_lifetime) flags |= GLINE_LIFETIME; /* have to update lifetime */ @@ -812,7 +785,6 @@ gline_modify(struct Client *cptr, struct Client *sptr, struct Gline *gline, flags &= ~GLINE_LIFETIME; /* no change to lifetime */ lifetime = 0; } -#endif /* Finally, let's see if the reason needs to be updated */ if ((flags & GLINE_REASON) && reason && @@ -944,16 +916,6 @@ gline_modify(struct Client *cptr, struct Client *sptr, struct Gline *gline, /* We'll be simple for this release, but we can update this to change * the propagation syntax on future updates */ -#ifdef OLD_OGN_IRCU_COMPAT - if (action != GLINE_LOCAL_ACTIVATE && action != GLINE_LOCAL_DEACTIVATE) - sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, - "* %s%s%s%s%s %Tu %Tu :%s", - flags & GLINE_OPERFORCE ? "!" : "", op, - gline->gl_user, gline->gl_host ? "@" : "", - gline->gl_host ? gline->gl_host : "", - gline->gl_expire, gline->gl_lastmod, - /*gline->gl_lifetime,*/ gline->gl_reason); -#else if (action != GLINE_LOCAL_ACTIVATE && action != GLINE_LOCAL_DEACTIVATE) sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %s%s%s%s%s %Tu %Tu %Tu :%s", @@ -962,7 +924,6 @@ gline_modify(struct Client *cptr, struct Client *sptr, struct Gline *gline, gline->gl_host ? gline->gl_host : "", gline->gl_expire, gline->gl_lastmod, gline->gl_lifetime, gline->gl_reason); -#endif /* OK, let's do the G-line... */ if(disable_gl) return 0; @@ -1132,24 +1093,6 @@ gline_burst(struct Client *cptr) struct Gline *gline; struct Gline *sgline; -#ifdef OLD_OGN_IRCU_COMPAT - gliter(GlobalGlineList, gline, sgline) { - if (!GlineIsLocal(gline) && gline->gl_lastmod) - sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu :%s", - GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, - gline->gl_host ? "@" : "", - gline->gl_host ? gline->gl_host : "", - gline->gl_expire - CurrentTime, gline->gl_lastmod, - /*gline->gl_lifetime,*/ gline->gl_reason); - } - gliter(BadChanGlineList, gline, sgline) { - if (!GlineIsLocal(gline) && gline->gl_lastmod) - sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s %Tu %Tu :%s", - GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, - gline->gl_expire - CurrentTime, gline->gl_lastmod, - /*gline->gl_lifetime,*/ gline->gl_reason); - } -#else gliter(GlobalGlineList, gline, sgline) { if (!GlineIsLocal(gline) && gline->gl_lastmod) sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu %Tu :%s", @@ -1159,6 +1102,7 @@ gline_burst(struct Client *cptr) gline->gl_expire - CurrentTime, gline->gl_lastmod, gline->gl_lifetime, gline->gl_reason); } + gliter(BadChanGlineList, gline, sgline) { if (!GlineIsLocal(gline) && gline->gl_lastmod) sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s %Tu %Tu %Tu :%s", @@ -1166,7 +1110,6 @@ gline_burst(struct Client *cptr) gline->gl_expire - CurrentTime, gline->gl_lastmod, gline->gl_lifetime, gline->gl_reason); } -#endif } /** Send a G-line to another server. @@ -1180,21 +1123,12 @@ gline_resend(struct Client *cptr, struct Gline *gline) if (GlineIsLocal(gline) || !gline->gl_lastmod) return 0; -#ifdef OLD_OGN_IRCU_COMPAT - sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu :%s", - GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, - gline->gl_host ? "@" : "", - gline->gl_host ? gline->gl_host : "", - gline->gl_expire - CurrentTime, gline->gl_lastmod, - /*gline->gl_lifetime,*/ gline->gl_reason); -#else sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu %Tu :%s", GlineIsRemActive(gline) ? '+' : '-', gline->gl_user, gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "", gline->gl_expire - CurrentTime, gline->gl_lastmod, gline->gl_lifetime, gline->gl_reason); -#endif return 0; }