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

Fix bug on PL events without events property #155

Closed
wants to merge 1 commit into from

Conversation

martindale
Copy link

Ran into this while working on a bridge of my own, thanks to @david:vovo.id.au in the Matrix Bridging room for confirming.

@Half-Shot
Copy link
Contributor

Thanks for the contrib, would you mind signing off as per https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md ?

@jaller94
Copy link
Contributor

This became obsolete by #185.

The new lines are:

const requiredLevel = returnFirstNumber(
// If these are invalid or not provided, default to 0 according to the Spec.
// https://matrix.org/docs/spec/client_server/r0.6.0#m-room-power-levels
(event.content.events && event.content.events[eventType]),
defaultLevel,
0
);

My solution even accounts for default_state being undefined or any of these not being numbers.

@jaller94 jaller94 closed this Aug 10, 2020
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.

3 participants