4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 20:44:04 +00:00

Upgrade to latest girc version (irc) (#718)

This commit is contained in:
Wim
2019-02-16 17:24:04 +01:00
committed by GitHub
parent 777af73e2b
commit 3123695869
14 changed files with 172 additions and 189 deletions

View File

@ -41,7 +41,7 @@ func DecodeCTCP(e *Event) *CTCPEvent {
// Must be targeting a user/channel, AND trailing must have
// DELIM+TAG+DELIM minimum (at least 3 chars).
if len(e.Params) != 1 || len(e.Trailing) < 3 {
if len(e.Params) != 2 || len(e.Params[1]) < 3 {
return nil
}
@ -49,12 +49,12 @@ func DecodeCTCP(e *Event) *CTCPEvent {
return nil
}
if e.Trailing[0] != ctcpDelim || e.Trailing[len(e.Trailing)-1] != ctcpDelim {
if e.Params[1][0] != ctcpDelim || e.Params[1][len(e.Params[1])-1] != ctcpDelim {
return nil
}
// Strip delimiters.
text := e.Trailing[1 : len(e.Trailing)-1]
text := e.Params[1][1 : len(e.Params[1])-1]
s := strings.IndexByte(text, eventSpace)