Forward ISUPPORT NETWORK token

This commit is contained in:
Simon Ser 2021-01-22 12:00:02 +01:00
parent c4d9e6822d
commit 62f1207437
2 changed files with 9 additions and 2 deletions

View File

@ -879,6 +879,10 @@ func (dc *downstreamConn) welcome() error {
fmt.Sprintf("CHATHISTORY=%v", dc.srv.HistoryLimit), fmt.Sprintf("CHATHISTORY=%v", dc.srv.HistoryLimit),
} }
if uc := dc.upstream(); uc != nil && uc.networkName != "" {
isupport = append(isupport, fmt.Sprintf("NETWORK=%v", uc.networkName))
}
dc.SendMessage(&irc.Message{ dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(), Prefix: dc.srv.prefix(),
Command: irc.RPL_WELCOME, Command: irc.RPL_WELCOME,
@ -901,9 +905,9 @@ func (dc *downstreamConn) welcome() error {
}) })
// TODO: other RPL_ISUPPORT tokens // TODO: other RPL_ISUPPORT tokens
dc.SendMessage(&irc.Message{ dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(), Prefix: dc.srv.prefix(),
Command: irc.RPL_ISUPPORT, Command: irc.RPL_ISUPPORT,
Params: append(append([]string{dc.nick}, isupport...), "are supported"), Params: append(append([]string{dc.nick}, isupport...), "are supported"),
}) })
dc.SendMessage(&irc.Message{ dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(), Prefix: dc.srv.prefix(),

View File

@ -78,6 +78,7 @@ type upstreamConn struct {
user *user user *user
serverName string serverName string
networkName string
availableUserModes string availableUserModes string
availableChannelModes map[byte]channelModeType availableChannelModes map[byte]channelModeType
availableChannelTypes string availableChannelTypes string
@ -670,6 +671,8 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
} }
uc.availableMemberships = memberships uc.availableMemberships = memberships
} }
case "NETWORK":
uc.networkName = value
} }
} else { } else {
// TODO: handle ISUPPORT negations // TODO: handle ISUPPORT negations