3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-26 04:32:36 +01:00

strings: Disallow more broken nicknames

This commit is contained in:
Daniel Oaks 2016-08-13 20:53:23 +10:00
parent 78c9c285b4
commit 5a8e7709b2

View File

@ -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