mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
review fixes
This commit is contained in:
parent
52b0fb71e7
commit
d5a5f939dd
@ -39,7 +39,7 @@ func ExpandUserHost(userhost string) (expanded string) {
|
||||
// ClientManager keeps track of clients by nick, enforcing uniqueness of casefolded nicks
|
||||
type ClientManager struct {
|
||||
sync.RWMutex // tier 2
|
||||
byNick map[string]*Client
|
||||
byNick map[string]*Client
|
||||
}
|
||||
|
||||
// NewClientManager returns a new ClientManager.
|
||||
@ -70,7 +70,7 @@ func (clients *ClientManager) Get(nick string) *Client {
|
||||
}
|
||||
|
||||
func (clients *ClientManager) removeInternal(client *Client) (removed bool) {
|
||||
// requires holding ByNickMutex
|
||||
// requires holding the writable Lock()
|
||||
oldcfnick := client.NickCasefolded()
|
||||
currentEntry, present := clients.byNick[oldcfnick]
|
||||
if present {
|
||||
@ -123,7 +123,7 @@ func (clients *ClientManager) AllClients() (result []*Client) {
|
||||
defer clients.RUnlock()
|
||||
result = make([]*Client, len(clients.byNick))
|
||||
i := 0
|
||||
for _, client := range(clients.byNick) {
|
||||
for _, client := range clients.byNick {
|
||||
result[i] = client
|
||||
i++
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func performNickChange(server *Server, client *Client, target *Client, newnick s
|
||||
return false
|
||||
}
|
||||
|
||||
client.server.logger.Debug("nick", fmt.Sprintf("%s changed nickname to %s", origNickMask, nickname))
|
||||
client.server.logger.Debug("nick", fmt.Sprintf("%s changed nickname to %s [%s]", origNickMask, nicknameRaw, nickname))
|
||||
if hadNick {
|
||||
target.server.snomasks.Send(sno.LocalNicks, fmt.Sprintf(ircfmt.Unescape("$%s$r changed nickname to %s"), origNick, nicknameRaw))
|
||||
target.server.whoWas.Append(client)
|
||||
|
Loading…
Reference in New Issue
Block a user