Software /
code /
prosody-modules
Changeset
438:7f0cdde1e42a
mod_pastebin: Add option 'pastebin_private_messages', defaults to false for components and true for other hosts (thanks Kelden/Maranda)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 22 Sep 2011 12:47:33 +0100 |
parents | 437:78a2a6b2bea3 |
children | 439:c01679811fe8 |
files | mod_pastebin/mod_pastebin.lua |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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