From 6059a59c2774daeb1747a9108ae2d8f1bd1d97ef Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 22 Oct 2012 20:25:43 +0000 Subject: fixed users country info git-svn-id: http://svn.miranda-ng.org/main/trunk@2053 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'protocols/Skype/src/skype_contacts.cpp') diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 6e29158e95..d825c85546 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -72,7 +72,7 @@ void CSkypeProto::UpdateContactBirthday(HANDLE hContact, CContact::Ref contact) contact->GetPropBirthday(data); TCHAR date[9]; _itot_s(data, date, 10); - if (date > 0) + if (data > 0) { INT day, month, year; _stscanf(date, _T("%04d%02d%02d"), &year, &month, &day); @@ -104,10 +104,20 @@ void CSkypeProto::UpdateContactCountry(HANDLE hContact, CContact::Ref contact) { // country (en, ru, etc) SEString data; + char* country; contact->GetPropCountry(data); - // todo: write me - //BYTE countryId = this->GetCountryIdByName((const char*)sData); - //this->SetSettingByte(hContact, "Country", countryId); + char* isocode = ::mir_utf8decodeA((const char*)data); + if (strcmp(isocode, "") == 0) + { + country = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, 0xFFFF, 0); + this->SetSettingString(hContact, "Country", _A2T(country)); + } + else + { + country = (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)isocode, 0); + this->SetSettingString(hContact, "Country", _A2T(country)); + } + ::mir_free(isocode); } void CSkypeProto::UpdateContactEmails(HANDLE hContact, CContact::Ref contact) -- cgit v1.2.3