1
0
Fork 0
forked from External/ergo

implement draft/read-marker capability

This commit is contained in:
Shivaram Lingamneni 2022-03-30 15:35:28 -04:00
parent 6bd94391ef
commit 32f7868bfd
11 changed files with 190 additions and 79 deletions

View file

@ -165,6 +165,17 @@ func CasefoldName(name string) (string, error) {
return lowered, err
}
// CasefoldTarget returns a casefolded version of an IRC target, i.e.
// it determines whether the target is a channel name or nickname and
// applies the appropriate casefolding rules.
func CasefoldTarget(name string) (string, error) {
if strings.HasPrefix(name, "#") {
return CasefoldChannel(name)
} else {
return CasefoldName(name)
}
}
// returns true if the given name is a valid ident, using a mix of Insp and
// Chary's ident restrictions.
func isIdent(name string) bool {