aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ejabberdsql2prosody.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/ejabberdsql2prosody.lua b/tools/ejabberdsql2prosody.lua
index 21d480ea..4aace085 100644
--- a/tools/ejabberdsql2prosody.lua
+++ b/tools/ejabberdsql2prosody.lua
@@ -278,6 +278,12 @@ function roster_group(node, host, jid, group)
local ret, err = dm.store(node, host, "roster", roster);
print("["..(err or "success").."] roster-group: " ..node.."@"..host.." - "..jid.." - "..group);
end
+function private_storage(node, host, xmlns, stanza)
+ local private = dm.load(node, host, "private") or {};
+ private[stanza.name..":"..xmlns] = st.preserialize(stanza);
+ local ret, err = dm.store(node, host, "private", private);
+ print("["..(err or "success").."] private: " ..node.."@"..host.." - "..xmlns);
+end
for i, row in ipairs(t["rosterusers"] or NULL) do
local node, contact = row.username, row.jid;
local name = row.nick;
@@ -314,3 +320,6 @@ for i, row in ipairs(t["vcard"] or NULL) do
local ret, err = dm.store(row.username, host, "vcard", st.preserialize(parse_xml(row.vcard)));
print("["..(err or "success").."] vCard: "..row.username.."@"..host);
end
+for i, row in ipairs(t["private_storage"] or NULL) do
+ private_storage(row.username, host, row.namespace, st.preserialize(parse_xml(row.data)));
+end