diff options
author | Kim Alvefur <zash@zash.se> | 2017-04-26 12:11:11 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-04-26 12:11:11 +0200 |
commit | 0662d7b399963aab04a10138fc0578e02891b5ec (patch) | |
tree | 00f6cc4ecb9d16b19a78b2b5b1253bc49f8e4509 /plugins | |
parent | d00c4eecc2c0fe02b1fbff12a472a650d602c4de (diff) | |
download | prosody-0662d7b399963aab04a10138fc0578e02891b5ec.tar.gz prosody-0662d7b399963aab04a10138fc0578e02891b5ec.zip |
mod_pubsub: Store data in users store, node in 'with' metadata field
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_pubsub/pubsub.lib.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index d298d6ac..25a534b6 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -331,7 +331,7 @@ local function simple_itemstore(archive, config, user, node, expose_publisher) local get_set = {}; function get_set:items() local store = self.store; - local data, err = archive:find(node); + local data, err = archive:find(user, { with = node }); if not data then module:log("error", "Unable to get items: %s", err); return true; @@ -348,7 +348,8 @@ local function simple_itemstore(archive, config, user, node, expose_publisher) end function get_set:get(key) local store = self.store; - local data, err = archive:find(node, { + local data, err = archive:find(user, { + with = node; key = key; }); if not data then @@ -373,10 +374,11 @@ local function simple_itemstore(archive, config, user, node, expose_publisher) if value ~= nil then local publisher = value.attr.publisher; local payload = value.tags[1]; - data, err = archive:append(node, key, payload, time_now(), publisher); + data, err = archive:append(user, key, payload, time_now(), node); else - data, err = archive:delete(node, { + data, err = archive:delete(user, { key = key; + with = node; }); end if not data then |