Changeset

3087:9b31e36528e0

rostermanager: When loading the roster, also return a datamanager error if available.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 22 May 2010 05:50:47 +0500
parents 3086:931acb1188b1
children 3088:a233aa051125
files core/rostermanager.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/rostermanager.lua	Sat May 22 05:49:21 2010 +0500
+++ b/core/rostermanager.lua	Sat May 22 05:50:47 2010 +0500
@@ -93,7 +93,8 @@
 	else -- Attempt to load roster for non-loaded user
 		log("debug", "load_roster: loading for offline user: "..username.."@"..host);
 	end
-	roster = datamanager.load(username, host, "roster") or {};
+	local data, err = datamanager.load(username, host, "roster");
+	roster = data or {};
 	if user then user.roster = roster; end
 	if not roster[false] then roster[false] = { }; end
 	if roster[jid] then
@@ -101,7 +102,7 @@
 		log("warn", "roster for "..jid.." has a self-contact");
 	end
 	hosts[host].events.fire_event("roster-load", username, host, roster);
-	return roster;
+	return roster, err;
 end
 
 function save_roster(username, host, roster)