From 1b0e59bb139f83d1f027ece08606446c30d35ae5 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 21 Aug 2021 12:29:37 +0200 Subject: PubSub: Support unlimited number of items Allow for setting the mod_pubsub option 'max_items_node' to 'unlimited'. If clients then request a 'max_items' limit of 'max', old items aren't deleted when publishing new ones. Thanks to Ammonit Measurement GmbH for sponsoring this work. --- src/node_flat_sql.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/node_flat_sql.erl') diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 1e197a51..1309c288 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -247,7 +247,8 @@ publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload, or (Subscribed == true)) -> {error, xmpp:err_forbidden()}; true -> - if MaxItems > 0 -> + if MaxItems > 0; + MaxItems == unlimited -> Now = erlang:timestamp(), case get_item(Nidx, ItemId) of {result, #pubsub_item{creation = {_, GenKey}} = OldItem} -> -- cgit v1.2.3