fix name reply parsing

This commit is contained in:
blackbeard420 2020-09-03 23:29:52 -04:00
parent 8ceea92416
commit e6ff641232
2 changed files with 5 additions and 6 deletions

9
irc.go
View File

@ -13,7 +13,7 @@ import (
const (
//IrcVersion exports the current version of the irc lib
IrcVersion = "0.1.0"
IrcVersion = "0.1.1776"
)
//Connection holds the callbacks for the client
@ -212,10 +212,9 @@ func (c *Connection) parseMessage(line string) {
}
if cmd == "353" {
idx := strings.Index(args, "=") + 2
s := strings.Split(args[idx:], ":")
target := strings.TrimSpace(s[0])
c.updateNicks(target, strings.Split(s[1], " "))
params := strings.SplitN(args, " ", 4)
target := strings.TrimSpace(params[2])
c.updateNicks(target, strings.Split(params[3][1:], " "))
}
if c.NumericCallback != nil {

View File

@ -8,7 +8,7 @@ import (
)
func TestSimpleIrc(t *testing.T) {
con := NewConnection("thc420.xyz:6667", "irc-go", "irc-go", nil, []string{"#freedom"})
con := NewConnection("thc420.xyz:6667", "irc-go", "irc-go", nil, []string{"#freedom", "#test"})
go con.Run()