Slice the params instead of building a new channel slice in the PART handler
This commit is contained in:
parent
29fad58252
commit
cf759883aa
@ -84,18 +84,11 @@ func (i *ircHandler) join(msg *irc.Message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *ircHandler) part(msg *irc.Message) {
|
func (i *ircHandler) part(msg *irc.Message) {
|
||||||
var chans []string
|
|
||||||
for i, param := range msg.Params {
|
|
||||||
if i != len(msg.Params)-1 {
|
|
||||||
chans = append(chans, param)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i.session.sendJSON("part", Part{
|
i.session.sendJSON("part", Part{
|
||||||
Join: Join{
|
Join: Join{
|
||||||
Server: i.client.Host,
|
Server: i.client.Host,
|
||||||
User: msg.Nick,
|
User: msg.Nick,
|
||||||
Channels: chans,
|
Channels: msg.Params[:len(msg.Params)-1],
|
||||||
},
|
},
|
||||||
Reason: msg.Params[len(msg.Params)-1],
|
Reason: msg.Params[len(msg.Params)-1],
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user