X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=tools%2Fejabberd2prosody.lua;h=7b19260d749fc2cc74fc0e9bc8eb2bda401a68a6;hb=fde73ce4ee084193e3b66cbde193690a1df63cbd;hp=c18056c127a4dd2e920633c1f883604df36f16e7;hpb=1fcbec749479d8e6f4be2c336e3711fe3d191bde;p=prosody.git diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua index c18056c1..7b19260d 100755 --- a/tools/ejabberd2prosody.lua +++ b/tools/ejabberd2prosody.lua @@ -91,13 +91,24 @@ local filters = { local name = tuple[5]; local subscription = tuple[6]; local ask = tuple[7]; local groups = tuple[8]; if type(name) ~= type("") then name = nil; end - if ask == "none" then ask = nil; elseif ask == "out" then ask = "subscribe" elseif ask == "in" then + if ask == "none" then + ask = nil; + elseif ask == "out" then + ask = "subscribe" + elseif ask == "in" then roster_pending(node, host, contact); - return; - else error(ask) end + ask = nil; + elseif ask == "both" then + roster_pending(node, host, contact); + ask = "subscribe"; + 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)