Software /
code /
prosody
Diff
plugins/mod_private.lua @ 5500:eeea0eb2602a
mod_auth_internal_hashed, mod_auth_internal_plain, mod_privacy, mod_private, mod_register, mod_vcard, mod_muc: Use module:open_store()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 19 Apr 2013 16:14:06 +0200 |
parent | 5371:706206e191e8 |
child | 5776:bd0ff8ae98a8 |
line wrap: on
line diff
--- a/plugins/mod_private.lua Fri Apr 19 14:42:32 2013 +0200 +++ b/plugins/mod_private.lua Fri Apr 19 16:14:06 2013 +0200 @@ -9,7 +9,7 @@ local st = require "util.stanza" -local datamanager = require "util.datamanager" +local private_storage = module:open_store(); module:add_feature("jabber:iq:private"); @@ -20,7 +20,7 @@ if #query.tags == 1 then local tag = query.tags[1]; local key = tag.name..":"..tag.attr.xmlns; - local data, err = datamanager.load(origin.username, origin.host, "private"); + local data, err = private_storage:get(origin.username); if err then origin.send(st.error_reply(stanza, "wait", "internal-server-error")); return true; @@ -39,7 +39,7 @@ data[key] = st.preserialize(tag); end -- TODO delete datastore if empty - if datamanager.store(origin.username, origin.host, "private", data) then + if private_storage:set(origin.username, data) then origin.send(st.reply(stanza)); else origin.send(st.error_reply(stanza, "wait", "internal-server-error"));