aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ejabberd2prosody.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-18 00:54:12 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-18 00:54:12 +0500
commit7fc7394567964bd3b9791a2f01c22f0cf295f536 (patch)
tree2090e7d657eb6cf57897e967b26a89625796221e /tools/ejabberd2prosody.lua
parent45567765421d46ff2ec60874e63bb1375759318b (diff)
downloadprosody-7fc7394567964bd3b9791a2f01c22f0cf295f536.tar.gz
prosody-7fc7394567964bd3b9791a2f01c22f0cf295f536.zip
ejabberd2prosody: Added support for ask='both' in subscriptions.
Diffstat (limited to 'tools/ejabberd2prosody.lua')
-rwxr-xr-xtools/ejabberd2prosody.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index c18056c1..3bcf8a2e 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -91,10 +91,17 @@ 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