[evolution-ews/gnome-3-8] Bug #699231 - Capital letters' changes are not propagated to the server
- From: Fabiano Fidêncio <ffidencio src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews/gnome-3-8] Bug #699231 - Capital letters' changes are not propagated to the server
- Date: Mon, 29 Apr 2013 23:18:09 +0000 (UTC)
commit bdbb25d5f978075bd8b61f6f52e6cdff2724f048
Author: Fabiano Fidêncio <fidencio redhat com>
Date: Mon Apr 29 16:59:18 2013 +0200
Bug #699231 - Capital letters' changes are not propagated to the server
src/addressbook/e-book-backend-ews.c | 53 ++++++++++++++-------------------
1 files changed, 23 insertions(+), 30 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 2731973..dd73398 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -664,7 +664,7 @@ convert_indexed_contact_property_to_updatexml (ESoapMessage *message,
{
gboolean delete_field = FALSE;
- if (!value || !g_strcmp0 (value, ""))
+ if (!value || g_strcmp0 (value, "") == 0)
delete_field = TRUE;
e_ews_message_start_set_indexed_item_field (message, name , prefix, "Contact", key, delete_field);
@@ -689,10 +689,10 @@ ebews_set_full_name_changes (ESoapMessage *message,
if (!name && !old_name)
return;
- if (g_ascii_strcasecmp (name->given, old_name->given))
+ if (g_strcmp0 (name->given, old_name->given) != 0)
convert_contact_property_to_updatexml (message, "GivenName", name->given, "contacts", NULL,
NULL);
- if (g_ascii_strcasecmp (name->additional, old_name->additional))
+ if (g_strcmp0 (name->additional, old_name->additional) != 0)
convert_contact_property_to_updatexml (message, "MiddleName", name->additional, "contacts",
NULL, NULL);
e_contact_name_free (name);
@@ -741,13 +741,12 @@ ebews_set_phone_number_changes (ESoapMessage *message,
for (i = 0; i < G_N_ELEMENTS (phone_field_map); i++) {
new_value = e_contact_get (new, phone_field_map[i].field);
old_value = e_contact_get (old, phone_field_map[i].field);
- if ((new_value && !old_value) || (!new_value && old_value) ||(new_value && old_value &&
g_ascii_strcasecmp (new_value, old_value)))
+
+ if (g_strcmp0 (new_value, old_value) != 0)
convert_indexed_contact_property_to_updatexml (message, "PhoneNumber", new_value,
"contacts", "PhoneNumbers", phone_field_map[i].element);
- if (new_value)
- g_free (new_value);
- if (old_value)
- g_free (old_value);
+ g_free (new_value);
+ g_free (old_value);
}
}
@@ -763,7 +762,7 @@ convert_indexed_contact_property_to_updatexml_physical_address (ESoapMessage *me
gchar * fielduri = NULL;
gboolean delete_field = FALSE;
- if (!value || !g_strcmp0 (value, ""))
+ if (!value || g_strcmp0 (value, "") == 0)
delete_field = TRUE;
fielduri = g_strconcat (name, ":", uri_element, NULL);
@@ -809,13 +808,13 @@ compare_address (ESoapMessage *message,
new_address = g_new0 (EContactAddress, 1);
}
- if (set || g_ascii_strcasecmp (new_address->street, old_address->street))
+ if (set || g_strcmp0 (new_address->street, old_address->street) != 0)
convert_indexed_contact_property_to_updatexml_physical_address (message, "PhysicalAddress",
"Street", new_address->street, "contacts", "PhysicalAddresses", key);
- if (set || g_ascii_strcasecmp (new_address->locality, old_address->locality))
+ if (set || g_strcmp0 (new_address->locality, old_address->locality) != 0)
convert_indexed_contact_property_to_updatexml_physical_address (message, "PhysicalAddress",
"City", new_address->locality, "contacts", "PhysicalAddresses", key);
- if (set || g_ascii_strcasecmp (new_address->region, old_address->region))
+ if (set || g_strcmp0 (new_address->region, old_address->region) != 0)
convert_indexed_contact_property_to_updatexml_physical_address (message, "PhysicalAddress",
"State", new_address->region, "contacts", "PhysicalAddresses", key);
- if (set || g_ascii_strcasecmp (new_address->code, old_address->code))
+ if (set || g_strcmp0 (new_address->code, old_address->code) != 0)
convert_indexed_contact_property_to_updatexml_physical_address (message, "PhysicalAddress",
"PostalCode", new_address->code, "contacts", "PhysicalAddresses", key);
e_contact_address_free (old_address);
@@ -850,7 +849,7 @@ ebews_set_notes_changes (ESoapMessage *message,
old_notes = e_contact_get (old, E_CONTACT_NOTE);
new_notes = e_contact_get (new, E_CONTACT_NOTE);
- if (g_strcmp0 (old_notes, new_notes)) {
+ if (g_strcmp0 (old_notes, new_notes) != 0) {
convert_contact_property_to_updatexml (
message, "Body", new_notes ?: "", "item", "BodyType", "Text");
}
@@ -868,30 +867,24 @@ ebews_set_email_changes (ESoapMessage *message,
new_value = e_contact_get (new, E_CONTACT_EMAIL_1);
old_value = e_contact_get (old, E_CONTACT_EMAIL_1);
- if ((new_value && !old_value) || (!new_value && old_value) ||(new_value && old_value &&
g_ascii_strcasecmp (new_value, old_value)))
+ if (g_strcmp0 (new_value, old_value) != 0)
convert_indexed_contact_property_to_updatexml (message, "EmailAddress", new_value,
"contacts", "EmailAddresses", "EmailAddress1");
- if (new_value)
- g_free (new_value);
- if (old_value)
- g_free (old_value);
+ g_free (new_value);
+ g_free (old_value);
new_value = e_contact_get (new, E_CONTACT_EMAIL_2);
old_value = e_contact_get (old, E_CONTACT_EMAIL_2);
- if ((new_value && !old_value) || (!new_value && old_value) ||(new_value && old_value &&
g_ascii_strcasecmp (new_value, old_value)))
+ if (g_strcmp0 (new_value, old_value) != 0)
convert_indexed_contact_property_to_updatexml (message, "EmailAddress", new_value,
"contacts", "EmailAddresses", "EmailAddress2");
- if (new_value)
- g_free (new_value);
- if (old_value)
- g_free (old_value);
+ g_free (new_value);
+ g_free (old_value);
new_value = e_contact_get (new, E_CONTACT_EMAIL_3);
old_value = e_contact_get (old, E_CONTACT_EMAIL_3);
- if ((new_value && !old_value) || (!new_value && old_value) ||(new_value && old_value &&
g_ascii_strcasecmp (new_value, old_value)))
+ if (g_strcmp0 (new_value, old_value) != 0)
convert_indexed_contact_property_to_updatexml (message, "EmailAddress", new_value,
"contacts", "EmailAddresses", "EmailAddress3");
- if (new_value)
- g_free (new_value);
- if (old_value)
- g_free (old_value);
+ g_free (new_value);
+ g_free (old_value);
}
static const struct field_element_mapping {
@@ -1295,7 +1288,7 @@ convert_contact_to_updatexml (ESoapMessage *msg,
if (element_type == ELEMENT_TYPE_SIMPLE) {
value = e_contact_get (new_contact, mappings[i].field_id);
old_value = e_contact_get (old_contact, mappings[i].field_id);
- if ((value && !old_value) || (!value && old_value) ||(value && old_value &&
g_ascii_strcasecmp (value, old_value)))
+ if (g_strcmp0 (value, old_value) != 0)
convert_contact_property_to_updatexml (msg, mappings[i].element_name, value,
"contacts", NULL, NULL);
if (value)
g_free (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]