# HG changeset patch # User Waqas Hussain # Date 1253217252 -18000 # Node ID dd819e5bb0b8e25c1c7559b1c8498471402ee81f # Parent b3eee615159230ceed999bb3563aabcec47c55c6 ejabberd2prosody: Added support for ask='both' in subscriptions. diff -r b3eee6151592 -r dd819e5bb0b8 tools/ejabberd2prosody.lua --- a/tools/ejabberd2prosody.lua Mon Sep 14 02:11:17 2009 +0500 +++ b/tools/ejabberd2prosody.lua Fri Sep 18 00:54:12 2009 +0500 @@ -91,10 +91,17 @@ 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