# HG changeset patch
# Node ID 5af1ccaac957
# Parent  e1a9c8f95fec
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -706,6 +706,9 @@ version 3.0.0 (??/??/????):
 		  purple_request_field_choice_add_full instead
 		* purple_request_field_list_add
 		* purple_request_field_list_get_icons
+		* PurpleRequestFieldSensitivityCb
+		* purple_request_field_set_sensitivity_cb
+		* purple_request_fields_get_autosensitive
 		* PurpleRoomlistRoomType
 		* purple_roomlist_expand_category
 		* purple_roomlist_field_get_field_type
diff --git a/libpurple/request.h b/libpurple/request.h
--- a/libpurple/request.h
+++ b/libpurple/request.h
@@ -240,8 +240,6 @@ typedef void (*PurpleRequestInputCb)(voi
 typedef gboolean (*PurpleRequestFieldValidator)(PurpleRequestField *field,
 	gchar **errmsg, gpointer user_data);
 
-typedef gboolean (*PurpleRequestFieldSensitivityCb)(PurpleRequestField *field);
-
 /**
  * PurpleRequestActionCb:
  * @data:   user-data
@@ -630,18 +628,6 @@ const GList *purple_request_fields_get_v
 	const PurpleRequestFields *fields);
 
 /**
- * purple_request_fields_get_autosensitive:
- * @fields: The fields list.
- *
- * Returns a list of all fields with sensitivity callback added.
- *
- * Returns: (element-type PurpleRequestField) (transfer none): The list of
- *          fields with automatic sensitivity callback.
- */
-const GList *
-purple_request_fields_get_autosensitive(const PurpleRequestFields *fields);
-
-/**
  * purple_request_fields_is_field_required:
  * @fields: The fields list.
  * @id:     The field ID.
@@ -1062,16 +1048,6 @@ void purple_request_field_set_sensitive(
 gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
 
 /**
- * purple_request_field_set_sensitivity_cb:
- * @field: The field.
- * @cb: (scope notified):   The callback.
- *
- * Sets the callback, used to determine if the field should be editable.
- */
-void purple_request_field_set_sensitivity_cb(PurpleRequestField *field,
-	PurpleRequestFieldSensitivityCb cb);
-
-/**
  * purple_request_field_get_ui_data:
  * @field: The field.
  *
diff --git a/libpurple/request.c b/libpurple/request.c
--- a/libpurple/request.c
+++ b/libpurple/request.c
@@ -58,7 +58,6 @@ struct _PurpleRequestField
 	gboolean visible;
 	gboolean required;
 	gboolean sensitive;
-	PurpleRequestFieldSensitivityCb sensitivity_cb;
 
 	union
 	{
@@ -147,8 +146,6 @@ struct _PurpleRequestFields
 
 	GList *validated_fields;
 
-	GList *autosensitive_fields;
-
 	void *ui_data;
 };
 
@@ -181,9 +178,6 @@ struct _PurpleRequestCommonParameters {
 	gpointer parent_from;
 };
 
-static void
-purple_request_fields_check_others_sensitivity(PurpleRequestField *field);
-
 PurpleRequestCommonParameters *
 purple_request_cpar_new(void)
 {
@@ -486,7 +480,6 @@ purple_request_fields_destroy(PurpleRequ
 	                 (GDestroyNotify)purple_request_field_group_destroy);
 	g_list_free(fields->required_fields);
 	g_list_free(fields->validated_fields);
-	g_list_free(fields->autosensitive_fields);
 	g_hash_table_destroy(fields->fields);
 	g_free(fields);
 }
@@ -523,11 +516,6 @@ purple_request_fields_add_group(PurpleRe
 			fields->validated_fields =
 				g_list_append(fields->validated_fields, field);
 		}
-
-		if (field->sensitivity_cb != NULL) {
-			fields->autosensitive_fields =
-				g_list_append(fields->autosensitive_fields, field);
-		}
 	}
 }
 
@@ -564,14 +552,6 @@ purple_request_fields_get_validatable(co
 	return fields->validated_fields;
 }
 
-const GList *
-purple_request_fields_get_autosensitive(const PurpleRequestFields *fields)
-{
-	g_return_val_if_fail(fields != NULL, NULL);
-
-	return fields->autosensitive_fields;
-}
-
 gboolean
 purple_request_fields_is_field_required(const PurpleRequestFields *fields,
 									  const char *id)
@@ -640,37 +620,6 @@ purple_request_fields_all_valid(const Pu
 	return TRUE;
 }
 
-static void
-purple_request_fields_check_sensitivity(PurpleRequestFields *fields)
-{
-	GList *it;
-
-	g_return_if_fail(fields != NULL);
-
-	for (it = fields->autosensitive_fields; it; it = g_list_next(it)) {
-		PurpleRequestField *field = it->data;
-
-		if (field->sensitivity_cb == NULL) {
-			g_warn_if_reached();
-			continue;
-		}
-
-		purple_request_field_set_sensitive(field,
-			field->sensitivity_cb(field));
-	}
-}
-
-static void
-purple_request_fields_check_others_sensitivity(PurpleRequestField *field)
-{
-	g_return_if_fail(field != NULL);
-
-	if (field->group == NULL || field->group->fields_list == NULL)
-		return;
-
-	purple_request_fields_check_sensitivity(field->group->fields_list);
-}
-
 PurpleRequestField *
 purple_request_fields_get_field(const PurpleRequestFields *fields, const char *id)
 {
@@ -823,12 +772,6 @@ purple_request_field_group_add_field(Pur
 			group->fields_list->validated_fields =
 				g_list_append(group->fields_list->validated_fields, field);
 		}
-
-		if (field->sensitivity_cb != NULL)
-		{
-			group->fields_list->autosensitive_fields =
-				g_list_append(group->fields_list->autosensitive_fields, field);
-		}
 	}
 
 	field->group = group;
@@ -1120,28 +1063,6 @@ purple_request_field_is_sensitive(Purple
 	return field->sensitive;
 }
 
-void
-purple_request_field_set_sensitivity_cb(PurpleRequestField *field,
-	PurpleRequestFieldSensitivityCb cb)
-{
-	PurpleRequestFields *flist;
-
-	g_return_if_fail(field != NULL);
-
-	field->sensitivity_cb = cb;
-
-	if (!field->group || !field->group->fields_list)
-		return;
-	flist = field->group->fields_list;
-	flist->autosensitive_fields = g_list_remove(flist->autosensitive_fields,
-		field);
-	if (cb != NULL)
-	{
-		flist->autosensitive_fields = g_list_append(
-			flist->autosensitive_fields, field);
-	}
-}
-
 PurpleRequestField *
 purple_request_field_string_new(const char *id, const char *text,
 							  const char *default_value, gboolean multiline)
@@ -1180,8 +1101,6 @@ purple_request_field_string_set_value(Pu
 
 	g_free(field->u.string.value);
 	field->u.string.value = g_strdup(value);
-
-	purple_request_fields_check_others_sensitivity(field);
 }
 
 void
@@ -1291,8 +1210,6 @@ purple_request_field_int_set_value(Purpl
 	}
 
 	field->u.integer.value = value;
-
-	purple_request_fields_check_others_sensitivity(field);
 }
 
 int
@@ -1365,8 +1282,6 @@ purple_request_field_bool_set_value(Purp
 	g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_BOOLEAN);
 
 	field->u.boolean.value = value;
-
-	purple_request_fields_check_others_sensitivity(field);
 }
 
 gboolean
@@ -1444,8 +1359,6 @@ purple_request_field_choice_set_value(Pu
 	g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_CHOICE);
 
 	field->u.choice.value = value;
-
-	purple_request_fields_check_others_sensitivity(field);
 }
 
 gpointer
@@ -1767,8 +1680,6 @@ purple_request_field_account_set_value(P
 	g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_ACCOUNT);
 
 	field->u.account.account = value;
-
-	purple_request_fields_check_others_sensitivity(field);
 }
 
 void
@@ -2263,8 +2174,6 @@ purple_request_fields(void *handle, cons
 		purple_request_fields_strip_html(fields);
 	}
 
-	purple_request_fields_check_sensitivity(fields);
-
 	if (ops != NULL && ops->request_fields != NULL) {
 		PurpleRequestInfo *info;
 		gchar **tmp;
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -228,7 +228,6 @@ req_field_changed_common(G_GNUC_UNUSED G
 	PurpleRequestFieldGroup *group;
 	PurpleRequestFields *fields;
 	PidginRequestData *req_data;
-	const GList *it;
 
 	group = purple_request_field_get_group(field);
 	fields = purple_request_field_group_get_fields_list(group);
@@ -237,21 +236,6 @@ req_field_changed_common(G_GNUC_UNUSED G
 	gtk_widget_set_sensitive(req_data->ok_button,
 		purple_request_fields_all_required_filled(fields) &&
 		purple_request_fields_all_valid(fields));
-
-	it = purple_request_fields_get_autosensitive(fields);
-	for(; it != NULL; it = g_list_next(it)) {
-		PurpleRequestField *field = it->data;
-		GtkWidget *widget = purple_request_field_get_ui_data(field);
-		gboolean sensitive;
-
-		sensitive = purple_request_field_is_sensitive(field);
-		gtk_widget_set_sensitive(widget, sensitive);
-
-		/* XXX: and what about multiline? */
-		if(GTK_IS_EDITABLE(widget)) {
-			gtk_editable_set_editable(GTK_EDITABLE(widget), sensitive);
-		}
-	}
 }
 
 static void
