aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-08 21:20:21 +0200
committerKim Alvefur <zash@zash.se>2017-10-08 21:20:21 +0200
commit93aefe9a45afd448c53018b3e4c34a687ebafc50 (patch)
tree02e9f1461c2310bea91243485ab010163d344410 /plugins/mod_pubsub
parent551afcd4eb8060f33cd1cf37c5e2b93b1f9f5375 (diff)
downloadprosody-93aefe9a45afd448c53018b3e4c34a687ebafc50.tar.gz
prosody-93aefe9a45afd448c53018b3e4c34a687ebafc50.zip
mod_pubsub: Workaround some storage modules without archive key deduplication
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua3
1 files changed, 3 insertions, 0 deletions
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);