]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - remoteglinejupe.patch
nickgline: include nick! bit in gline loggin
[irc/quakenet/snircd-patchqueue.git] / remoteglinejupe.patch
CommitLineData
7efbed3b 1oper doing some lccal gline/jupe action on a remote server
2never gets a reply in case of succes
3
4this patch sends a copy of the snomask message shown to local opers to the remote source oper
5
0aa07a5b 6diff -r 032bd91a5810 ircd/gline.c
afb65d52 7--- a/ircd/gline.c
8+++ b/ircd/gline.c
9@@ -595,6 +595,18 @@
88a737db 10 flags & (GLINE_BADCHAN|GLINE_REALNAME) ? "" : host,
0aa07a5b 11 expire, reason);
88a737db 12
13+ /* local gline set by remote user, inform oper of success */
afb65d52 14+ if ((flags & GLINE_LOCAL) && IsUser(sptr) && !MyConnect(sptr))
88a737db 15+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s adding local %s for %s%s%s%s%s, expiring at %Tu: %s",
16+ sptr, cli_name(sptr),
17+ (flags & GLINE_BADCHAN) ? "BADCHAN" : "GLINE",
18+ (flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : nick,
19+ (flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : "!",
20+ user,
21+ (flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : "@",
22+ (flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : host,
23+ expire + TSoffset, reason);
24+
25 /* make the gline */
26 agline = make_gline(nick, user, host, reason, expire, lastmod, lifetime, flags);
27
afb65d52 28@@ -937,6 +949,16 @@
88a737db 29 gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "",
30 buf);
31
32+ /* local change by remote user, inform oper of success */
afb65d52 33+ if ((action == GLINE_LOCAL_ACTIVATE || action == GLINE_LOCAL_DEACTIVATE) && IsUser(sptr) && !MyConnect(sptr))
88a737db 34+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s modifying global %s for %s%s%s%s%s:%s",
35+ sptr, cli_name(sptr),
36+ GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
37+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
38+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
39+ gline->gl_user, gline->gl_host ? "@" : "",
40+ gline->gl_host ? gline->gl_host : "", buf);
41+
42 /* We'll be simple for this release, but we can update this to change
43 * the propagation syntax on future updates
44 */
afb65d52 45@@ -984,6 +1006,16 @@
88a737db 46 gline->gl_user,
47 gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "");
7eec5d28 48
88a737db 49+ /* local change by remote user, inform oper of success */
afb65d52 50+ if (IsUser(sptr) && !MyConnect(sptr))
88a737db 51+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s removing local %s for %s%s%s%s%s",
52+ sptr, cli_name(sptr),
53+ GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
54+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
55+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
56+ gline->gl_user, gline->gl_host ? "@" : "",
57+ gline->gl_host ? gline->gl_host : "");
7eec5d28 58+
88a737db 59 gline_free(gline); /* get rid of the G-line */
60
7eec5d28 61 return 0; /* convenience return */
0aa07a5b 62diff -r 032bd91a5810 ircd/jupe.c
afb65d52 63--- a/ircd/jupe.c
64+++ b/ircd/jupe.c
7eec5d28 65@@ -166,6 +166,20 @@
88a737db 66 flags & JUPE_LOCAL ? "local " : "", server, expire + TSoffset,
67 reason);
68
7eec5d28 69+ /* local jupe - let's see who else to inform */
70+ if (flags & JUPE_LOCAL) {
71+
72+ /* set by remote oper - inform them about the success */
afb65d52 73+ if (IsUser(sptr) && !MyConnect(sptr))
7eec5d28 74+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s adding local JUPE for %s, expiring at %Tu: %s",
75+ sptr, cli_name(sptr), server, expire + TSoffset, reason);
76+
77+ /* set by remote oper or a server/service - inform all opers */
78+ if (!MyUser(sptr))
79+ sendwallto_group_butone(&me, WALL_WALLOPS, 0, "%s adding local JUPE for %s, expiring at %Tu: %s",
80+ cli_name(sptr), server, expire + TSoffset, reason);
81+ }
88a737db 82+
83 /* make the jupe */
84 ajupe = make_jupe(server, reason, expire, lastmod, flags);
85
7eec5d28 86@@ -275,6 +289,22 @@
88a737db 87 JupeIsLocal(jupe) ? "removing local" : "deactivating",
88 jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
88a737db 89
7eec5d28 90+ /* local jupe - let's see who else to inform */
91+ if (flags & JUPE_LOCAL) {
92+
93+ /* done by remote oper - inform them about the success */
afb65d52 94+ if (IsUser(sptr) && !MyConnect(sptr))
7eec5d28 95+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :% %s JUPE for %s, expiring at %Tu: %s",
96+ sptr, cli_name(sptr), JupeIsLocal(jupe) ? "removing local" : "locally deactivating",
97+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
98+
99+ /* done by remote oper or a server/service - inform all opers */
100+ if (!MyUser(sptr))
101+ sendwallto_group_butone(&me, WALL_WALLOPS, 0, "%s %s JUPE for %s, expiring at %Tu: %s",
102+ cli_name(sptr), JupeIsLocal(jupe) ? "removing local" : "locally deactivating",
103+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
104+ }
105+
88a737db 106 if (JupeIsLocal(jupe))
107 jupe_free(jupe);
7eec5d28 108 else if (!(flags & JUPE_LOCAL)) /* don't propagate local changes */