aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-03-30 02:02:59 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-03-30 02:02:59 +0500
commit3570fb634c8e888c8cd418067bc35601405fb532 (patch)
treeaebfb526a1e5622259cc4b2cd6827ce46a4ae25f
parent0f9fd252f66c66629d1e59720750a972e5945cf5 (diff)
downloadprosody-3570fb634c8e888c8cd418067bc35601405fb532.tar.gz
prosody-3570fb634c8e888c8cd418067bc35601405fb532.zip
Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77)
-rw-r--r--core/rostermanager.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index fdaf64a7..867add2c 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -224,6 +224,10 @@ function subscribed(username, host, jid)
if is_contact_pending_in(username, host, jid) then
local roster = load_roster(username, host);
local item = roster[jid];
+ if not item then -- FIXME should roster item be auto-created?
+ item = {subscription = "none", groups = {}};
+ roster[jid] = item;
+ end
if item.subscription == "none" then
item.subscription = "from";
else -- subscription == to