When there's more than 1 address in the contact, it didn't construct
the json string properly by appending delimiter, thus the json parser
fails to parse the contact object string.
Change-Id: Idaa152e5692d51e5e9ac8d165ed82e42955977d5
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
+* Mon Sep 15 2014 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/ivi/20140908.201319-5-g84a14e0
+- Fix FTBFS for x86_64
+- Fixed a bug where it doesn't handle multiple addresses
+
+* Mon Sep 15 2014 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/ivi/20140908.201319-5-g84a14e0
+- Fixed a bug where it doesn't handle multiple addresses
+
* Mon Sep 08 2014 Jimmy Huang <jimmy.huang@intel.com> submit/tizen_ivi/20140908.173512-2-ge0fa798
- Remove underscores in MAC address
contact += "}";
// addresses:
+ bool firstAddress = true;
contact += ",\"addresses\":[";
for(int id=E_CONTACT_ADDRESS_HOME; id<=E_CONTACT_ADDRESS_OTHER; id++) {
EContactAddress *address = (EContactAddress*)e_contact_get(econtact, (EContactField)id);
if(address) {
- contact += "{";
+ if (firstAddress)
+ contact += "{";
+ else
+ contact += ",{";
+ firstAddress = false;
contact += "\"isDefault\":\"false\"";
if(address->country && strcmp(address->country,"")) {
contact += ",\"country\":\"";