[empathy: 2/8] field_spec_match_field: check that parameters are matching as well (#630421)



commit a71719b4f268e0a1872007af770593773332cb0f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Sep 29 12:18:42 2010 +0200

    field_spec_match_field: check that parameters are matching as well (#630421)

 libempathy-gtk/empathy-contact-widget.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 0417c1b..6f9b9c6 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -282,7 +282,21 @@ static gboolean
 field_spec_match_field (TpContactInfoFieldSpec *spec,
     TpContactInfoField *field)
 {
-  return (!tp_strdiff (field->field_name, spec->name));
+  guint i;
+
+  if (tp_strdiff (field->field_name, spec->name))
+    return FALSE;
+
+  if (g_strv_length (field->parameters) != g_strv_length (spec->parameters))
+    return FALSE;
+
+  for (i = 0; field->parameters[i] != NULL; i++)
+    {
+      if (tp_strdiff (field->parameters[i], spec->parameters[i]))
+        return FALSE;
+    }
+
+  return TRUE;
 }
 
 static guint



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