Request invite-notify to upstreams
... and do not forward INVITEs to downstreams that do not support the capability. The downstream capability can be permanent because there is no way for a client to get the list of people invited to a channel, thus no state can be corrupted.
This commit is contained in:
parent
62f1207437
commit
5aa15d5628
@ -67,6 +67,7 @@ var permanentDownstreamCaps = map[string]string{
|
||||
"batch": "",
|
||||
"cap-notify": "",
|
||||
"echo-message": "",
|
||||
"invite-notify": "",
|
||||
"message-tags": "",
|
||||
"sasl": "PLAIN",
|
||||
"server-time": "",
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user