Add more parseMessage() test cases, handle a prefix edge case
This commit is contained in:
parent
da8915328d
commit
c78ca7318c
2 changed files with 34 additions and 0 deletions
|
@ -24,6 +24,8 @@ func parseMessage(line string) *Message {
|
|||
|
||||
if i := strings.Index(msg.Prefix, "!"); i > 0 {
|
||||
msg.Nick = msg.Prefix[:i]
|
||||
} else if i := strings.Index(msg.Prefix, "@"); i > 0 {
|
||||
msg.Nick = msg.Prefix[:i]
|
||||
} else {
|
||||
msg.Nick = msg.Prefix
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue