aboutsummaryrefslogtreecommitdiff
path: root/src/node_flat_sql.erl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2021-08-21 12:29:37 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2021-08-21 12:29:37 +0200
commit1b0e59bb139f83d1f027ece08606446c30d35ae5 (patch)
treedf7351c46b33ec9e064c60755bc5841789882bcf /src/node_flat_sql.erl
parentPubSub: Support 'max_items=max' node configuration (diff)
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.
Diffstat (limited to 'src/node_flat_sql.erl')
-rw-r--r--src/node_flat_sql.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl
index 1e197a51d..1309c2886 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} ->