1
0
Fork 0
forked from External/ergo

USERHOST needs to respect hidden operators as well

This commit is contained in:
Shivaram Lingamneni 2020-10-09 12:29:09 -04:00
parent f5374c014b
commit 4ee97ddb43
3 changed files with 20 additions and 10 deletions

View file

@ -439,9 +439,11 @@ func (client *Client) getWhoisOf(target *Client, hasPrivs bool, rb *ResponseBuff
if whoischannels != nil {
rb.Add(nil, client.server.name, RPL_WHOISCHANNELS, cnick, tnick, strings.Join(whoischannels, " "))
}
tOper := target.Oper()
if tOper.Visible(hasPrivs) {
rb.Add(nil, client.server.name, RPL_WHOISOPERATOR, cnick, tnick, tOper.WhoisLine)
if target.HasMode(modes.Operator) && operStatusVisible(client, target, hasPrivs) {
tOper := target.Oper()
if tOper != nil {
rb.Add(nil, client.server.name, RPL_WHOISOPERATOR, cnick, tnick, tOper.WhoisLine)
}
}
if client == target || hasPrivs {
rb.Add(nil, client.server.name, RPL_WHOISACTUALLY, cnick, tnick, fmt.Sprintf("%s@%s", targetInfo.username, target.RawHostname()), target.IPString(), client.t("Actual user@host, Actual IP"))