diff options
author | Kim Alvefur <zash@zash.se> | 2019-04-29 02:38:55 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-04-29 02:38:55 +0200 |
commit | 00887cf07d565353152332f0adb854659e237fbf (patch) | |
tree | 6d9aa17b1282dd1de0384dd1cd3854858ea1aad0 /plugins/mod_mimicking.lua | |
parent | 1054f2438b2f56790a7d5dcdcb3f841d460d27e7 (diff) | |
download | prosody-00887cf07d565353152332f0adb854659e237fbf.tar.gz prosody-00887cf07d565353152332f0adb854659e237fbf.zip |
mod_mimicking: Use new storage API
Diffstat (limited to 'plugins/mod_mimicking.lua')
-rw-r--r-- | plugins/mod_mimicking.lua | 9 |
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); |