Software /
code /
prosody
Comparison
tools/ejabberd2prosody.lua @ 6027:8c69cea8a1bf
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 26 Feb 2014 22:21:55 +0100 |
parent | 6007:ff24bc2d41a6 |
parent | 6024:c352d97cf137 |
child | 6284:b49540983320 |
comparison
equal
deleted
inserted
replaced
6021:f8c17af769d9 | 6027:8c69cea8a1bf |
---|---|
42 local up; | 42 local up; |
43 if stanza then stanza:tag(name, attr); up = true; else stanza = st.stanza(name, attr); end | 43 if stanza then stanza:tag(name, attr); up = true; else stanza = st.stanza(name, attr); end |
44 for _, a in ipairs(tuple[4]) do build_stanza(a, stanza); end | 44 for _, a in ipairs(tuple[4]) do build_stanza(a, stanza); end |
45 if up then stanza:up(); else return stanza end | 45 if up then stanza:up(); else return stanza end |
46 elseif tuple[1] == "xmlcdata" then | 46 elseif tuple[1] == "xmlcdata" then |
47 assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2])); | 47 if type(tuple[2]) ~= "table" then |
48 stanza:text(tuple[2]); | 48 assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2])); |
49 stanza:text(tuple[2]); | |
50 end -- else it's [], i.e., the null value, used for the empty string | |
49 else | 51 else |
50 error("unknown element type: "..serialize(tuple)); | 52 error("unknown element type: "..serialize(tuple)); |
51 end | 53 end |
52 end | 54 end |
53 function build_time(tuple) | 55 function build_time(tuple) |