Diff

core/rostermanager.lua @ 925:4861bcf0afa4

Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 30 Mar 2009 02:02:59 +0500
parent 916:f0743928ef7e
child 1380:9b3b43b8963a
line wrap: on
line diff
--- a/core/rostermanager.lua	Mon Mar 30 01:57:51 2009 +0500
+++ b/core/rostermanager.lua	Mon Mar 30 02:02:59 2009 +0500
@@ -224,6 +224,10 @@
 	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