Changeset

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
parents 924:db022135aed4
children 926:ceaa7d54a3cb
files core/rostermanager.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
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