]> git.0d.be Git - empathy.git/commitdiff
contact-widget: don't allow edit fields having the Overwritten_By_Nickname flag ...
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 Mar 2011 15:07:56 +0000 (16:07 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 Mar 2011 15:16:48 +0000 (16:16 +0100)
libempathy-gtk/empathy-contact-widget.c

index 464364cb72aafcbfa7e852f840933e19b56235a0..35247671148d64b4fa108140fe5befc5b8fa3dd9 100644 (file)
@@ -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),