mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
strings: Disallow more broken nicknames
This commit is contained in:
parent
78c9c285b4
commit
5a8e7709b2
@ -52,13 +52,13 @@ func (name Name) IsNickname() bool {
|
||||
// ! separates username from nickname
|
||||
// @ separates nick+user from hostname
|
||||
// # is a channel prefix
|
||||
// @+ are channel membership prefixes
|
||||
// ~&@%+ are channel membership prefixes
|
||||
// - is typically disallowed from first char of nicknames
|
||||
// nicknames can't start with digits
|
||||
if strings.Contains(namestr, "*") || strings.Contains(namestr, "?") ||
|
||||
strings.Contains(namestr, ".") || strings.Contains(namestr, ",") ||
|
||||
strings.Contains(namestr, "!") || strings.Contains(namestr, "@") ||
|
||||
strings.Contains("#@+-1234567890", string(namestr[0])) {
|
||||
strings.Contains("#~&@%+-1234567890", string(namestr[0])) {
|
||||
return false
|
||||
}
|
||||
// names that look like hostnames are restricted to servers, as with other ircds
|
||||
|
Loading…
Reference in New Issue
Block a user