[empathy] contact-widget: don't allow edit fields having the Overwritten_By_Nickname flag (#644296)



commit 52d15a1d9e54d6311012ffad54d7e7881ab48f55
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 9 16:07:56 2011 +0100

    contact-widget: don't allow edit fields having the Overwritten_By_Nickname flag (#644296)

 libempathy-gtk/empathy-contact-widget.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 464364c..3524767 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),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]