summaryrefslogtreecommitdiff
path: root/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp')
-rw-r--r--protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
index c35877dc4c..3c8bdbfed6 100644
--- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
+++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
@@ -609,22 +609,15 @@ void CCurrencyRatesProviderBase::WriteContactRate(MCONTACT hContact, double dRat
MCONTACT CCurrencyRatesProviderBase::CreateNewContact(const tstring& rsName)
{
MCONTACT hContact = db_add_contact();
- if (hContact) {
- if (0 == Proto_AddToContact(hContact, CURRENCYRATES_PROTOCOL_NAME)) {
- tstring sProvName = GetInfo().m_sName;
- db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_PROVIDER, sProvName.c_str());
- db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_SYMBOL, rsName.c_str());
- db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str());
-
- mir_cslock lck(m_cs);
- m_aContacts.push_back(hContact);
- }
- else {
- db_delete_contact(hContact);
- hContact = NULL;
- }
- }
+ Proto_AddToContact(hContact, CURRENCYRATES_PROTOCOL_NAME);
+ tstring sProvName = GetInfo().m_sName;
+ db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_PROVIDER, sProvName.c_str());
+ db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_SYMBOL, rsName.c_str());
+ db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str());
+
+ mir_cslock lck(m_cs);
+ m_aContacts.push_back(hContact);
return hContact;
}