Comparison

tools/ejabberd2prosody.lua @ 6028:14c63b8c3e06

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Wed, 26 Feb 2014 22:22:43 +0100
parent 6027:8c69cea8a1bf
child 6284:b49540983320
comparison
equal deleted inserted replaced
6022:b5771e83a0ee 6028:14c63b8c3e06
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)