# HG changeset patch # User Olivier Goffart # Date 1341403723 -7200 # Node ID e4ea03b060edaef7bcfb9c98ba9fcf85eb7cb8ce # Parent b031831b2ac09ebcf64a4d842c4ee0a74da2051b mod_archive: switch from/to The XEP-0136 is not very explicit about the meening of and elements, but the examples are clear: means it comes from the user in the 'with' attribute of the collection. That is the opposite of what is currently implemented in that module. So for better compatibility with complient clients, this switch the 'from' and 'to' fields diff -r b031831b2ac0 -r e4ea03b060ed mod_archive/mod_archive.lua --- a/mod_archive/mod_archive.lua Wed Jul 04 13:58:31 2012 +0200 +++ b/mod_archive/mod_archive.lua Wed Jul 04 14:08:43 2012 +0200 @@ -87,7 +87,7 @@ local thread = msg:child_with_name("thread"); local data = dm.list_load(node, host, ARCHIVE_DIR); local tag = isfrom and "from" or "to"; - local with = isfrom and msg.attr.to or msg.attr.from; + local with = isfrom and msg.attr.from or msg.attr.to; local utc_datetime = date_time(); local utc_secs = date_parse(utc_datetime); if data then @@ -759,11 +759,11 @@ end local function message_handler(data) - msg_handler(data, data.stanza.attr.to, data.stanza.attr.from, false) + msg_handler(data, data.stanza.attr.to, data.stanza.attr.from, true) end local function premessage_handler(data) - msg_handler(data, data.stanza.attr.from, data.stanza.attr.to, true) + msg_handler(data, data.stanza.attr.from, data.stanza.attr.to, false) end -- Preferences