From 30609c4da163329ea3076be8c24cc839b0365c9f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 9 Nov 2017 17:21:50 +0100 Subject: mod_pubsub/archive_itemstore: Support resize operation --- plugins/mod_pubsub/pubsub.lib.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_pubsub/pubsub.lib.lua') diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index ae99167f..3146054e 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -490,6 +490,11 @@ local function archive_itemstore(archive, config, user, node) function get_set:clear() -- luacheck: ignore 212/self return archive:delete(user); end + function get_set:resize(size) + return archive:delete(user, { + truncate = size; + }); + end function get_set:tail() -- This should conveniently return the last item local item = self:get(nil); -- cgit v1.2.3