From 22d8917d8ced0783831e0050e1f0ca4089e273e8 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 25 Nov 2009 19:58:19 +0000 Subject: util.dataforms: Don't require type when parsing form XML --- util/dataforms.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'util/dataforms.lua') diff --git a/util/dataforms.lua b/util/dataforms.lua index 5626172e..a3bde8ca 100644 --- a/util/dataforms.lua +++ b/util/dataforms.lua @@ -93,7 +93,13 @@ function form_t.data(layout, stanza) local data = {}; for field_tag in stanza:childtags() do - local field_type = field_tag.attr.type; + local field_type; + for n, field in ipairs(layout) do + if field.name == field_tag.attr.var then + field_type = field.type; + break; + end + end local reader = field_readers[field_type]; if reader then -- cgit v1.2.3