Changeset 725 in code for trunk/downstream.go


Ignore:
Timestamp:
Nov 21, 2021, 3:28:38 PM (4 years ago)
Author:
contact
Message:

Remove sasl cap after registration if network doesn't support it

This will stop clients from trying to issue AUTHENTICATE requests
after connection registration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r724 r725  
    191191        "invite-notify": "",
    192192        "message-tags":  "",
    193         "sasl":          "PLAIN",
    194193        "server-time":   "",
    195194        "setname":       "",
     
    300299                dc.supportedCaps[k] = v
    301300        }
     301        dc.supportedCaps["sasl"] = "PLAIN"
    302302        // TODO: this is racy, we should only enable chathistory after
    303303        // authentication and then check that user.msgStore implements
     
    10371037                        dc.unsetSupportedCap(cap)
    10381038                }
     1039        }
     1040
     1041        if uc := dc.upstream(); uc != nil && uc.supportsSASL("PLAIN") {
     1042                dc.setSupportedCap("sasl", "PLAIN")
     1043        } else if dc.network != nil {
     1044                dc.unsetSupportedCap("sasl")
    10391045        }
    10401046
Note: See TracChangeset for help on using the changeset viewer.