From 1bb376c7864aca6334ac2af63a3d475a8f84cd7b Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 5 May 2009 21:13:09 +0500 Subject: tools/ejabberd2prosody: Fixed private storage export --- tools/ejabberd2prosody.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua index f2ea16f9..871130f4 100755 --- a/tools/ejabberd2prosody.lua +++ b/tools/ejabberd2prosody.lua @@ -61,7 +61,7 @@ function roster_pending(node, host, jid) end function private_storage(node, host, xmlns, stanza) local private = dm.load(node, host, "private") or {}; - private[xmlns] = st.preserialize(stanza); + 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 -- cgit v1.2.3 From fefd7ac17a34133e53fb0b0f300331aa4d4e41b4 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 5 May 2009 18:07:13 +0100 Subject: util.serialization: Write nil for non-serializable data types, and bump the log level to 'error' --- util/serialization.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/serialization.lua b/util/serialization.lua index 41d963e9..4da811ae 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -52,7 +52,8 @@ local function _simplesave(o, ind, t, func) elseif type(o) == "boolean" then func(t, (o and "true" or "false")); else - log("warn", "cannot serialize a %s: %s", type(o), debug_traceback()) + log("error", "cannot serialize a %s: %s", type(o), debug_traceback()) + func(t, "nil,\n"); end end -- cgit v1.2.3 -- cgit v1.2.3 From 95040378fd0373e8e17cddff42b7017d120b78c2 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 6 May 2009 21:45:02 +0100 Subject: util.prosodyctl: Import CFG_SOURCEDIR from the global environment (thanks macaronyde!) --- util/prosodyctl.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index 3b523a78..ce223459 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -9,6 +9,9 @@ local nodeprep, nameprep = stringprep.nodeprep, stringprep.nameprep; local io, os = io, os; local tostring, tonumber = tostring, tonumber; + +local CFG_SOURCEDIR = _G.CFG_SOURCEDIR; + module "prosodyctl" function adduser(params) -- cgit v1.2.3