mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
strings: Nicks and usernames can't contain ! or @
This commit is contained in:
parent
130b9ecb9c
commit
4a8d526c4d
@ -41,7 +41,10 @@ func (name Name) IsNickname() bool {
|
|||||||
// , is used as a separator by the protocol
|
// , is used as a separator by the protocol
|
||||||
// # is a channel prefix
|
// # is a channel prefix
|
||||||
// @+ are channel membership prefixes
|
// @+ are channel membership prefixes
|
||||||
if namestr == "*" || strings.Contains(namestr, ",") || strings.Contains("#@+", string(namestr[0])) {
|
// ! separates username from nickname
|
||||||
|
// @ separates nick+user from hostname
|
||||||
|
if namestr == "*" || strings.Contains(namestr, ",") || strings.Contains("#@+", string(namestr[0])) ||
|
||||||
|
strings.Contains(namestr, "!") || strings.Contains(namestr, "@") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return NicknameExpr.MatchString(namestr)
|
return NicknameExpr.MatchString(namestr)
|
||||||
|
Loading…
Reference in New Issue
Block a user