--- a/mod_pastebin/mod_pastebin.lua Sun Nov 01 01:10:02 2009 +0000
+++ b/mod_pastebin/mod_pastebin.lua Sun Nov 01 01:24:27 2009 +0000
@@ -14,13 +14,14 @@
local expire_after = math.floor((config.get(module.host, "core", "pastebin_expire_after") or 24) * 3600);
local pastes = {};
+local default_headers = { ["Content-Type"] = "text/plain; charset=utf-8" };
local xmlns_xhtmlim = "http://jabber.org/protocol/xhtml-im";
local xmlns_xhtml = "http://www.w3.org/1999/xhtml";
function pastebin_text(text)
local uuid = uuid_new();
- pastes[uuid] = { text = text, time = os_time() };
+ pastes[uuid] = { body = text, time = os_time(), headers = default_headers };
pastes[#pastes+1] = uuid;
if not pastes[2] then -- No other pastes, give the timer a kick
add_task(expire_after, expire_pastes);
@@ -36,7 +37,7 @@
--module:log("debug", "Received request, replying: %s", pastes[pasteid].text);
- return pastes[pasteid].text;
+ return pastes[pasteid];
end
function check_message(data)