Only send JOIN message if we have channels to join
Don't send a JOIN command to upstream server when no channels are configured.
This commit is contained in:
parent
9f40925199
commit
07b4de8a1a
26
upstream.go
26
upstream.go
@ -552,19 +552,21 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
dc.updateSupportedCaps()
|
dc.updateSupportedCaps()
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: split this into multiple messages if need be
|
if len(uc.network.channels) > 0 {
|
||||||
var names, keys []string
|
// TODO: split this into multiple messages if need be
|
||||||
for _, ch := range uc.network.channels {
|
var names, keys []string
|
||||||
names = append(names, ch.Name)
|
for _, ch := range uc.network.channels {
|
||||||
keys = append(keys, ch.Key)
|
names = append(names, ch.Name)
|
||||||
|
keys = append(keys, ch.Key)
|
||||||
|
}
|
||||||
|
uc.SendMessage(&irc.Message{
|
||||||
|
Command: "JOIN",
|
||||||
|
Params: []string{
|
||||||
|
strings.Join(names, ","),
|
||||||
|
strings.Join(keys, ","),
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
uc.SendMessage(&irc.Message{
|
|
||||||
Command: "JOIN",
|
|
||||||
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