aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-02-09 17:01:04 +0100
committerKim Alvefur <zash@zash.se>2016-02-09 17:01:04 +0100
commit3977731fad75dd16a6a08a5e7ebc73bc340938ab (patch)
tree78c3a20b442506b3364f6b833091045bc4ac9b2c /core/rostermanager.lua
parent315a1fc1ca3d6e316088cf0aec66a738a8955cbf (diff)
downloadprosody-3977731fad75dd16a6a08a5e7ebc73bc340938ab.tar.gz
prosody-3977731fad75dd16a6a08a5e7ebc73bc340938ab.zip
rostermanager: Use storagemanager
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r--core/rostermanager.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index 0b72d0a6..e6c9ff03 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -18,7 +18,6 @@ local type = type;
local hosts = hosts;
local bare_sessions = prosody.bare_sessions;
-local datamanager = require "util.datamanager"
local um_user_exists = require "core.usermanager".user_exists;
local st = require "util.stanza";
@@ -109,7 +108,8 @@ local function load_roster(username, host)
else -- Attempt to load roster for non-loaded user
log("debug", "load_roster: loading for offline user: %s@%s", username, host);
end
- local data, err = datamanager.load(username, host, "roster");
+ local roster_store = require "core.storagemanager".open(host, "roster", "keyval");
+ local data, err = roster_store:get(username);
roster = data or {};
if user then user.roster = roster; end
roster_metadata(roster, err);
@@ -143,7 +143,8 @@ function save_roster(username, host, roster)
metadata.version = (metadata.version or 0) + 1;
end
if metadata.broken then return nil, "Not saving broken roster" end
- return datamanager.store(username, host, "roster", roster);
+ local roster_store = require "core.storagemanager".open(host, "roster", "keyval");
+ return roster_store:set(username, roster);
end
log("warn", "save_roster: user had no roster to save");
return nil;