Diff

plugins/mod_pubsub/pubsub.lib.lua @ 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
parent 8301:e2ab440a3437
child 8308:ab189d3f55d1
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);