Software /
code /
prosody
Diff
util/dataforms.lua @ 9087:9e45e7adcebf
util.dataforms: Set default value for form type argument
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 03 Aug 2018 20:59:15 +0200 |
parent | 9084:572b6858db03 |
child | 9088:aa1b02411846 |
line wrap: on
line diff
--- a/util/dataforms.lua Fri Aug 03 20:51:08 2018 +0200 +++ b/util/dataforms.lua Fri Aug 03 20:59:15 2018 +0200 @@ -26,7 +26,8 @@ end function form_t.form(layout, data, formtype) - local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype or "form" }); + if not formtype then formtype = "form" end + local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype }); if layout.title then form:tag("title"):text(layout.title):up(); end