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