-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Don't rely on members to query if syncing user can post to room #717
Conversation
if (power_levels_event) { | ||
power_levels = power_levels_event.getContent(); | ||
events_levels = power_levels.events || {}; | ||
|
||
if (utils.isNumber(power_levels.state_default)) { | ||
if (Number.isFinite(power_levels.state_default)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use things that are now available in standard JS as opposed to rolling our own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another utils.isNumber
below we should probably change for consistency
lgtm modulo one random q :) |
making changes to avoid looking up the member, don't merge yet. |
d4ba869
to
4026ae0
Compare
ready for another look |
4026ae0
to
0998436
Compare
as this might not be known for the syncing user. instead, add a method to room which always knows the syncing user's membership
0998436
to
8b00083
Compare
This fixes the tests that broke with matrix-org/matrix-js-sdk#717 This is because of https://github.com/vector-im/riot-web/blob/master/test/app-tests/joining.js#L63 which prevents the DOM nodes from actually ending up in the DOM, even though the react components get rendered. This means that WillMount and WillUnmount are called, but not DidMount. Using WillMount is more symmertrical anyway since the resulting teardown code must be in WillUnmount (since there is no DidUnmount).
Required by matrix-org/matrix-react-sdk#2145