Comparison

tools/ejabberd2prosody.lua @ 1126:f6dc334d9836

tools/ejabberd2prosody: Fixed private storage export
author Waqas Hussain <waqas20@gmail.com>
date Tue, 05 May 2009 21:13:09 +0500
parent 896:2c0b9e3c11c3
child 1523:841d61be198f
comparison
equal deleted inserted replaced
1125:ad7c1cefb8eb 1126:f6dc334d9836
59 local ret, err = dm.store(node, host, "roster", roster); 59 local ret, err = dm.store(node, host, "roster", roster);
60 print("["..(err or "success").."] roster: " ..node.."@"..host.." - "..jid); 60 print("["..(err or "success").."] roster: " ..node.."@"..host.." - "..jid);
61 end 61 end
62 function private_storage(node, host, xmlns, stanza) 62 function private_storage(node, host, xmlns, stanza)
63 local private = dm.load(node, host, "private") or {}; 63 local private = dm.load(node, host, "private") or {};
64 private[xmlns] = st.preserialize(stanza); 64 private[stanza.name..":"..xmlns] = st.preserialize(stanza);
65 local ret, err = dm.store(node, host, "private", private); 65 local ret, err = dm.store(node, host, "private", private);
66 print("["..(err or "success").."] private: " ..node.."@"..host.." - "..xmlns); 66 print("["..(err or "success").."] private: " ..node.."@"..host.." - "..xmlns);
67 end 67 end
68 function offline_msg(node, host, t, stanza) 68 function offline_msg(node, host, t, stanza)
69 stanza.attr.stamp = os.date("!%Y-%m-%dT%H:%M:%SZ", t); 69 stanza.attr.stamp = os.date("!%Y-%m-%dT%H:%M:%SZ", t);