5 before, glines with reason starting with "AUTO" end up in SNO_AUTO, all other in SNO_GLINE
7 /* figure out what snomask to send to, send to SNO_GLINE when:
8 * source is a user and is not on a service server
9 * gline is local, a badchan, or a realname gline
10 * duration is either 120 seconds or less, or 2 weeks or more
11 * nick part is not equal to *
13 * otherwise, send to SNO_AUTO
16 diff -r 16b56cea76d8 ircd/gline.c
17 --- a/ircd/gline.c Sun Jan 11 22:38:40 2009 +0000
18 +++ b/ircd/gline.c Sun Jan 11 22:38:41 2009 +0000
20 * @return Zero, unless \a sptr G-lined himself, in which case CPTR_KILLED.
23 -do_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline)
24 +do_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline, int snomask)
27 int fd, retval = 0, tval;
31 /* let the ops know about it */
32 - sendto_opmask_butone(0, SNO_GLINE, "G-line active for %s",
33 + sendto_opmask_butone(0, snomask, "G-line active for %s",
34 get_client_name(acptr, SHOW_IP));
36 /* and get rid of him */
38 char uhmask[NICKLEN + USERLEN + HOSTLEN + 3];
39 char *nick, *user, *host;
43 assert(0 != userhost);
47 /* lifetime is already an absolute timestamp */
49 + /* figure out what snomask to send to, send to SNO_GLINE when:
50 + * source is a user and is not on a service server
51 + * gline is local, a badchan, or a realname gline
52 + * duration is either 120 seconds or less, or 2 weeks or more
53 + * nick part is not equal to *
55 + * otherwise, send to SNO_AUTO
57 + if ((IsUser(sptr) && !IsService(cli_user(sptr)->server)) ||
58 + (flags & (GLINE_LOCAL|GLINE_BADCHAN|GLINE_REALNAME)) ||
59 + ((expire - CurrentTime <= 120) || (expire - CurrentTime >= 1209600)) ||
60 + !(nick[0] == '*' && nick[1] == '\0') ||
61 + (gline_checkmask(host) != CHECK_APPROVED))
62 + snomask = SNO_GLINE;
67 - sendto_opmask_butone(0, ircd_strncmp(reason, "AUTO", 4) ? SNO_GLINE :
68 - SNO_AUTO, "%s adding %s %s for %s%s%s%s%s, expiring at "
69 + sendto_opmask_butone(0, snomask, "%s adding %s %s for %s%s%s%s%s, expiring at "
71 (feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
75 gline_propagate(cptr, sptr, agline);
77 - return do_gline(cptr, sptr, agline); /* knock off users if necessary */
78 + return do_gline(cptr, sptr, agline, snomask); /* knock off users if necessary */
81 /** Activate a currently inactive G-line.
83 if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */
84 gline_propagate(cptr, sptr, gline);
86 - return do_gline(cptr, sptr, gline);
87 + return do_gline(cptr, sptr, gline, SNO_GLINE);
90 /** Deactivate a G-line.
92 gline->gl_lifetime, gline->gl_reason);
94 /* OK, let's do the G-line... */
95 - return do_gline(cptr, sptr, gline);
96 + return do_gline(cptr, sptr, gline, SNO_GLINE);
99 /** Destroy a local G-line.