mirror of
https://github.com/jeremyd/ergo.git
synced 2026-04-26 15:40:00 -07:00
Allow configuring relay
This commit is contained in:
@@ -19,6 +19,16 @@ import (
|
||||
|
||||
const (
|
||||
precisUTF8MappingToken = "rfc8265"
|
||||
|
||||
// space can't be used
|
||||
// , is used as a separator
|
||||
// * is used in mask matching
|
||||
// ? is used in mask matching
|
||||
// . denotes a server name
|
||||
// ! separates nickname from username
|
||||
// @ separates username from hostname
|
||||
// : means trailing
|
||||
protocolBreakingNameCharacters = " ,*?.!@:"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -132,18 +142,10 @@ func CasefoldName(name string) (string, error) {
|
||||
return "", errStringIsEmpty
|
||||
}
|
||||
|
||||
// space can't be used
|
||||
// , is used as a separator
|
||||
// * is used in mask matching
|
||||
// ? is used in mask matching
|
||||
// . denotes a server name
|
||||
// ! separates nickname from username
|
||||
// @ separates username from hostname
|
||||
// : means trailing
|
||||
// # is a channel prefix
|
||||
// ~&@%+ are channel membership prefixes
|
||||
// - I feel like disallowing
|
||||
if strings.ContainsAny(lowered, " ,*?.!@:") || strings.ContainsAny(string(lowered[0]), "#~&@%+-") {
|
||||
if strings.ContainsAny(lowered, protocolBreakingNameCharacters) || strings.ContainsAny(string(lowered[0]), "#~&@%+-") {
|
||||
return "", errInvalidCharacter
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user