# HG changeset patch # User Kim Alvefur # Date 1507490421 -7200 # Node ID 4852def7dc495f531462174c94a409c6ec3553d1 # Parent e2ab440a3437124f0dbd67c3d1e0a69f4160ae2d mod_pubsub: Workaround some storage modules without archive key deduplication diff -r e2ab440a3437 -r 4852def7dc49 plugins/mod_pubsub/pubsub.lib.lua --- 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);