diff options
-rw-r--r-- | plugins/mod_pubsub/pubsub.lib.lua | 1 | ||||
-rw-r--r-- | spec/scansion/pubsub_config.scs | 8 | ||||
-rw-r--r-- | spec/scansion/pubsub_max_items.scs | 4 | ||||
-rw-r--r-- | spec/scansion/pubsub_multi_items.scs | 4 | ||||
-rw-r--r-- | spec/scansion/pubsub_preconditions.scs | 8 |
5 files changed, 19 insertions, 6 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index c5097a33..71900416 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -86,6 +86,7 @@ local node_config_form = dataform { 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 --git a/spec/scansion/pubsub_config.scs b/spec/scansion/pubsub_config.scs index 28505f28..de3f47da 100644 --- a/spec/scansion/pubsub_config.scs +++ b/spec/scansion/pubsub_config.scs @@ -48,7 +48,9 @@ Romeo receives: <field var="pubsub#description" label="Description" type="text-single"/> <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>1</value> </field> <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> @@ -136,7 +138,9 @@ Romeo sends: <field var="pubsub#description" type="text-single" label="Description"/> <field var="pubsub#type" type="text-single" label="The type of node data, usually specified by the namespace of the payload (if any)"/> <field var="pubsub#max_items" type="text-single" label="Max # of items to persist"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>1</value> </field> <field var="pubsub#persist_items" type="boolean" label="Persist items to storage"> diff --git a/spec/scansion/pubsub_max_items.scs b/spec/scansion/pubsub_max_items.scs index dafeb317..ae106edd 100644 --- a/spec/scansion/pubsub_max_items.scs +++ b/spec/scansion/pubsub_max_items.scs @@ -43,7 +43,9 @@ Alice receives: <field var="pubsub#description" label="Description" type="text-single"/> <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>20</value> </field> <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> diff --git a/spec/scansion/pubsub_multi_items.scs b/spec/scansion/pubsub_multi_items.scs index d4f2e01b..d8a9536a 100644 --- a/spec/scansion/pubsub_multi_items.scs +++ b/spec/scansion/pubsub_multi_items.scs @@ -43,7 +43,9 @@ Alice receives: <field var="pubsub#description" label="Description" type="text-single"/> <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>20</value> </field> <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> diff --git a/spec/scansion/pubsub_preconditions.scs b/spec/scansion/pubsub_preconditions.scs index 744070db..bcf83219 100644 --- a/spec/scansion/pubsub_preconditions.scs +++ b/spec/scansion/pubsub_preconditions.scs @@ -47,7 +47,9 @@ Romeo receives: <field var="pubsub#description" label="Description" type="text-single"/> <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>1</value> </field> <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> @@ -135,7 +137,9 @@ Romeo sends: <field var="pubsub#description" type="text-single" label="Description"/> <field var="pubsub#type" type="text-single" label="The type of node data, usually specified by the namespace of the payload (if any)"/> <field var="pubsub#max_items" type="text-single" label="Max # of items to persist"> - <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> + <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> + <range min="1"/> + </validate> <value>1</value> </field> <field var="pubsub#persist_items" type="boolean" label="Persist items to storage"> |