From 52d15a1d9e54d6311012ffad54d7e7881ab48f55 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 9 Mar 2011 16:07:56 +0100 Subject: contact-widget: don't allow edit fields having the Overwritten_By_Nickname flag (#644296) --- libempathy-gtk/empathy-contact-widget.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 464364cb7..352476711 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -441,6 +441,7 @@ contact_widget_details_update_edit (EmpathyContactWidget *information) TpContactInfoField *field = l->data; InfoFieldData *field_data; GtkWidget *w; + TpContactInfoFieldSpec *spec; field_data = find_info_field_data (field->field_name); if (field_data == NULL) @@ -452,6 +453,18 @@ contact_widget_details_update_edit (EmpathyContactWidget *information) continue; } + spec = get_spec_from_list (specs, field->field_name); + /* We shouldn't have added the field to details_to_set if it's not + * supported by the CM */ + g_assert (spec != NULL); + + if (spec->flags & TP_CONTACT_INFO_FIELD_FLAG_OVERWRITTEN_BY_NICKNAME) + { + DEBUG ("Ignoring field '%s' due it to having the " + "Overwritten_By_Nickname flag", field->field_name); + continue; + } + /* Add Title */ w = gtk_label_new (_(field_data->title)); gtk_table_attach (GTK_TABLE (information->table_details), -- cgit v1.2.3