Browse Source

review fixes

tags/v0.10.3
Shivaram Lingamneni 6 years ago
parent
commit
d5a5f939dd
2 changed files with 4 additions and 4 deletions
  1. 3
    3
      irc/client_lookup_set.go
  2. 1
    1
      irc/nickname.go

+ 3
- 3
irc/client_lookup_set.go View File

@@ -39,7 +39,7 @@ func ExpandUserHost(userhost string) (expanded string) {
39 39
 // ClientManager keeps track of clients by nick, enforcing uniqueness of casefolded nicks
40 40
 type ClientManager struct {
41 41
 	sync.RWMutex // tier 2
42
-	byNick      map[string]*Client
42
+	byNick       map[string]*Client
43 43
 }
44 44
 
45 45
 // NewClientManager returns a new ClientManager.
@@ -70,7 +70,7 @@ func (clients *ClientManager) Get(nick string) *Client {
70 70
 }
71 71
 
72 72
 func (clients *ClientManager) removeInternal(client *Client) (removed bool) {
73
-	// requires holding ByNickMutex
73
+	// requires holding the writable Lock()
74 74
 	oldcfnick := client.NickCasefolded()
75 75
 	currentEntry, present := clients.byNick[oldcfnick]
76 76
 	if present {
@@ -123,7 +123,7 @@ func (clients *ClientManager) AllClients() (result []*Client) {
123 123
 	defer clients.RUnlock()
124 124
 	result = make([]*Client, len(clients.byNick))
125 125
 	i := 0
126
-	for _, client := range(clients.byNick) {
126
+	for _, client := range clients.byNick {
127 127
 		result[i] = client
128 128
 		i++
129 129
 	}

+ 1
- 1
irc/nickname.go View File

@@ -61,7 +61,7 @@ func performNickChange(server *Server, client *Client, target *Client, newnick s
61 61
 		return false
62 62
 	}
63 63
 
64
-	client.server.logger.Debug("nick", fmt.Sprintf("%s changed nickname to %s", origNickMask, nickname))
64
+	client.server.logger.Debug("nick", fmt.Sprintf("%s changed nickname to %s [%s]", origNickMask, nicknameRaw, nickname))
65 65
 	if hadNick {
66 66
 		target.server.snomasks.Send(sno.LocalNicks, fmt.Sprintf(ircfmt.Unescape("$%s$r changed nickname to %s"), origNick, nicknameRaw))
67 67
 		target.server.whoWas.Append(client)

Loading…
Cancel
Save