From 62f1207437863bbd1046cf9034be7f67e4ef8880 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 22 Jan 2021 12:00:02 +0100 Subject: [PATCH] Forward ISUPPORT NETWORK token --- downstream.go | 8 ++++++-- upstream.go | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 551d6ac..4bc59fb 100644 --- a/downstream.go +++ b/downstream.go @@ -879,6 +879,10 @@ func (dc *downstreamConn) welcome() error { 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{ Prefix: dc.srv.prefix(), Command: irc.RPL_WELCOME, @@ -901,9 +905,9 @@ func (dc *downstreamConn) welcome() error { }) // TODO: other RPL_ISUPPORT tokens dc.SendMessage(&irc.Message{ - Prefix: dc.srv.prefix(), + Prefix: dc.srv.prefix(), 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{ Prefix: dc.srv.prefix(), diff --git a/upstream.go b/upstream.go index 41e5ab8..dc6ef5b 100644 --- a/upstream.go +++ b/upstream.go @@ -78,6 +78,7 @@ type upstreamConn struct { user *user serverName string + networkName string availableUserModes string availableChannelModes map[byte]channelModeType availableChannelTypes string @@ -670,6 +671,8 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { } uc.availableMemberships = memberships } + case "NETWORK": + uc.networkName = value } } else { // TODO: handle ISUPPORT negations