X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=tools%2Fejabberd2prosody.lua;h=a231abd8c0505b7e1b5dae196cd7741e67fd5140;hb=ea1e4b31330ba5c043084ef4afbcdf5fa26986be;hp=3bcf8a2e80f0a439aabf7ba21e8e3dfd71bc92d1;hpb=746577fd9047aa2943c098c8e34ecd045314703d;p=prosody.git diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua index 3bcf8a2e..a231abd8 100755 --- a/tools/ejabberd2prosody.lua +++ b/tools/ejabberd2prosody.lua @@ -1,7 +1,7 @@ #!/usr/bin/env lua -- Prosody IM --- Copyright (C) 2008-2009 Matthew Wild --- Copyright (C) 2008-2009 Waqas Hussain +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. @@ -17,6 +17,8 @@ end require "erlparse"; +prosody = {}; + local serialize = require "util.serialization".serialize; local st = require "util.stanza"; package.loaded["util.logger"] = {init = function() return function() end; end} @@ -49,7 +51,7 @@ function vcard(node, host, stanza) end function password(node, host, password) local ret, err = dm.store(node, host, "accounts", {password = password}); - print("["..(err or "success").."] accounts: "..node.."@"..host.." = "..password); + print("["..(err or "success").."] accounts: "..node.."@"..host); end function roster(node, host, jid, item) local roster = dm.load(node, host, "roster") or {}; @@ -104,7 +106,11 @@ local filters = { else error("Unknown ask type: "..ask); end if subscription ~= "both" and subscription ~= "from" and subscription ~= "to" and subscription ~= "none" then error(subscription) end local item = {name = name, ask = ask, subscription = subscription, groups = {}}; - for _, g in ipairs(groups) do item.groups[g] = true; end + for _, g in ipairs(groups) do + if type(g) == "string" then + item.groups[g] = true; + end + end roster(node, host, contact, item); end; private_storage = function(tuple)