* (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;
}
time_t lastmod, time_t lifetime, unsigned int flags)
{
char buf[BUFSIZE], *op = "";
- int pos = 0, disable_gl = 0;
+ int pos = 0, non_auto = 0, disable_gl = 0;
assert(gline);
assert(!GlineIsLocal(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;
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 &&
/* Now, handle reason changes... */
if (flags & GLINE_REASON) {
+ non_auto = non_auto || ircd_strncmp(gline->gl_reason, "AUTO", 4);
MyFree(gline->gl_reason); /* release old reason */
DupString(gline->gl_reason, reason); /* store new reason */
if (pos < BUFSIZE)
* However, we additionally save the exact message in the log, so we have both information
* in there. But the ops don't need to be bothered twice.
*/
- sendto_opmask_butone(0, SNO_GLINE, "%s deleting global %s for %s%s%s",
+ non_auto = non_auto || ircd_strncmp(gline->gl_reason, "AUTO", 4);
+ sendto_opmask_butone(0, non_auto ? SNO_GLINE : SNO_AUTO,
+ "%s deleting global %s for %s%s%s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name(sptr) : cli_name((cli_user(sptr))->server),
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "");
}
else {
- sendto_opmask_butone(0, SNO_GLINE, "%s modifying global %s for %s%s%s:%s",
+ non_auto = non_auto || ircd_strncmp(gline->gl_reason, "AUTO", 4);
+ sendto_opmask_butone(0, non_auto ? SNO_GLINE : SNO_AUTO,
+ "%s modifying global %s for %s%s%s:%s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name(sptr) : cli_name((cli_user(sptr))->server),
GlineIsBadChan(gline) ? "BADCHAN" : "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",
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;
}