Software /
code /
prosody
Diff
plugins/mod_pubsub/pubsub.lib.lua @ 8300:7759eb130938
mod_pep_plus, mod_pubsub: Store node content in separate archive stores
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 08 Oct 2017 01:56:44 +0200 |
parent | 8298:dd9fa511494a |
child | 8301:e2ab440a3437 |
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua Sun Oct 08 18:34:57 2017 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Sun Oct 08 01:56:44 2017 +0200 @@ -331,7 +331,7 @@ local get_set = {}; function get_set:items() local store = self.store; - local data, err = archive:find(user, { with = node }); + local data, err = archive:find(user); if not data then module:log("error", "Unable to get items: %s", err); return true; @@ -349,7 +349,6 @@ function get_set:get(key) local store = self.store; local data, err = archive:find(user, { - with = node; key = key; }); if not data then @@ -370,12 +369,9 @@ if value ~= nil then local publisher = value.attr.publisher; local payload = value.tags[1]; - data, err = archive:append(user, key, payload, time_now(), node); + data, err = archive:append(user, key, payload, time_now(), publisher); else - data, err = archive:delete(user, { - key = key; - with = node; - }); + data, err = archive:delete(user, { key = key; }); end if not data then module:log("error", "Unable to set item: %s", err); @@ -384,7 +380,7 @@ return data; end function get_set:clear() - return archive:delete(user, { with = node }); + return archive:delete(user); end return setmetatable(get_set, archive); end