diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-23 18:16:36 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-23 18:16:36 +0200 |
commit | d0b6d2010c6badde88a1493ea67fc19d94ccff4c (patch) | |
tree | cf35a00974a297951aa5c9db8694084602647b1f /util | |
parent | 7de53c6cd6514dc92b5dc4148a63504628e3b5fa (diff) | |
download | prosody-d0b6d2010c6badde88a1493ea67fc19d94ccff4c.tar.gz prosody-d0b6d2010c6badde88a1493ea67fc19d94ccff4c.zip |
util.rsm: Fix passing number as attribute
Diffstat (limited to 'util')
-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 |