mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
strings: Nicks and usernames can't contain ! or @
This commit is contained in:
parent
130b9ecb9c
commit
4a8d526c4d
1 changed files with 4 additions and 1 deletions
|
|
@ -41,7 +41,10 @@ func (name Name) IsNickname() bool {
|
|||
// , is used as a separator by the protocol
|
||||
// # is a channel prefix
|
||||
// @+ 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 NicknameExpr.MatchString(namestr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue