ThrowMsg(InvalidArgumentException, "Contact argument is wrong");
internalAddContact(contact);
- m_latestVersion = get_contact_version();
+
+ string id = contact->getId();
+ if(id != "")
+ {
+ ContactPtr insertedContact = internalGetById(id);
+ contact->copy(insertedContact);
+ }
+
+ //m_latestVersion = get_contact_version();
}
void AddressBook::update(const ContactPtr &contact)
ThrowMsg(InvalidArgumentException, "Contact argument is wrong");
internalAddContact(contact);
- m_latestVersion = get_contact_version();
+ //m_latestVersion = get_contact_version();
}
void AddressBook::remove(const string &id)
LogError("Error during deleting contact. " << _rethrown_exception.GetMessage());
ThrowMsg(PlatformException, "Error during deleting contact.");
}
- m_latestVersion = get_contact_version();
+ //m_latestVersion = get_contact_version();
}
long AddressBook::addChangeListener(const EventAddressBookChangeListenerEmitterPtr &emitter)
LogError("error code " << ret);
ThrowMsg(PlatformException, "Error during executing contacts_svc_end_trans()");
}
+
+ for(ContactArray::iterator i = contacts->begin(); i != contacts->end(); i++)
+ {
+ ContactPtr contact = *i;
+
+ string id = contact->getId();
+ if(id != "")
+ {
+ ContactPtr insertedContact = internalGetById(id);
+ contact->copy(insertedContact);
+ }
+ }
}
Catch (NotFoundException)
{
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
- m_latestVersion = get_contact_version();
+ //m_latestVersion = get_contact_version();
event->setResult(true);
event->setExceptionCode(ExceptionCodes::None);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
- m_latestVersion = get_contact_version();
+ //m_latestVersion = get_contact_version();
event->setResult(true);
event->setExceptionCode(ExceptionCodes::None);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
- m_latestVersion = get_contact_version();
+ //m_latestVersion = get_contact_version();
event->setResult(true);
event->setExceptionCode(ExceptionCodes::None);
LogError("error code " << id);
ThrowMsg(PlatformException, "Error during executing contacts_svc_insert_contact()");
}
-
- std::stringstream oss;
- oss << id;
- std::string idStr = oss.str();
- ContactPtr insertedContact = internalGetById(idStr);
-
- newContact->copy(insertedContact);
+ newContact->setId(id);
}
}