aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-05-22 05:50:47 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-05-22 05:50:47 +0500
commit2bf0d50232994a42e4a250b124fbbba01dfef57a (patch)
treee6a37cfba0da049b20f6fd883130abd850dffd52 /core/rostermanager.lua
parent4499df4f45b9101ccd9078099f9a224b82822cb0 (diff)
downloadprosody-2bf0d50232994a42e4a250b124fbbba01dfef57a.tar.gz
prosody-2bf0d50232994a42e4a250b124fbbba01dfef57a.zip
rostermanager: When loading the roster, also return a datamanager error if available.
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r--core/rostermanager.lua5
1 files changed, 3 insertions, 2 deletions
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)