-
Notifications
You must be signed in to change notification settings - Fork 152
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
Handle +m by setting events_default to 1 (and back to 0 on -m) #465
Conversation
- This only works if `modePowerMap` has values >0 set for `v`, `o`, etc. - This currently doesn't work for IRC users, as the virtual matrix user does not have power in the room because we do not bridge power level for those users. See #385. Other than that, it seems to be working as intended.
…l prefix Currently doesn't do anything as onMode bails out with "no client" since it's an IRC user.
And is required to fix #453, which is now working.
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.
LGTM apart from minor squabbles
const roomId = matrixRooms[i].getId(); | ||
try { | ||
const plContent = yield botClient.getStateEvent(roomId, "m.room.power_levels", ""); | ||
plContent.events_default = enabled ? 1 : 0; |
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.
could plContent
be undefined
?
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.
No, Synapse should make sure that every room has a m.room.power_levels
event, and you can't delete state. The CS API states it'll 404 if the event doesn't exist which will throw instead of returning undefined
.
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.
The CS API states it'll 404 if the event doesn't exist which will throw instead of returning undefined.
Ah ok, then no worries
lib/irc/IrcEventBroker.js
Outdated
req, server, createUser(name.nick), name.chan, "names" | ||
)); | ||
if (!name.opLevel || name.opLevel === "") { |
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.
But !"" === true
so name.opLevel === ""
feels redundant.
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.
Fixed. ef5c3f1
In order for this to work, I also needed to fix #385 so that real IRC users can send into moderated Matrix rooms.
Fixes #453.