mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix: store the uncasefolded account name correctly
This commit is contained in:
parent
df41f9b3b0
commit
878f9ca94c
2 changed files with 11 additions and 13 deletions
|
|
@ -125,15 +125,21 @@ func (client *Client) AccountName() string {
|
|||
return client.accountName
|
||||
}
|
||||
|
||||
func (client *Client) SetAccountName(account string) {
|
||||
func (client *Client) SetAccountName(account string) (changed bool) {
|
||||
var casefoldedAccount string
|
||||
var err error
|
||||
if account != "" {
|
||||
casefoldedAccount, _ = CasefoldName(account)
|
||||
if casefoldedAccount, err = CasefoldName(account); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
client.stateMutex.Lock()
|
||||
defer client.stateMutex.Unlock()
|
||||
changed = client.account != casefoldedAccount
|
||||
client.account = casefoldedAccount
|
||||
client.accountName = account
|
||||
return
|
||||
}
|
||||
|
||||
func (client *Client) HasMode(mode modes.Mode) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue