Pluggable activity handlers

Pleroma server has a subsystem called Message Rewrite Facility (MRF):

The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages.
Possible uses include:

  • marking incoming messages with media from a given account or instance as sensitive
  • rejecting messages from a specific instance
  • rejecting reports (flags) from a specific instance
  • removing/unlisting messages from the public timelines
  • removing media from messages
  • sending only public messages to a specific instance

The possibilities are truly limitless. Instance administrators can add/remove modules, write their own and share them. Unfortunately, Pleroma MRF modules are written in Elixir, and therefore can’t be easily used on other platforms.

What if we develop a standard for portable activity processing plugins? Plugins can be written in some lightweight scripting language such as Lua, or compiled into WebAssembly. I think this kind of plugin system could become indispensable for moderation and spam protection as the Fediverse grows.