3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

fix spurious bidi violations when casefolding the nickmask of an RTL nick

This commit is contained in:
Shivaram Lingamneni 2019-01-28 13:36:15 -05:00
parent 14ce8d850e
commit a2a9788f39

View File

@ -759,15 +759,15 @@ func (client *Client) updateNickMaskNoMutex() {
client.hostname = client.rawHostname client.hostname = client.rawHostname
} }
nickMaskString := fmt.Sprintf("%s!%s@%s", client.nick, client.username, client.hostname) cfusername, _ := Casefold(client.username) // we already checked for errors in SetNames
nickMaskCasefolded, err := Casefold(nickMaskString) cfhostname, err := Casefold(client.hostname)
if err != nil { if err != nil {
client.server.logger.Error("internal", "nickmask couldn't be casefolded", nickMaskString, err.Error()) client.server.logger.Error("internal", "hostname couldn't be casefolded", client.hostname, err.Error())
return cfhostname = client.hostname // YOLO
} }
client.nickMaskString = nickMaskString client.nickMaskString = fmt.Sprintf("%s!%s@%s", client.nick, client.username, client.hostname)
client.nickMaskCasefolded = nickMaskCasefolded client.nickMaskCasefolded = fmt.Sprintf("%s!%s@%s", client.nickCasefolded, cfusername, cfhostname)
} }
// AllNickmasks returns all the possible nickmasks for the client. // AllNickmasks returns all the possible nickmasks for the client.