Diff

plugins/mod_pubsub/pubsub.lib.lua @ 8399:07443fe9df5b

mod_pubsub/archive_itemstore: Support resize operation
author Kim Alvefur <zash@zash.se>
date Thu, 09 Nov 2017 17:21:50 +0100
parent 8375:e2037634cdd9
child 8400:518b56d806bd
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);