Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support room dir 3rd party network filtering #2747

Merged
merged 5 commits into from Dec 15, 2016
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Dec 14, 2016

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).

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).
@erikjohnston
Copy link
Member

Looks like you're hitting the right APIs.

@erikjohnston erikjohnston removed their assignment Dec 14, 2016
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is wire_onclick ever false? why is it called that anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -202,6 +253,24 @@ export default class NetworkDropdown extends React.Component {
</div>;
}

protocolNameForInstanceId(instance_id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs _ if it's private

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -131,6 +131,11 @@ module.exports = React.createClass({
if (my_server != MatrixClientPeg.getHomeServerName()) {
opts.server = my_server;
}
if (this.state.instance_id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add instance_id to getInitialState?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dbkr dbkr removed their assignment Dec 15, 2016
}
}

return options;
}

_makeMenuOptionFromProtocolInstance(server, protocol, instance, wire_onclick) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ev seems redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@richvdh richvdh assigned dbkr and unassigned richvdh Dec 15, 2016
and actually pass handleClicks false as appropriate
@dbkr dbkr assigned richvdh and unassigned dbkr Dec 15, 2016
@richvdh richvdh merged commit 61f9966 into develop Dec 15, 2016
@t3chguy t3chguy deleted the dbkr/third_party_filter branch May 12, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants