Changeset

2046:3992541f8a48

rostermanager: Remove self-contacts from loaded rosters.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 22 Oct 2009 03:34:08 +0500
parents 2045:3b7473a3fa44
children 2047:fb236904c959
files core/rostermanager.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/rostermanager.lua	Thu Oct 22 02:26:27 2009 +0500
+++ b/core/rostermanager.lua	Thu Oct 22 03:34:08 2009 +0500
@@ -89,6 +89,7 @@
 			log("debug", "load_roster: loading for new user: "..username.."@"..host);
 			roster = datamanager.load(username, host, "roster") or {};
 			if not roster[false] then roster[false] = { }; end
+			roster[username.."@"..host] = nil;
 			hosts[host].sessions[username].roster = roster;
 			hosts[host].events.fire_event("roster-load", username, host, roster);
 		end
@@ -98,6 +99,7 @@
 	-- Attempt to load roster for non-loaded user
 	log("debug", "load_roster: loading for offline user: "..username.."@"..host);
 	roster = datamanager.load(username, host, "roster") or {};
+	roster[username.."@"..host] = nil;
 	hosts[host].events.fire_event("roster-load", username, host, roster);
 	return roster;
 end