Software /
code /
prosody
Comparison
tools/ejabberd2prosody.lua @ 5998:60d86c9e02ec
tools/ejabberd2prosody: “xmlelement” can be “xmlel” in newer ejabberd (thanks cr).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 18 Jan 2014 17:24:10 -0500 |
parent | 5992:72157e928c23 |
child | 5999:e49c0c677c5d |
comparison
equal
deleted
inserted
replaced
5997:2d652afa57e4 | 5998:60d86c9e02ec |
---|---|
28 local dm = require "util.datamanager" | 28 local dm = require "util.datamanager" |
29 dm.set_data_path("data"); | 29 dm.set_data_path("data"); |
30 | 30 |
31 function build_stanza(tuple, stanza) | 31 function build_stanza(tuple, stanza) |
32 assert(type(tuple) == "table", "XML node is of unexpected type: "..type(tuple)); | 32 assert(type(tuple) == "table", "XML node is of unexpected type: "..type(tuple)); |
33 if tuple[1] == "xmlelement" then | 33 if tuple[1] == "xmlelement" or tuple[1] == "xmlel" then |
34 assert(type(tuple[2]) == "string", "element name has type: "..type(tuple[2])); | 34 assert(type(tuple[2]) == "string", "element name has type: "..type(tuple[2])); |
35 assert(type(tuple[3]) == "table", "element attribute array has type: "..type(tuple[3])); | 35 assert(type(tuple[3]) == "table", "element attribute array has type: "..type(tuple[3])); |
36 assert(type(tuple[4]) == "table", "element children array has type: "..type(tuple[4])); | 36 assert(type(tuple[4]) == "table", "element children array has type: "..type(tuple[4])); |
37 local name = tuple[2]; | 37 local name = tuple[2]; |
38 local attr = {}; | 38 local attr = {}; |