diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-23 15:14:47 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-23 15:14:47 +0100 |
commit | a272d49260f7f211bc3fc290ac71ab77da2a9962 (patch) | |
tree | c9352f3197224088a16296c217e43ec770b21177 /plugins/mod_private.lua | |
parent | bc2cf7ee1976a358b1bead2fb047e71576b66d10 (diff) | |
parent | 06aa0018490c09f664e6a4f6233b29879b889263 (diff) | |
download | prosody-a272d49260f7f211bc3fc290ac71ab77da2a9962.tar.gz prosody-a272d49260f7f211bc3fc290ac71ab77da2a9962.zip |
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_private.lua')
-rw-r--r-- | plugins/mod_private.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua index 29d3162c..365a997c 100644 --- a/plugins/mod_private.lua +++ b/plugins/mod_private.lua @@ -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 @@ module:hook("iq/self/jabber:iq:private:query", function(event) 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 @@ module:hook("iq/self/jabber:iq:private:query", function(event) 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")); |