# HG changeset patch # User Matthew Wild # Date 1253912056 -3600 # Node ID 316e8437f233fa2c7a01dfa0c0a3edbb82e9ed61 # Parent 7d70faba234c8ca005f80b03369a9dfda874d6fb mod_pastebin: Allow configurable message length threshold diff -r 7d70faba234c -r 316e8437f233 mod_pastebin/mod_pastebin.lua --- a/mod_pastebin/mod_pastebin.lua Fri Sep 25 21:50:01 2009 +0200 +++ b/mod_pastebin/mod_pastebin.lua Fri Sep 25 21:54:16 2009 +0100 @@ -2,8 +2,9 @@ local st = require "util.stanza"; local httpserver = require "net.httpserver"; local uuid_new = require "util.uuid".generate; +local os_time = os.time; -local os_time = os.time; +local length_threshold = config.get("*", "core", "pastebin_threshold"); local base_url; @@ -46,7 +47,7 @@ module:log("debug", "Body(%s) length: %d", type(body), #(body or "")); - if body and #body > 500 then + if body and #body > length_threshold then local url = pastebin_message(body); module:log("debug", "Pasted message as %s", url); --module:log("debug", " stanza[bodyindex] = %q", tostring( stanza[bodyindex]));