# HG changeset patch # User Matthew Wild # Date 1316692053 -3600 # Node ID 7f0cdde1e42adc7ee6ceea8cbef92cc6a9ab3c55 # Parent 78a2a6b2bea39ad7e884fa3e981c83d14fb4e547 mod_pastebin: Add option 'pastebin_private_messages', defaults to false for components and true for other hosts (thanks Kelden/Maranda) diff -r 78a2a6b2bea3 -r 7f0cdde1e42a mod_pastebin/mod_pastebin.lua --- a/mod_pastebin/mod_pastebin.lua Tue Sep 20 23:31:43 2011 +0000 +++ b/mod_pastebin/mod_pastebin.lua Thu Sep 22 12:47:33 2011 +0100 @@ -6,6 +6,8 @@ local t_insert, t_remove = table.insert, table.remove; local add_task = require "util.timer".add_task; +local pastebin_private_messages = module:get_option_boolean("pastebin_private_messages", hosts[module.host].type ~= "component"); + local function drop_invalid_utf8(seq) local start = seq:byte(); module:log("utf8: %d, %d", start, #seq); @@ -93,6 +95,9 @@ end module:hook("message/bare", check_message); +if pastebin_private_messages then + module:hook("message/full", check_message); +end function expire_pastes(time) time = time or os_time(); -- COMPAT with 0.5