Support room dir 3rd party network filtering#2747
Conversation
As per matrix-org/synapse#1676 The existing local config system still exists and is used for remote home server directories (since /thirdparty/protocols doesn't support listing remote home servers, and also because people are using it).
|
Looks like you're hitting the right APIs. |
richvdh
left a comment
There was a problem hiding this comment.
Looks like javascript to me. I struggle to get my head around this code. Not being able to use half of it on my own HS doesn't help.
Probably fine, a couple of nits
| return options; | ||
| } | ||
|
|
||
| _makeMenuOptionFromProtocolInstance(server, protocol, instance, wire_onclick) { |
There was a problem hiding this comment.
is wire_onclick ever false? why is it called that anyway?
There was a problem hiding this comment.
Yeah, as we only want to wire the onclick handler when it's used as a selectable menu option, rather than the currently selected menu option (ie. in the unexpanded dropdown).
There was a problem hiding this comment.
right, but it doesn't seem to be set in either of the places it's called.
and oh, wire is a verb. How about handleClicks or something? (don't we do camelCase rather than underscores?)
or just have an onProtocolInstanceClicked parameter, and pass in this.onMenuOptionClickProtocolInstance or null.
| </div>; | ||
| } | ||
|
|
||
| protocolNameForInstanceId(instance_id) { |
| if (my_server != MatrixClientPeg.getHomeServerName()) { | ||
| opts.server = my_server; | ||
| } | ||
| if (this.state.instance_id) { |
There was a problem hiding this comment.
add instance_id to getInitialState?
| return options; | ||
| } | ||
|
|
||
| _makeMenuOptionFromProtocolInstance(server, protocol, instance, wire_onclick) { |
There was a problem hiding this comment.
right, but it doesn't seem to be set in either of the places it's called.
and oh, wire is a verb. How about handleClicks or something? (don't we do camelCase rather than underscores?)
or just have an onProtocolInstanceClicked parameter, and pass in this.onMenuOptionClickProtocolInstance or null.
| this.props.onOptionChange(server, network); | ||
| } | ||
|
|
||
| onMenuOptionClickProtocolInstance(server, instance_id, ev) { |
and actually pass handleClicks false as appropriate
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
As per matrix-org/synapse#1676
The existing local config system still exists and is used for
remote home server directories (since /thirdparty/protocols
doesn't support listing remote home servers, and also because
people are using it).