-
Notifications
You must be signed in to change notification settings - Fork 73
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
Convert intent.js to TypeScript #185
Conversation
Hah, I wrote a branch for this on Friday but never published it. Ah well. This looks very clean. |
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.
One thing
@jaller94 do you need any help with these tests? |
Haven't had time to fix them. I assume
|
This reverts commit cf80380.
Might be worth factoring in #155, if you've not already? |
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.
One concern
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.
Further concerns
Heads up that I've been trying to incorporate types into matrix-appservice-irc based off this, so I'll have a PR shortly with what I changed to make it work. |
src/components/intent.ts
Outdated
const defaultLevel = STATE_EVENT_TYPES.includes(eventType) | ||
? event.content.state_default | ||
: event.content.events_default; | ||
const requiredLevel = event.content.events[eventType] || defaultLevel; |
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.
If the powerLevelEvent's content did not contain a required level for the eventType and also no defaults, what should happen? Do we just assume the required power level is higher than what we have?
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.
I believe in theory synapse ensures that should never happen, but we should follow the spec which mentions what values to use if the keys do not exist.
Type fixes needed to make matrix-appservice-irc build
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.
Yeah! Happy with this. Thanks for trudging through it
Breaking change:
new Intent(client, client, opts)
to Intent and modifyopts
.Intent
will now create a deep clone for itself and ignore outside changes.