* (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)) \
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;
}
}
}
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;
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 */
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 &&
/* 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",
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;
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",
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",
gline->gl_expire - CurrentTime, gline->gl_lastmod,
gline->gl_lifetime, gline->gl_reason);
}
-#endif
}
/** Send a G-line to another server.
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;
}