Comparison

tools/ejabberdsql2prosody.lua @ 1649:a6698ab04039

ejabberdsql2prosody: Removed unnecessary stanza reserialization for private storage
author Waqas Hussain <waqas20@gmail.com>
date Sat, 08 Aug 2009 23:23:21 +0500
parent 1648:b05371e6f058
child 2688:95d665f20c71
comparison
equal deleted inserted replaced
1648:b05371e6f058 1649:a6698ab04039
325 for i, row in ipairs(t["vcard"] or NULL) do 325 for i, row in ipairs(t["vcard"] or NULL) do
326 local ret, err = dm.store(row.username, host, "vcard", st.preserialize(parse_xml(row.vcard))); 326 local ret, err = dm.store(row.username, host, "vcard", st.preserialize(parse_xml(row.vcard)));
327 print("["..(err or "success").."] vCard: "..row.username.."@"..host); 327 print("["..(err or "success").."] vCard: "..row.username.."@"..host);
328 end 328 end
329 for i, row in ipairs(t["private_storage"] or NULL) do 329 for i, row in ipairs(t["private_storage"] or NULL) do
330 private_storage(row.username, host, row.namespace, st.preserialize(parse_xml(row.data))); 330 private_storage(row.username, host, row.namespace, parse_xml(row.data));
331 end 331 end
332 table.sort(t["spool"] or NULL, function(a,b) return a.seq < b.seq; end); -- sort by sequence number, just in case 332 table.sort(t["spool"] or NULL, function(a,b) return a.seq < b.seq; end); -- sort by sequence number, just in case
333 local time_offset = os.difftime(os.time(os.date("!*t")), os.time(os.date("*t"))) -- to deal with timezones 333 local time_offset = os.difftime(os.time(os.date("!*t")), os.time(os.date("*t"))) -- to deal with timezones
334 local date_parse = function(s) 334 local date_parse = function(s)
335 local year, month, day, hour, min, sec = s:match("(....)-?(..)-?(..)T(..):(..):(..)"); 335 local year, month, day, hour, min, sec = s:match("(....)-?(..)-?(..)T(..):(..):(..)");