|
@@ -97,8 +97,14 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
97
|
97
|
realname := client.realname
|
98
|
98
|
client.stateMutex.RUnlock()
|
99
|
99
|
|
100
|
|
- if newNick != accountName && strings.ContainsAny(newNick, disfavoredNameCharacters) {
|
101
|
|
- return "", errNicknameInvalid, false
|
|
100
|
+ // these restrictions have grandfather exceptions for nicknames registered
|
|
101
|
+ // on previous versions of Ergo:
|
|
102
|
+ if newNick != accountName {
|
|
103
|
+ // can't contain "disfavored" characters like <, or start with a $ because
|
|
104
|
+ // it collides with the massmessage mask syntax:
|
|
105
|
+ if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") {
|
|
106
|
+ return "", errNicknameInvalid, false
|
|
107
|
+ }
|
102
|
108
|
}
|
103
|
109
|
|
104
|
110
|
// recompute always-on status, because client.alwaysOn is not set for unregistered clients
|