diff mod_pastebin/mod_pastebin.lua @ 15:14b18ef8b554

merge with repos
author Thilo Cestonaro <thilo@cestona.ro>
date Sat, 26 Sep 2009 22:30:33 +0200
parents 135855b685d6
children 4f18696f043a
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua	Sat Sep 26 22:22:51 2009 +0200
+++ b/mod_pastebin/mod_pastebin.lua	Sat Sep 26 22:30:33 2009 +0200
@@ -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") or 500;
 
 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]));