diff --git a/downstream.go b/downstream.go index 4bc59fb..b69a475 100644 --- a/downstream.go +++ b/downstream.go @@ -64,12 +64,13 @@ const illegalNickChars = " :@!*?" // permanentDownstreamCaps is the list of always-supported downstream // capabilities. var permanentDownstreamCaps = map[string]string{ - "batch": "", - "cap-notify": "", - "echo-message": "", - "message-tags": "", - "sasl": "PLAIN", - "server-time": "", + "batch": "", + "cap-notify": "", + "echo-message": "", + "invite-notify": "", + "message-tags": "", + "sasl": "PLAIN", + "server-time": "", } // needAllDownstreamCaps is the list of downstream capabilities that diff --git a/upstream.go b/upstream.go index dc6ef5b..f0fdf63 100644 --- a/upstream.go +++ b/upstream.go @@ -27,6 +27,7 @@ var permanentUpstreamCaps = map[string]bool{ "away-notify": true, "batch": true, "extended-join": true, + "invite-notify": true, "labeled-response": true, "message-tags": true, "multi-prefix": true, @@ -1279,7 +1280,12 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } + weAreInvited := nick == uc.nick + uc.forEachDownstream(func(dc *downstreamConn) { + if !weAreInvited && !dc.caps["invite-notify"] { + return + } dc.SendMessage(&irc.Message{ Prefix: dc.marshalUserPrefix(uc.network, msg.Prefix), Command: "INVITE",