# HG changeset patch # User Kim Alvefur # Date 1533062038 -7200 # Node ID 9603a6a1ec850a6344d0a1e6e47566922ff85b10 # Parent db61e33bbd4149c9c5de0a1923ee6090890f1b72 mod_pubsub: Enforce max_items on insertion diff -r db61e33bbd41 -r 9603a6a1ec85 plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Tue Jul 31 15:42:45 2018 +0100 +++ b/plugins/mod_pubsub/pubsub.lib.lua Tue Jul 31 20:33:58 2018 +0200 @@ -746,6 +746,10 @@ 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;