Skip to content

Prevent mjolnir self-kick - #688

Open
crime-think wants to merge 5 commits into
matrix-org:mainfrom
crime-think:pull-branch
Open

crime-think wants to merge 5 commits into
matrix-org:mainfrom
crime-think:pull-branch

Conversation

@crime-think

Copy link
Copy Markdown

fix to issue #647

@crime-think
crime-think marked this pull request as ready for review July 14, 2026 14:12
@crime-think
crime-think requested a review from a team as a code owner July 14, 2026 14:12

@Half-Shot Half-Shot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to me!

@crime-think
crime-think marked this pull request as draft July 14, 2026 15:21
@crime-think
crime-think marked this pull request as ready for review July 14, 2026 15:47
@H-Shay

H-Shay commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@crime-think thanks for doing this! Would you be willing to add a quick test in /test/integration/commands?

@@ -0,0 +1,57 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 2026

await mod.setUserPowerLevel(botId, targetRoom, 100);

await mod.sendMessage(this.mjolnir.managementRoomId, {
msgtype: "m.text.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msgtype: "m.text.",
msgtype: "m.text",

@H-Shay

H-Shay commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@crime-think thanks for the test - I just noticed a few tiny nits. Also could you just add a section to the test demonstrating a successful kick of a non-bot user? Otherwise I think this is ready to go :)

});
});
await reply;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it would be good to assert that the bot is still in the room in addition to verifying that the warning message fired.

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