Changeset

8302:4852def7dc49

mod_pubsub: Workaround some storage modules without archive key deduplication
author Kim Alvefur <zash@zash.se>
date Sun, 08 Oct 2017 21:20:21 +0200
parents 8301:e2ab440a3437
children 8303:053cf683c2c7
files plugins/mod_pubsub/pubsub.lib.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua	Sun Oct 08 19:42:10 2017 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Sun Oct 08 21:20:21 2017 +0200
@@ -350,6 +350,9 @@
 		local store = self.store;
 		local data, err = archive:find(user, {
 			key = key;
+			-- Get the last item with that key, if the archive doesn't deduplicate
+			reverse = true,
+			limit = 1;
 		});
 		if not data then
 			module:log("error", "Unable to get item: %s", err);