Changeset

8399:07443fe9df5b

mod_pubsub/archive_itemstore: Support resize operation
author Kim Alvefur <zash@zash.se>
date Thu, 09 Nov 2017 17:21:50 +0100
parents 8398:3eff1b60269a
children 8400:518b56d806bd
files plugins/mod_pubsub/pubsub.lib.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua	Sat Nov 18 21:35:40 2017 +0100
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Thu Nov 09 17:21:50 2017 +0100
@@ -490,6 +490,11 @@
 	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);