diff options
-rw-r--r-- | util/rsm.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/rsm.lua b/util/rsm.lua index 40a78fb5..b5afd62a 100644 --- a/util/rsm.lua +++ b/util/rsm.lua @@ -11,9 +11,14 @@ local stanza = require"util.stanza".stanza; local tostring, tonumber = tostring, tonumber; +local s_format = string.format; local type = type; local pairs = pairs; +local function inttostr(n) + return s_format("%d", n); +end + local xmlns_rsm = 'http://jabber.org/protocol/rsm'; local element_parsers = {}; @@ -45,7 +50,7 @@ end local element_generators = setmetatable({ first = function(st, data) if type(data) == "table" then - st:tag("first", { index = data.index }):text(data[1]):up(); + st:tag("first", { index = inttostr(data.index) }):text(data[1]):up(); else st:tag("first"):text(tostring(data)):up(); end |