mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-26 17:18:09 -07:00
pointless refactor of stripMaskFromNick
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user