Changeset 448 in code


Ignore:
Timestamp:
Jan 31, 2021, 9:18:51 PM (4 years ago)
Author:
hubert
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r447 r448  
    6565// capabilities.
    6666var permanentDownstreamCaps = map[string]string{
    67         "batch":        "",
    68         "cap-notify":   "",
    69         "echo-message": "",
    70         "message-tags": "",
    71         "sasl":         "PLAIN",
    72         "server-time":  "",
     67        "batch":         "",
     68        "cap-notify":    "",
     69        "echo-message":  "",
     70        "invite-notify": "",
     71        "message-tags":  "",
     72        "sasl":          "PLAIN",
     73        "server-time":   "",
    7374}
    7475
  • trunk/upstream.go

    r447 r448  
    2828        "batch":            true,
    2929        "extended-join":    true,
     30        "invite-notify":    true,
    3031        "labeled-response": true,
    3132        "message-tags":     true,
     
    12801281                }
    12811282
     1283                weAreInvited := nick == uc.nick
     1284
    12821285                uc.forEachDownstream(func(dc *downstreamConn) {
     1286                        if !weAreInvited && !dc.caps["invite-notify"] {
     1287                                return
     1288                        }
    12831289                        dc.SendMessage(&irc.Message{
    12841290                                Prefix:  dc.marshalUserPrefix(uc.network, msg.Prefix),
Note: See TracChangeset for help on using the changeset viewer.