aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-08-02 14:40:34 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-08-02 14:40:34 +0500
commit21801b6bf4a4227ec17c5bab7ea9f07b1d66faa4 (patch)
tree0e726b64374272c77331e53ad34e158d55277400
parentf964308d22d06fa551f11c5df0034a40dabe9eae (diff)
downloadprosody-21801b6bf4a4227ec17c5bab7ea9f07b1d66faa4.tar.gz
prosody-21801b6bf4a4227ec17c5bab7ea9f07b1d66faa4.zip
ejabberdsql2prosody: Added support for Private XML Storage
-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