-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: main
Are you sure you want to change the base?
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? |
@@ -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) { |
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.
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.
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[]) { |
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.
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.
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); | ||
} | ||
} | ||
} |
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.
newline please
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