# HG changeset patch # User syn@syn.im # Date 1406750336 -7200 # Node ID db870913e1cf15bb2e49b46ba752e8168371a05b # Parent 08ca6dd36e39c4004134b545505680a1d8609cf3 mod_mam_archive: Doing stanza deserialization after mod_storage the right way diff -r 08ca6dd36e39 -r db870913e1cf mod_mam_archive/mod_mam_archive.lua --- a/mod_mam_archive/mod_mam_archive.lua Wed Jul 30 21:27:56 2014 +0200 +++ b/mod_mam_archive/mod_mam_archive.lua Wed Jul 30 21:58:56 2014 +0200 @@ -268,9 +268,14 @@ module:log("debug", "Count "..count); for id, item, when in data do - local tag = jid_bare(item["attr"]["from"]) == jid_bare(origin.full_jid) and "from" or "to"; + if not getmetatable(item) == st.stanza_mt then + item = st.deserialize(item); + end + module:log("debug", tostring(item)); + + local tag = jid_bare(item.attr["from"]) == jid_bare(origin.full_jid) and "from" or "to"; tag = chat:tag(tag, {secs = when - qstart}); - tag:tag("body"):text(item[2][1]):up():up(); + tag:add_child(item:get_child("body")):up(); end origin.send(reply);