From 3570fb634c8e888c8cd418067bc35601405fb532 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 30 Mar 2009 02:02:59 +0500 Subject: Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77) --- core/rostermanager.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/rostermanager.lua') 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 -- cgit v1.2.3