changeset 14087:c28883e918f0

[gaim-migrate @ 16710] Fix CID 101. Also fix the behavior of adding a group to a fields list so that it doesn't matter if you add the group to a fields list before you add fields to the group or not. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 11 Aug 2006 19:56:55 +0000
parents 545dbc931e8c
children 223570831b0b
files src/request.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/request.c	Fri Aug 11 19:02:47 2006 +0000
+++ b/src/request.c	Fri Aug 11 19:56:55 2006 +0000
@@ -84,7 +84,13 @@
 		field = l->data;
 
 		g_hash_table_insert(fields->fields,
-							g_strdup(gaim_request_field_get_id(field)), field);
+			g_strdup(gaim_request_field_get_id(field)), field);
+
+		if (gaim_request_field_is_required(field)) {
+			fields->required_fields =
+				g_list_append(fields->required_fields, field);
+		}
+
 	}
 }
 
@@ -280,15 +286,16 @@
 	{
 		g_hash_table_insert(group->fields_list->fields,
 							g_strdup(gaim_request_field_get_id(field)), field);
+
+		if (gaim_request_field_is_required(field))
+		{
+			group->fields_list->required_fields =
+				g_list_append(group->fields_list->required_fields, field);
+		}
 	}
 
 	field->group = group;
 
-	if (gaim_request_field_is_required(field))
-	{
-		group->fields_list->required_fields =
-			g_list_append(group->fields_list->required_fields, field);
-	}
 }
 
 const char *