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

Incorperate Mjolnir's new report-to-moderator features #8

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

Conversation

Traditionally, when a user clicks "report" in a Matrix client, this goes
to the homeserver administrator, who often is the wrong person for the job.

MSC3215 introduces a mechanism to let clients cooperate with a bot to send
the report to the moderator instead. Client support has landed in Element Web
(behind a Labs flag) in in 2021. This allows Mjölnir to serve as the partner
bot.
@Gnuxie
Copy link
Member Author

Gnuxie commented Jan 26, 2023

Related MSC matrix-org/matrix-spec-proposals#3215

Where is the routing bot?

@@ -129,7 +129,7 @@ export class Mjolnir {
if (options.autojoinOnlyIfManager) {
const managers = await client.getJoinedRoomMembers(mjolnir.managementRoomId);
if (!managers.includes(membershipEvent.sender)) return reportInvite(); // ignore invite
} else {
} else if (options.acceptInvitesFromSpace) {
Copy link
Member Author

Choose a reason for hiding this comment

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

check why this was changed. doesn't look good

Comment on lines -118 to -123
/**
* The protection manager is only used to verify the permissions
* that the protection manager requires are correct for this set of rooms.
* The protection manager is not really compatible with this abstraction yet
* because of a direct dependency on the protection manager in Mjolnir commands.
*/
Copy link
Member Author

Choose a reason for hiding this comment

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

Why was this deleted, is the comment still true?

const EVENT_MODERATOR_OF = "org.matrix.msc3215.room.moderation.moderator_of";

// !mjolnir rooms setup <room alias/ID> reporting
export async function execSetupProtectedRoom(commandRoomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
Copy link
Member Author

Choose a reason for hiding this comment

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

upgrade this to a new style command

Comment on lines +79 to +93
# Creating a few users simplifies testing.
users:
- localname: admin
admin: true
rooms:
- public: true
name: "List of users"
alias: access-control-list
members:
- admin
- user_in_mjolnir_for_all
# This user can use Mjölnir-for-all
- localname: user_in_mjolnir_for_all
# This user cannot
- localname: user_regular
Copy link
Member Author

Choose a reason for hiding this comment

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

This probably shouldn't be part of the PR, it's about testing Mjolnir for all

mjolnir.managementRoomOutput.logMessage(LogLevel.ERROR, "LocalAbuseReports", ex.message);
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

newline please

@Gnuxie
Copy link
Member Author

Gnuxie commented Feb 1, 2023

So it seems the way this is implemented (which I believe is inaccurate when compared to the MSC) is that the reporter sends an invite to Mjolnir to a DM where the reporter will send the report event.

Unfortunately this just won't work because it conflicts with config.protectAllJoinedRooms and allows people to invite the bot account anywhere

@Gnuxie
Copy link
Member Author

Gnuxie commented Feb 1, 2023

matrix-org/mjolnir#475

@Gnuxie
Copy link
Member Author

Gnuxie commented Feb 8, 2023

Are reports end-to-end encrypted? This is something that makes needing a relay user even more problematic.

I guess for conig.protectAllJoinedRooms We can just check who has invited before deciding whether to protect the room, or simply make it incompatible. Alternatively we could ask for a new room type for the relay rooms, but that requires fixing element and the MSC.

@Gnuxie
Copy link
Member Author

Gnuxie commented Sep 4, 2023

I say we clone the MSC and have a room type for report tickets. We can consult nheko or fluffy on client UX and develop the event model ourselves with a bot command (or a widget if we're feeling adventurous).

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.

None yet

2 participants