-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow configuration of multiple moderator users to be invited to all rooms. #234
base: main
Are you sure you want to change the base?
Conversation
113b526
to
57ffd23
Compare
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 template thing bugs me, but it might just be hard to tell from the review window.
I'd like to say if we have the time then a test (based maybe off https://github.com/matrix-org/conference-bot/blob/main/spec/basic.spec.ts#L24-L48) would be helpful here to ensure behavior.
@@ -203,7 +203,7 @@ export class E2ETestEnv { | |||
} | |||
}, | |||
}, | |||
moderatorUserId: `@modbot:${homeserver.domain}`, | |||
moderatorUserIds: [`@modbot:${homeserver.domain}`], |
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.
Should we attempt a test for this, should be easy to whip one up?
// We can't do this directly with `createSpace` unfortunately, as we could for plain rooms. | ||
await this.client.setUserPowerLevel(this.config.moderatorUserId, subspace.roomId, 100); | ||
for (let moderator of this.config.moderatorUserIds) { |
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.
Technically we could convert createSpace
to createRoom
(with the necessary space state added in) and then just use the getSpace
function to pull it as a space object, if we did prefer doing it that way?
src/models/room_kinds.ts
Outdated
@@ -149,7 +146,7 @@ export const SPECIAL_INTEREST_CREATION_TEMPLATE = (moderatorUserId: string) => ( | |||
"m.room.power_levels": 50, | |||
}, | |||
}, | |||
invite: [moderatorUserId], | |||
invite: moderatorUserIds, |
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.
Hard to tell, but does PUBLIC_ROOM_POWER_LEVELS_TEMPLATE
work here? It takes a parameter but we're not giving it one?
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.
as you point out, this is probably broken. We haven't used special interest rooms for at least a couple of years now so I guess it wouldn't be a surprise. I may as well fix that obvious part up now though
Issue unrelated to this PR, probably been broken for a while
We want the ability to invite someone else alongside the moderator bot, in all rooms.
This makes
moderatorUserId
an array instead,moderatorUserIds
but otherwise the semantics should be all the same?