# HG changeset patch # User shinysky # Date 1332988360 -28800 # Node ID dcb8e7d2c7113ed506bd4cf3531374c9262a1aee # Parent c9084b4c14f0c81c8d70546da3460d2710e7dbae mod_archive: applied patch from stephen.weber@gswot.org to fix issue 6 and 7; need fully test. diff -r c9084b4c14f0 -r dcb8e7d2c711 mod_archive/mod_archive.lua --- a/mod_archive/mod_archive.lua Tue Mar 27 17:11:26 2012 +0000 +++ b/mod_archive/mod_archive.lua Thu Mar 29 10:32:40 2012 +0800 @@ -760,10 +760,10 @@ if body then local from_node, from_host = jid.split(stanza.attr.from); local to_node, to_host = jid.split(stanza.attr.to); - if um.user_exists(from_node, from_host) and apply_pref(from_node, from_host, stanza.attr.to, thread) then + if hosts[from_host] and um.user_exists(from_node, from_host) and apply_pref(from_node, from_host, stanza.attr.to, thread) then store_msg(stanza, from_node, from_host, true); end - if um.user_exists(to_node, to_host) and apply_pref(to_node, to_host, stanza.attr.from, thread) then + if hosts[to_host] and um.user_exists(to_node, to_host) and apply_pref(to_node, to_host, stanza.attr.from, thread) then store_msg(stanza, to_node, to_host, false); end end @@ -787,6 +787,8 @@ module:hook("message/full", msg_handler, 10); module:hook("message/bare", msg_handler, 10); +module:hook("pre-message/full", msg_handler, 10); +module:hook("pre-message/bare", msg_handler, 10); -- TODO exactmatch -- TODO JID match