1
0
Fork 0
forked from External/ergo

pointless refactor of stripMaskFromNick

This commit is contained in:
Shivaram Lingamneni 2020-12-14 15:23:01 -05:00
parent 853bb12c29
commit 15a0cda78b
4 changed files with 12 additions and 12 deletions

View file

@ -308,3 +308,11 @@ func foldPermissive(str string) (result string, err error) {
str = norm.NFD.String(str)
return str, nil
}
// Reduce, e.g., `alice!~u@host` to `alice`
func NUHToNick(nuh string) (nick string) {
if idx := strings.IndexByte(nuh, '!'); idx != -1 {
return nuh[0:idx]
}
return nuh
}