Incorperate Mjolnir's new report-to-moderator features#8
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.
|
Related MSC matrix-org/matrix-spec-proposals#3215 Where is the routing bot? |
| const managers = await client.getJoinedRoomMembers(mjolnir.managementRoomId); | ||
| if (!managers.includes(membershipEvent.sender)) return reportInvite(); // ignore invite | ||
| } else { | ||
| } else if (options.acceptInvitesFromSpace) { |
There was a problem hiding this comment.
check why this was changed. doesn't look good
| /** | ||
| * 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. | ||
| */ |
There was a problem hiding this comment.
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[]) { |
There was a problem hiding this comment.
upgrade this to a new style command
| # 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 |
There was a problem hiding this comment.
This probably shouldn't be part of the PR, it's about testing Mjolnir for all
| mjolnir.managementRoomOutput.logMessage(LogLevel.ERROR, "LocalAbuseReports", ex.message); | ||
| } | ||
| } | ||
| } No newline at end of file |
|
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 |
|
Are reports end-to-end encrypted? This is something that makes needing a relay user even more problematic. I guess for |
|
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). |
Mangled in these commits were changes to display name. So that will follow afterwards
Checklist:
config.acceptInvitesFromSpace. matrix-org/mjolnir#475