1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 22:43:12 +02:00

WHOWAS: Show IP address and account to IRCOps.

Thanks to Noisytoot for https://github.com/unrealircd/unrealircd/pull/227
who suggested displaying account and provided a partial patch, and
armyn in https://bugs.unrealircd.org/view.php?id=6153 suggesting IP.

I chose to use the existing RPL_WHOIS* numerics that we also use for
returning WHOIS data. We already use RPL_WHOISSERVER in WHOWAS for
ages and the use of it is mentioned in RFC1459, so seems like that
was the idea right from the beginning of times. The only change I did
was from "is" to "was" in like "was logged in" and "was connecting from"
in the text of the numerics.
This commit is contained in:
Bram Matthys
2023-03-17 18:02:32 +01:00
parent fcdb059883
commit cdb36e7e30
3 changed files with 19 additions and 0 deletions
+13
View File
@@ -104,6 +104,19 @@ CMD_FUNC(cmd_whowas)
(*temp->virthost !=
'\0') ? temp->virthost : temp->hostname),
temp->realname);
if (!BadPtr(temp->ip) && ValidatePermissionsForPath("client:see:ip",client,NULL,NULL,NULL))
{
sendnumericfmt(client, RPL_WHOISHOST, "%s :was connecting from %s@%s %s",
temp->name,
temp->username, temp->hostname,
temp->ip ? temp->ip : "");
}
if (IsOper(client) && !BadPtr(temp->account))
{
sendnumericfmt(client, RPL_WHOISLOGGEDIN, "%s %s :was logged in as",
temp->name,
temp->account);
}
if (!((find_uline(temp->servername)) && !IsOper(client) && HIDE_ULINES))
{
sendnumeric(client, RPL_WHOISSERVER, temp->name, temp->servername,