aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-04-29 02:38:55 +0200
committerKim Alvefur <zash@zash.se>2019-04-29 02:38:55 +0200
commitfe0ba7ac7ce6f9696d4b94c07676a279920758f8 (patch)
tree6d9aa17b1282dd1de0384dd1cd3854858ea1aad0 /plugins
parent0ec982877caed14891aa11b308ae7fb3cb032acd (diff)
downloadprosody-fe0ba7ac7ce6f9696d4b94c07676a279920758f8.tar.gz
prosody-fe0ba7ac7ce6f9696d4b94c07676a279920758f8.zip
mod_mimicking: Use new storage API
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_mimicking.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/mod_mimicking.lua b/plugins/mod_mimicking.lua
index 8b8d6ee3..0da68059 100644
--- a/plugins/mod_mimicking.lua
+++ b/plugins/mod_mimicking.lua
@@ -10,21 +10,22 @@ local encodings = require "util.encodings";
assert(encodings.confusable, "This module requires that Prosody be built with ICU");
local skeleton = encodings.confusable.skeleton;
-local datamanager = require "util.datamanager";
local usage = require "util.prosodyctl".show_usage;
local warn = require "util.prosodyctl".show_warning;
local users = require "usermanager".users;
+local skeletons = module:open_store("skeletons");
+
module:hook("user-registered", function(user)
- datamanager.store(skeleton(user.username), user.host, "skeletons", {username = user.username});
+ skeletons:set(skeleton(user.username), { username = user.username });
end);
module:hook("user-deleted", function(user)
- datamanager.store(skeleton(user.username), user.host, "skeletons", nil);
+ skeletons:set(skeleton(user.username), nil);
end);
module:hook("user-registering", function(user)
- if datamanager.load(skeleton(user.username), user.host, "skeletons") then
+ if skeletons:get(skeleton(user.username)) then
user.allowed = false;
end
end);