diff --git a/irc/accounts.go b/irc/accounts.go index 451eaf62..8540a802 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -1719,7 +1719,7 @@ func (am *AccountManager) applyVHostInfo(client *Client, info VHostInfo) { updated := client.SetVHost(vhost) if updated { // TODO: doing I/O here is kind of a kludge - go client.sendChghost(oldNickmask, client.Hostname()) + client.sendChghost(oldNickmask, client.Hostname()) } } diff --git a/irc/client.go b/irc/client.go index bbb58f14..599aa9ee 100644 --- a/irc/client.go +++ b/irc/client.go @@ -1052,9 +1052,9 @@ func (client *Client) SetOper(oper *Oper) { // XXX: CHGHOST requires prefix nickmask to have original hostname, // this is annoying to do correctly func (client *Client) sendChghost(oldNickMask string, vhost string) { - username := client.Username() + details := client.Details() for fClient := range client.Friends(caps.ChgHost) { - fClient.sendFromClientInternal(false, time.Time{}, "", oldNickMask, client.AccountName(), nil, "CHGHOST", username, vhost) + fClient.sendFromClientInternal(false, time.Time{}, "", oldNickMask, details.accountName, nil, "CHGHOST", details.username, vhost) } }