mod_pubsub/archive_itemstore: Support resize operation
authorKim Alvefur <zash@zash.se>
Thu, 09 Nov 2017 17:21:50 +0100
changeset 8402 07443fe9df5b
parent 8401 3eff1b60269a
child 8403 518b56d806bd
mod_pubsub/archive_itemstore: Support resize operation
plugins/mod_pubsub/pubsub.lib.lua
--- 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);