From 0a4dea55d541f594ea3b0c540bb018187f0f3d57 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 13 Sep 2014 21:46:54 +0100 Subject: [PATCH] Do not tag hidden form fields --- src/xmpp/form.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/xmpp/form.c b/src/xmpp/form.c index a77b8e88..ad4ffa3e 100644 --- a/src/xmpp/form.c +++ b/src/xmpp/form.c @@ -208,12 +208,15 @@ form_create(xmpp_stanza_t * const form_stanza) field->type_t = _get_field_type(field->type); field->var = _get_attr(field_stanza, "var"); - GString *tag = g_string_new(""); - g_string_printf(tag, "field%d", tag_num++); - g_hash_table_insert(form->var_to_tag, strdup(field->var), strdup(tag->str)); - g_hash_table_insert(form->tag_to_var, strdup(tag->str), strdup(field->var)); - autocomplete_add(form->tag_ac, tag->str); - g_string_free(tag, TRUE); + + if (field->type_t != FIELD_HIDDEN) { + GString *tag = g_string_new(""); + g_string_printf(tag, "field%d", tag_num++); + g_hash_table_insert(form->var_to_tag, strdup(field->var), strdup(tag->str)); + g_hash_table_insert(form->tag_to_var, strdup(tag->str), strdup(field->var)); + autocomplete_add(form->tag_ac, tag->str); + g_string_free(tag, TRUE); + } field->description = _get_property(field_stanza, "desc"); field->required = _is_required(field_stanza);