# HG changeset patch # User Kim Alvefur # Date 1339127784 -7200 # Node ID d94ee0848b27ab9128af1d4aeb4da580a6938536 # Parent cc5805f83583f459cfce0f300d2cc13478e59642 mod_mam: Fix issue with get_text() and clean some unneeded variables. diff -r cc5805f83583 -r d94ee0848b27 mod_mam/mod_mam.lua --- a/mod_mam/mod_mam.lua Fri Jun 08 03:13:31 2012 +0200 +++ b/mod_mam/mod_mam.lua Fri Jun 08 05:56:24 2012 +0200 @@ -146,7 +146,6 @@ for i=start,#data do local item = data[i]; local when, with, with_bare = item.when, item.with, item.with_bare; - local ts = item.timestamp; local id = item.id; --module:log("debug", "id is %s", id); @@ -168,7 +167,7 @@ local fwd_st = st.message{ to = origin.full_jid } :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }):up() :tag("forwarded", { xmlns = xmlns_forward }) - :tag("delay", { xmlns = xmlns_delay, stamp = ts or timestamp(when) }):up(); + :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); local orig_stanza = st.deserialize(item.stanza); orig_stanza.attr.xmlns = "jabber:client"; fwd_st:add_child(orig_stanza); @@ -198,7 +197,7 @@ end -- That's all folks! module:log("debug", "Archive query %s completed", tostring(qid)); - origin.send(st.reply(stanza):add_child(rsm.generate{first = { index = index; first }, last = last})); + origin.send(st.reply(stanza):add_child(rsm.generate{last = last})); return true end end); diff -r cc5805f83583 -r d94ee0848b27 mod_mam/rsm.lib.lua --- a/mod_mam/rsm.lib.lua Fri Jun 08 03:13:31 2012 +0200 +++ b/mod_mam/rsm.lib.lua Fri Jun 08 05:56:24 2012 +0200 @@ -9,7 +9,7 @@ do local function xs_int(st) - return tonumber(st:get_text()); + return tonumber((st:get_text())); end local function xs_string(st) return st:get_text();