-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopernotify.patch
68 lines (66 loc) · 3.05 KB
/
opernotify.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
# HG changeset patch
# Parent 4851bf918b577c1e610417fe4ae4886ee78fd17b
diff -r 4851bf918b57 ircd/s_user.c
--- a/ircd/s_user.c Thu Jul 25 18:47:45 2013 +0100
+++ b/ircd/s_user.c Thu Jul 25 18:57:13 2013 +0100
@@ -1312,7 +1312,7 @@
if (MyConnect(sptr))
{
tmpmask = cli_snomask(sptr) & ~SNO_OPER;
- cli_handler(sptr) = CLIENT_HANDLER;
+ cli_handler(sptr) = CLIENT_HANDLER;
}
}
break;
@@ -1501,27 +1501,44 @@
/* user now oper */
++UserStats.opers;
client_set_privs(sptr, NULL); /* may set propagate privilege */
+
+ /* notify my operators a user has OPERed on a remote server */
+ if (!MyConnect(sptr)) {
+ sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is now operator (O) as %s on %s",
+ cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
+ cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
+ }
+
}
/* remember propagate privilege setting */
if (HasPriv(sptr, PRIV_PROPAGATE)) {
prop = 1;
}
+
+ /* user was a local operator */
+ if (FlagHas(&setflags, FLAG_LOCOP) && !IsLocOp(sptr)) {
+
+ /* notify my operators a local operator has deOPERed */
+ sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (o) as %s",
+ cli_name(sptr), cli_user(sptr)->realusername, cli_sockhost(sptr),
+ cli_user(sptr)->opername);
+ }
if (FlagHas(&setflags, FLAG_OPER) && !IsOper(sptr)) {
/* user no longer oper */
assert(UserStats.opers > 0);
--UserStats.opers;
- /* notify my operators an operator has deOPERed on the network - wiebe */
+ /* notify my operators an operator has deOPERed on the network */
if (MyConnect(sptr)) {
- sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s",
- cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
- cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>");
+ sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O)",
+ cli_name(sptr), cli_user(sptr)->realusername, cli_sockhost(sptr),
+ cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>");
} else {
- sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s on %s",
- cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
- cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
+ sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) on %s",
+ cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
+ cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
}
-
+
client_set_privs(sptr, NULL); /* will clear propagate privilege */
if (cli_user(sptr)->opername) {
MyFree(cli_user(sptr)->opername);