From 2bf0d50232994a42e4a250b124fbbba01dfef57a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 22 May 2010 05:50:47 +0500 Subject: rostermanager: When loading the roster, also return a datamanager error if available. --- core/rostermanager.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index e2a92696..a8eb806c 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -93,7 +93,8 @@ function load_roster(username, host) 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 @@ function load_roster(username, host) 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) -- cgit v1.2.3