1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Do not tag hidden form fields

This commit is contained in:
James Booth 2014-09-13 21:46:54 +01:00
parent cbb199e06e
commit 0a4dea55d5

View File

@ -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);