void glinebufaddbyip(glinebuf *gbuf, const char *user, struct irc_in_addr *ip, unsigned char bits, int flags, const char *creator, const char *reason, time_t expire, time_t lastmod, time_t lifetime);
void glinebufaddbynick(glinebuf *gbuf, nick *, int flags, const char *creator, const char *reason, time_t expire, time_t lastmod, time_t lifetime);
void glinebufcounthits(glinebuf *gbuf, int *users, int *channels);
-int glinebufsanitize(glinebuf *gbuf);
-void glinebufspew(glinebuf *gbuf, nick *np);
+int glinebufsanitize(glinebuf *gbuf, nick *spewto);
+void glinebufspew(glinebuf *gbuf, nick *spewto);
void glinebufflush(glinebuf *gbuf, int propagate);
void glinebufabandon(glinebuf *gbuf);
}
}
-int glinebufsanitize(glinebuf *gbuf) {
+int glinebufsanitize(glinebuf *gbuf, nick *spewto) {
gline *gl, **pnext;
int skipped;
const char *hint;
gl = *pnext;
if (!isglinesane(gl, &hint)) {
- controlwall(NO_OPER, NL_GLINES, "Sanity check failed for G-Line on '%s' lasting %s created by %s with reason '%s' - Skipping: %s",
- glinetostring(gl), longtoduration(gl->expire-getnettime(), 0),
- gl->reason->content, gl->creator->content, hint);
+ if (spewto) {
+ controlreply(spewto, "Sanity check failed for G-Line on '%s' - Skipping: %s",
+ glinetostring(gl), hint);
+ } else {
+ controlwall(NO_OPER, NL_GLINES, "Sanity check failed for G-Line on '%s' lasting %s created by %s with reason '%s' - Skipping: %s",
+ glinetostring(gl), longtoduration(gl->expire-getnettime(), 0),
+ gl->reason->content, gl->creator->content, hint);
+ }
*pnext = gl->next;
freegline(gl);
return skipped;
}
-void glinebufspew(glinebuf *gbuf, nick *np) {
+void glinebufspew(glinebuf *gbuf, nick *spewto) {
gline *gl;
for (gl = gbuf->head; gl; gl = gl->next)
- controlreply(np, "mask: %s", glinetostring(gl));
+ controlreply(spewto, "mask: %s", glinetostring(gl));
}
void glinebufflush(glinebuf *gbuf, int propagate) {