From 0084dd7477efd605fe9d12c5a5912050db7ee36c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 8 Oct 2017 21:20:21 +0200 Subject: mod_pubsub: Workaround some storage modules without archive key deduplication --- plugins/mod_pubsub/pubsub.lib.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index f19e3ebc..ececf9e1 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -350,6 +350,9 @@ local function simple_itemstore(archive, config, user, node, expose_publisher) 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); -- cgit v1.2.3