Closed turt2live closed 3 years ago
Rough sketch of how this could work:
/account/whoami
against the configured homeserver.FYI the synapse admin API now has a report endpoint. You could in theory do a poor mans poll of the endpoint without having to intercept it.
Something like this would be best to work on all homeserver implementations, not just Synapse.
I think that we could start with a semi-trivial implementation that displays the (unformatted) abuse report in a room, then grow from there.
Thanks for taking a look at this. Some things that I would find helpful in in "enhanced" reports might include:
I explicitly don't think we should have anything like ban-a-whole-server in there, that is a bigger decision that shouldn't be something you can accidentally click on.
for hiding the message, we have spoilers we can leverage (click-to-reveal)
a way to see the offending message, in some way that doesn't display it by default to the moderation channel.
We can send this as <span data-mx-spoiler="">spoiler</span>
. Would that do the trick for you?
You can test the result by writing the following in your element-web:
/html This is a <span data-mx-spoiler="">spoiler</span>
a way to act on the report directly, with a click. e.g. a ban user button, maybe with a "redact?" checkbox
Not sure we can read the value of a checkbox from a bot... but we might be able to fake it by making it a <a href="..."><img></a>
of a checkbox.
Not sure we can read the value of a checkbox from a bot... but we might be able to fake it by making it a
<a href="..."><img></a>
of a checkbox.
You could just have mjolnir place a reaction on the message and then ban if someone sends the same reaction (so it is the equivalent of a button press), some other bots already use reactions like this iirc.
I'll try and prototype something.
I've just opened a PR for the first part: intercepting /report
and displaying human-readable abuse reports.
The next step will be simplifying user interactions.
I see three ways of doing this:
- To mute the author of event X, write `!mjolnir mute ...`.
- To ban the author of event X, write `!mjolnir ban ....`.
- ...
You may respond with `~mute`, `~ban`, `~handled`, `~redact`...
Options 1. and 3. are more verbose but they preserve some kind of timeline and authorship. I also hope that 3. will play nicely with threads once we have them. Option 2. is concise but I fear that there's a risk of accidentally clicking on the wrong sticker. This probably doesn't matter all that much if there's a good way to cancel such operations.
Not sure which one is best, tbh.
Stuff like sending to moderators (a popular request) first, approve/disapprove of recommended actions, and general cataloguing.
We'd intercept the
/report
endpoint from Matrix at the reverse proxy level for the homeserver, and do things with it. Common requests are documented in the comment below.