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