diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_message_logging/mod_message_logging.lua --- a/mod_message_logging/mod_message_logging.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_message_logging/mod_message_logging.lua Tue Mar 11 18:44:01 2014 +0100 @@ -53,14 +53,14 @@ local function handle_incoming_message(event) local origin, stanza = event.origin, event.stanza; local message_type = stanza.attr.type; - + if message_type == "error" then return; end - + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); local body = stanza:get_child("body"); if not body then return; end body = body:get_text(); - + local f = open_files[to]; if not f then return; end if message_type == "groupchat" then @@ -75,14 +75,14 @@ local function handle_outgoing_message(event) local origin, stanza = event.origin, event.stanza; local message_type = stanza.attr.type; - + if message_type == "error" or message_type == "groupchat" then return; end - + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); local body = stanza:get_child("body"); if not body then return; end body = body:get_text(); - + local f = open_files[from]; if not f then return; end body = body:gsub("\n", "\n "); -- Indent newlines @@ -100,11 +100,11 @@ module:hook("message/bare", handle_incoming_message, 1); module:hook("message/full", handle_incoming_message, 1); - + module:hook("pre-message/bare", handle_outgoing_message, 1); module:hook("pre-message/full", handle_outgoing_message, 1); module:hook("pre-message/host", handle_outgoing_message, 1); - + end function module.command(arg)