new function get_client_name_and_opername() add in s_misc.c
mirrored after get_client_name() which can return either nick/server or nick[ident@ip]
-diff -r 7ba3fe4d0f40 include/client.h
---- a/include/client.h Thu Jan 22 00:59:17 2009 +0100
-+++ b/include/client.h Thu Jan 22 00:59:43 2009 +0100
-@@ -806,6 +806,7 @@
+diff -r a15df3a06d8e include/client.h
+--- a/include/client.h Sun Feb 15 16:00:04 2009 +0100
++++ b/include/client.h Sun Feb 15 16:03:43 2009 +0100
+@@ -812,6 +812,7 @@
#define IPV6USERBITS 64
extern const char* get_client_name(const struct Client* sptr, int showip);
extern const char* client_get_default_umode(const struct Client* sptr);
extern int client_get_ping(const struct Client* local_client);
extern void client_drop_sendq(struct Connection* con);
-diff -r 7ba3fe4d0f40 ircd/channel.c
---- a/ircd/channel.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/channel.c Thu Jan 22 00:59:43 2009 +0100
-@@ -1952,8 +1952,8 @@
+diff -r a15df3a06d8e ircd/channel.c
+--- a/ircd/channel.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/channel.c Sun Feb 15 16:03:43 2009 +0100
+@@ -1926,8 +1926,8 @@
if (mbuf->mb_dest & MODEBUF_DEST_HACK4)
sendto_opmask_butone(0, SNO_HACK4, "HACK(4): %s MODE %s %s%s%s%s%s%s "
"[%Tu]",
mbuf->mb_channel->chname,
rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "",
addbuf, remstr, addstr,
-diff -r 7ba3fe4d0f40 ircd/gline.c
---- a/ircd/gline.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/gline.c Thu Jan 22 00:59:43 2009 +0100
-@@ -561,7 +561,7 @@
- "%s adding %s %s for %s%s%s%s%s, expiring at "
- "%Tu: %s",
+diff -r a15df3a06d8e ircd/gline.c
+--- a/ircd/gline.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/gline.c Sun Feb 15 16:03:43 2009 +0100
+@@ -560,7 +560,7 @@
+ sendto_opmask_butone(0, (flags & GLINE_AUTO) ? SNO_AUTO : SNO_GLINE,
+ "%s adding %s%s %s for %s%s%s%s%s, expiring at %Tu: %s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
- cli_name(sptr) :
+ get_client_name_and_opername(sptr) :
cli_name((cli_user(sptr))->server),
+ (flags & GLINE_ACTIVE) ? "" : "deactivated ",
(flags & GLINE_LOCAL) ? "local" : "global",
- (flags & GLINE_BADCHAN) ? "BADCHAN" : "GLINE",
@@ -648,7 +648,7 @@
"%s activating global %s for %s%s%s%s%s, "
"expiring at %Tu: %s",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
@@ -721,7 +721,7 @@
- sendto_opmask_butone(0, SNO_GLINE, "%s %s %s for %s%s%s%s%s, expiring at %Tu: "
- "%s",
+ sendto_opmask_butone(0, GlineIsAuto(gline) ? SNO_AUTO : SNO_GLINE,
+ "%s %s %s for %s%s%s%s%s, expiring at %Tu: %s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
- cli_name(sptr) :
+ get_client_name_and_opername(sptr) :
cli_name((cli_user(sptr))->server),
msg, GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
-@@ -981,7 +981,7 @@
- sendto_opmask_butone(0, flags & GLINE_AUTO ? SNO_GLINE : SNO_GLINE,
+@@ -932,7 +932,7 @@
+ sendto_opmask_butone(0, GlineIsAuto(gline) ? SNO_AUTO : SNO_GLINE,
"%s modifying global %s for %s%s%s%s%s:%s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
- cli_name(sptr) : cli_name((cli_user(sptr))->server),
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
-@@ -1039,7 +1039,7 @@
- /* Inform ops and log it */
- sendto_opmask_butone(0, SNO_GLINE, "%s removing local %s for %s%s%s%s%s",
+@@ -991,7 +991,7 @@
+ sendto_opmask_butone(0, GlineIsAuto(gline) ? SNO_AUTO : SNO_GLINE,
+ "%s removing local %s for %s%s%s%s%s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
- cli_name(sptr) : cli_name((cli_user(sptr))->server),
+ get_client_name_and_opername(sptr) : cli_name((cli_user(sptr))->server),
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
-diff -r 7ba3fe4d0f40 ircd/jupe.c
---- a/ircd/jupe.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/jupe.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/jupe.c
+--- a/ircd/jupe.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/jupe.c Sun Feb 15 16:03:43 2009 +0100
@@ -156,7 +156,7 @@
sendto_opmask_butone(0, SNO_NETWORK, "%s adding %sJUPE for %s, expiring at "
"%Tu: %s",
cli_name((cli_user(sptr))->server),
flags & JUPE_LOCAL ? "local " : "", server,
expire + TSoffset, reason);
-@@ -216,7 +216,7 @@
+@@ -225,7 +225,7 @@
sendto_opmask_butone(0, SNO_NETWORK, "%s activating JUPE for %s, expiring "
"at %Tu: %s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name((cli_user(sptr))->server),
jupe->ju_server, jupe->ju_expire + TSoffset,
jupe->ju_reason);
-@@ -269,7 +269,7 @@
+@@ -278,7 +278,7 @@
sendto_opmask_butone(0, SNO_NETWORK, "%s %s JUPE for %s, expiring at %Tu: "
"%s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name((cli_user(sptr))->server),
JupeIsLocal(jupe) ? "removing local" : "deactivating",
jupe->ju_server, jupe->ju_expire + TSoffset,
-diff -r 7ba3fe4d0f40 ircd/m_connect.c
---- a/ircd/m_connect.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/m_connect.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/m_connect.c
+--- a/ircd/m_connect.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/m_connect.c Sun Feb 15 16:03:43 2009 +0100
@@ -197,7 +197,7 @@
sendwallto_group_butone(&me, WALL_WALLOPS, 0,
"Remote CONNECT %s %s from %s", aconf->name,
log_write(LS_NETWORK, L_INFO, 0, "CONNECT From %C : %s %s", sptr, aconf->name,
parv[2] ? parv[2] : "");
-diff -r 7ba3fe4d0f40 ircd/m_join.c
---- a/ircd/m_join.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/m_join.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/m_join.c
+--- a/ircd/m_join.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/m_join.c Sun Feb 15 16:03:43 2009 +0100
@@ -242,8 +242,8 @@
}
/* send accountability notice */
err = 0;
}
-diff -r 7ba3fe4d0f40 ircd/m_kill.c
---- a/ircd/m_kill.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/m_kill.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/m_kill.c
+--- a/ircd/m_kill.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/m_kill.c Sun Feb 15 16:03:43 2009 +0100
@@ -127,7 +127,7 @@
*/
sendto_opmask_butone(0, snomask,
inpath, path, msg);
log_write_kill(victim, sptr, inpath, path, msg);
-diff -r 7ba3fe4d0f40 ircd/m_rehash.c
---- a/ircd/m_rehash.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/m_rehash.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/m_rehash.c
+--- a/ircd/m_rehash.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/m_rehash.c Sun Feb 15 16:03:43 2009 +0100
@@ -121,8 +121,8 @@
}
log_write(LS_SYSTEM, L_INFO, 0, "REHASH From %#C", sptr);
-diff -r 7ba3fe4d0f40 ircd/m_settime.c
---- a/ircd/m_settime.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/m_settime.c Thu Jan 22 00:59:43 2009 +0100
+diff -r a15df3a06d8e ircd/m_settime.c
+--- a/ircd/m_settime.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/m_settime.c Sun Feb 15 16:03:43 2009 +0100
@@ -177,7 +177,7 @@
else /* tell opers about time change */
{
(dt < 0) ? "forwards" : "backwards");
TSoffset -= dt; /* apply time change */
if (IsUser(sptr)) /* let user know what we did */
-diff -r 7ba3fe4d0f40 ircd/s_misc.c
---- a/ircd/s_misc.c Thu Jan 22 00:59:17 2009 +0100
-+++ b/ircd/s_misc.c Thu Jan 22 00:59:43 2009 +0100
-@@ -169,6 +169,20 @@
- ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr),
- IsIdented(sptr) ? cli_username(sptr) : "",
- cli_sock_ip(sptr));
-+ return nbuf;
-+}
-+
+diff -r a15df3a06d8e ircd/s_misc.c
+--- a/ircd/s_misc.c Sun Feb 15 16:00:04 2009 +0100
++++ b/ircd/s_misc.c Sun Feb 15 16:03:43 2009 +0100
+@@ -172,6 +172,20 @@
+ return nbuf;
+ }
+
+/** Return the name of the client and the opername for accountability purposes
+ * in snomask and other places.
+ * @param sptr Client to operate on.
+ if (!IsUser(sptr) || !cli_user(sptr)->opername)
+ return cli_name(sptr);
+ ircd_snprintf(0, nbuf, sizeof(nbuf), "%s(%s)", cli_name(sptr), cli_user(sptr)->opername);
- return nbuf;
- }
-
++ return nbuf;
++}
++
+ /**
+ * Exit one client, local or remote. Assuming for local client that
+ * all dependents already have been removed, and socket is closed.
@@ -474,7 +488,7 @@
(cli_user(killer)->server == victim ||
cli_user(killer)->server == cli_serv(victim)->up) ?