return retval;
}
-static void
-propagate_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline)
+int
+gline_propagate(struct Client *cptr, struct Client *sptr, struct Gline *gline)
{
if (GlineIsLocal(gline) || (IsUser(sptr) && !gline->gl_lastmod))
- return;
+ return 0;
if (gline->gl_lastmod)
sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s%s%s %Tu %Tu :%s",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
GlineIsBadChan(gline) ? "" : gline->gl_host,
gline->gl_expire - CurrentTime, gline->gl_reason);
+
+ return 0;
}
int
if (!agline) /* if it overlapped, silently return */
return 0;
- propagate_gline(cptr, sptr, agline);
+ gline_propagate(cptr, sptr, agline);
if (GlineIsBadChan(agline))
return 0;
else {
gline->gl_flags |= GLINE_ACTIVE;
- if (gline->gl_lastmod >= lastmod) /* force lastmod to increase */
- gline->gl_lastmod++;
- else
- gline->gl_lastmod = lastmod;
+ if (gline->gl_lastmod) {
+ if (gline->gl_lastmod >= lastmod) /* force lastmod to increase */
+ gline->gl_lastmod++;
+ else
+ gline->gl_lastmod = lastmod;
+ }
}
if ((saveflags & GLINE_ACTMASK) == GLINE_ACTIVE)
gline->gl_expire + TSoffset, gline->gl_reason);
if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */
- propagate_gline(cptr, sptr, gline);
+ gline_propagate(cptr, sptr, gline);
return GlineIsBadChan(gline) ? 0 : do_gline(cptr, sptr, gline);
}
else {
gline->gl_flags &= ~GLINE_ACTIVE;
- if (gline->gl_lastmod >= lastmod)
- gline->gl_lastmod++;
- else
- gline->gl_lastmod = lastmod;
+ if (gline->gl_lastmod) {
+ if (gline->gl_lastmod >= lastmod)
+ gline->gl_lastmod++;
+ else
+ gline->gl_lastmod = lastmod;
+ }
}
if ((saveflags & GLINE_ACTMASK) != GLINE_ACTIVE)
gline->gl_expire + TSoffset, gline->gl_reason);
if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */
- propagate_gline(cptr, sptr, gline);
+ gline_propagate(cptr, sptr, gline);
/* if it's a local gline or a Uworld gline (and not locally deactivated).. */
if (GlineIsLocal(gline) || (!gline->gl_lastmod && !(flags & GLINE_LOCAL)))