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

Allow configuration of multiple moderator users to be invited to all rooms. #234

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

reivilibre
Copy link
Contributor

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?

@reivilibre reivilibre requested a review from a team as a code owner November 28, 2024 14:04
Copy link
Contributor

@Half-Shot Half-Shot left a 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}`],
Copy link
Contributor

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) {
Copy link
Contributor

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?

@@ -149,7 +146,7 @@ export const SPECIAL_INTEREST_CREATION_TEMPLATE = (moderatorUserId: string) => (
"m.room.power_levels": 50,
},
},
invite: [moderatorUserId],
invite: moderatorUserIds,
Copy link
Contributor

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?

Copy link
Contributor Author

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
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.

2 participants