Rename "realIP" to "ip" in WhoWas struct.

It could be the real IP or the proxied IP.
This commit is contained in:
Alex Jaspersen 2021-06-20 11:13:18 -07:00
parent e5c2588eab
commit b6264a43b6
3 changed files with 3 additions and 3 deletions

@ -269,7 +269,7 @@ type WhoWas struct {
username string
hostname string
realname string
realIP net.IP
ip net.IP
// technically not required for WHOWAS:
account string
accountName string

@ -436,7 +436,7 @@ func (client *Client) detailsNoMutex() (result ClientDetails) {
result.username = client.username
result.hostname = client.hostname
result.realname = client.realname
result.realIP = client.getIPNoMutex()
result.ip = client.getIPNoMutex()
result.nickMask = client.nickMaskString
result.nickMaskCasefolded = client.nickMaskCasefolded
result.account = client.account

@ -3429,7 +3429,7 @@ func whowasHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respo
for _, whoWas := range results {
rb.Add(nil, server.name, RPL_WHOWASUSER, cnick, whoWas.nick, whoWas.username, whoWas.hostname, "*", whoWas.realname)
if canSeeIP {
rb.Add(nil, server.name, RPL_WHOWASIP, cnick, whoWas.nick, fmt.Sprintf(client.t("was connecting from %s"), utils.IPStringToHostname(whoWas.realIP.String())))
rb.Add(nil, server.name, RPL_WHOWASIP, cnick, whoWas.nick, fmt.Sprintf(client.t("was connecting from %s"), utils.IPStringToHostname(whoWas.ip.String())))
}
}
}