# HG changeset patch # User Kim Alvefur # Date 1634743884 -7200 # Node ID 8890eaa6944614f2a1feef8bdbdd07cafb8ab92f # Parent b605cbd5f13b06632490398808db993a8b60b297 mod_pubsub: Prevent max_items from being set to zero Disable persistence instead if no items should be persisted. XEP-0060 is not entirely clear on what either of those option really mean. diff -r b605cbd5f13b -r 8890eaa69446 plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Tue Oct 19 18:11:50 2021 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Wed Oct 20 17:31:24 2021 +0200 @@ -86,6 +86,7 @@ type = "text-single"; datatype = "pubsub:integer-or-max"; name = "max_items"; + range_min = 1; var = "pubsub#max_items"; label = "Max # of items to persist"; }; diff -r b605cbd5f13b -r 8890eaa69446 spec/scansion/pubsub_config.scs --- a/spec/scansion/pubsub_config.scs Tue Oct 19 18:11:50 2021 +0200 +++ b/spec/scansion/pubsub_config.scs Wed Oct 20 17:31:24 2021 +0200 @@ -48,7 +48,9 @@ - + + + 1 @@ -136,7 +138,9 @@ - + + + 1 diff -r b605cbd5f13b -r 8890eaa69446 spec/scansion/pubsub_max_items.scs --- a/spec/scansion/pubsub_max_items.scs Tue Oct 19 18:11:50 2021 +0200 +++ b/spec/scansion/pubsub_max_items.scs Wed Oct 20 17:31:24 2021 +0200 @@ -43,7 +43,9 @@ - + + + 20 diff -r b605cbd5f13b -r 8890eaa69446 spec/scansion/pubsub_multi_items.scs --- a/spec/scansion/pubsub_multi_items.scs Tue Oct 19 18:11:50 2021 +0200 +++ b/spec/scansion/pubsub_multi_items.scs Wed Oct 20 17:31:24 2021 +0200 @@ -43,7 +43,9 @@ - + + + 20 diff -r b605cbd5f13b -r 8890eaa69446 spec/scansion/pubsub_preconditions.scs --- a/spec/scansion/pubsub_preconditions.scs Tue Oct 19 18:11:50 2021 +0200 +++ b/spec/scansion/pubsub_preconditions.scs Wed Oct 20 17:31:24 2021 +0200 @@ -47,7 +47,9 @@ - + + + 1 @@ -135,7 +137,9 @@ - + + + 1