aboutsummaryrefslogtreecommitdiffstats
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
commitbbc49bbfb37ea2bfb026a99651e89bb7b349e65b (patch)
tree78c3a20b442506b3364f6b833091045bc4ac9b2c
parent07e67e32f3f78dcae90684dbff2adcc535887be7 (diff)
downloadprosody-bbc49bbfb37ea2bfb026a99651e89bb7b349e65b.tar.gz
prosody-bbc49bbfb37ea2bfb026a99651e89bb7b349e65b.zip
rostermanager: Use storagemanager
-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;