Join all channels with a single JOIN message
This commit is contained in:
parent
b1367a0608
commit
c547aa0278
13
upstream.go
13
upstream.go
@ -525,16 +525,19 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
dc.updateSupportedCaps()
|
dc.updateSupportedCaps()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// TODO: split this into multiple messages if need be
|
||||||
|
var names, keys []string
|
||||||
for _, ch := range uc.network.channels {
|
for _, ch := range uc.network.channels {
|
||||||
params := []string{ch.Name}
|
names = append(names, ch.Name)
|
||||||
if ch.Key != "" {
|
keys = append(keys, ch.Key)
|
||||||
params = append(params, ch.Key)
|
|
||||||
}
|
}
|
||||||
uc.SendMessage(&irc.Message{
|
uc.SendMessage(&irc.Message{
|
||||||
Command: "JOIN",
|
Command: "JOIN",
|
||||||
Params: params,
|
Params: []string{
|
||||||
|
strings.Join(names, ","),
|
||||||
|
strings.Join(keys, ","),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
case irc.RPL_MYINFO:
|
case irc.RPL_MYINFO:
|
||||||
if err := parseMessageParams(msg, nil, &uc.serverName, nil, &uc.availableUserModes, nil); err != nil {
|
if err := parseMessageParams(msg, nil, &uc.serverName, nil, &uc.availableUserModes, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user