Skip to content
  • Deimos's avatar
    Add ability to process posts with Lua scripts · 5fbc72c4
    Deimos authored
    This adds the backend pieces (no interface yet) to configure Lua scripts
    that will be applied to topics and comments due to different events.
    Initially, it only supports running a script when a new topic or comment
    is posted. For example, here is a Lua script that would prepend a new
    topic's title with "[Text] " or "[Link] " depending on its type, as well
    as replace its tags with either "text" or "link":
    function on_topic_post (topic)
        if (topic.is_text_type) then
            topic.title = "[Text] " .. topic.title
            topic.tags = {"text"}
        elseif (topic.is_link_type) then
            topic.title = "[Link] " .. topic.title
            topic.tags = {"link"}
    There can be a global script as well as group-specific scripts, and the
    scripts are sandboxed, with limited access to data as well as being
    restricted to a subset of Lua's built-in functions. The Lua sandboxing
    code comes from Splash ( It will
    need to be mod...