aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-31 20:33:58 +0200
committerKim Alvefur <zash@zash.se>2018-07-31 20:33:58 +0200
commit835fc62e2905fe9643394e455821cac06eddde69 (patch)
treed317ef264aa6842ff67192bdcead89e733d2cfb8
parent84f4ead3d22b612d0dbf21c78a73d91b6327be65 (diff)
downloadprosody-835fc62e2905fe9643394e455821cac06eddde69.tar.gz
prosody-835fc62e2905fe9643394e455821cac06eddde69.zip
mod_pubsub: Enforce max_items on insertion
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index e1b61096..dc85db28 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -746,6 +746,10 @@ local function archive_itemstore(archive, config, user, node)
else
data, err = archive:delete(user, { key = key; });
end
+ -- TODO archive support for maintaining maximum items
+ archive:delete(user, {
+ truncate = max_items;
+ });
if not data then
module:log("error", "Unable to set item: %s", err);
return nil, err;