fix name reply parsing
This commit is contained in:
parent
8ceea92416
commit
e6ff641232
9
irc.go
9
irc.go
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
//IrcVersion exports the current version of the irc lib
|
//IrcVersion exports the current version of the irc lib
|
||||||
IrcVersion = "0.1.0"
|
IrcVersion = "0.1.1776"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Connection holds the callbacks for the client
|
//Connection holds the callbacks for the client
|
||||||
@ -212,10 +212,9 @@ func (c *Connection) parseMessage(line string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cmd == "353" {
|
if cmd == "353" {
|
||||||
idx := strings.Index(args, "=") + 2
|
params := strings.SplitN(args, " ", 4)
|
||||||
s := strings.Split(args[idx:], ":")
|
target := strings.TrimSpace(params[2])
|
||||||
target := strings.TrimSpace(s[0])
|
c.updateNicks(target, strings.Split(params[3][1:], " "))
|
||||||
c.updateNicks(target, strings.Split(s[1], " "))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.NumericCallback != nil {
|
if c.NumericCallback != nil {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestSimpleIrc(t *testing.T) {
|
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()
|
go con.Run()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user