diff options
author | Kim Alvefur <zash@zash.se> | 2018-07-31 20:33:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-07-31 20:33:58 +0200 |
commit | 89360a401bbe38b355c8c48cbb156d74994aecbb (patch) | |
tree | d317ef264aa6842ff67192bdcead89e733d2cfb8 | |
parent | 93c75744ca64d5fe5f80454d8a7eb1f07f99faa5 (diff) | |
download | prosody-89360a401bbe38b355c8c48cbb156d74994aecbb.tar.gz prosody-89360a401bbe38b355c8c48cbb156d74994aecbb.zip |
mod_pubsub: Enforce max_items on insertion
-rw-r--r-- | plugins/mod_pubsub/pubsub.lib.lua | 4 |
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; |