Software /
code /
prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 8318:d0a7fc7614de
mod_pubsub, mod_pep_plus: Rename simple_itemstore to reflect that it's based on archive storage
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 12 Oct 2017 01:31:08 +0200 |
parent | 8317:ff57b3cc5a8e |
child | 8320:fe5eaf4ed631 |
comparison
equal
deleted
inserted
replaced
8317:ff57b3cc5a8e | 8318:d0a7fc7614de |
---|---|
329 item.attr.publisher = publisher; | 329 item.attr.publisher = publisher; |
330 end | 330 end |
331 return item; | 331 return item; |
332 end | 332 end |
333 | 333 |
334 local function simple_itemstore(archive, config, user, node, expose_publisher) | 334 local function archive_itemstore(archive, config, user, node, expose_publisher) |
335 module:log("debug", "Creation of itemstore for node %s with config %s", node, config); | 335 module:log("debug", "Creation of itemstore for node %s with config %s", node, config); |
336 local get_set = {}; | 336 local get_set = {}; |
337 function get_set:items() -- luacheck: ignore 212/self | 337 function get_set:items() -- luacheck: ignore 212/self |
338 local data, err = archive:find(user); | 338 local data, err = archive:find(user); |
339 if not data then | 339 if not data then |
387 function get_set:clear() -- luacheck: ignore 212/self | 387 function get_set:clear() -- luacheck: ignore 212/self |
388 return archive:delete(user); | 388 return archive:delete(user); |
389 end | 389 end |
390 return setmetatable(get_set, archive); | 390 return setmetatable(get_set, archive); |
391 end | 391 end |
392 _M.simple_itemstore = simple_itemstore; | 392 _M.archive_itemstore = archive_itemstore; |
393 | 393 |
394 return _M; | 394 return _M; |