bclindner / ivory

A Mastodon automoderator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mastodon API support

bclindner opened this issue · comments

Eugen has resumed work on the Moderation API and has contacted me directly about implementing it into Ivory as a test. I concur - currently a low priority task while I clean up the code but this needs to happen pretty soon. It would be ideal for this to be done before its official release so instance admins can get to using it straight away.

This needs to get done pretty quick - this is a big blocker for self-hosting, and causes the application to use waaaay more resources than it actually needs. I'll try to get it done in the next week - business trip means I don't have my usual distractions.

Well, that didn't happen. Working on it now, though - the base Driver class will need to be made a bit more generic, as prior base methods for that class depended on how I needed to do things in Selenium initially. Problem is, actions are going to be fundamentally different between the two driver implementations. It will be best here to just refactor the methods the Driver needs.

As far as I can tell, the report handling system only needs three steps:

  1. Get all reports
  2. Judge each report, and punish the offending user accordingly
  3. Add a note stating if a moderation action was taken

That can be boiled down to a get_unresolved_reports function that returns a Report list, a punish function that applies an action to a report, and an add_note function that notes a moderation action. The get_unresolved_report_ids needs to go.

That's fine, but the Moderation API has no facilities for adding notes (as far as I can tell - maybe I'm just not reading the right docs here). I've put in a ticket about it. For now I can just implement this by logging it to console as a stopgap measure.

3345ffc has this rework (and hopefully a good deal of the actual driver work - something tells me it's not that simple) mostly complete, though untested, unformatted, and honestly probably just a total mess. I'm not in an environment where I can actually run and test/debug this code right now, so I'll get it sorted out when I am.

Nevermind, check feature/rewrite. No point in the driver system much anymore, so I'm just gonna go ahead and write API stuff into Ivory directly.

Merged (#28). About time.