summaryrefslogtreecommitdiff
path: root/protocols/Skype/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-10-22 20:25:43 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-10-22 20:25:43 +0000
commit6059a59c2774daeb1747a9108ae2d8f1bd1d97ef (patch)
tree2c19ada67b7dd8d8c08e3119bd0b83bb008ff252 /protocols/Skype/src
parent1b3eb999850503df29c166127a9f17511976ee1a (diff)
fixed users country info
git-svn-id: http://svn.miranda-ng.org/main/trunk@2053 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp18
-rw-r--r--protocols/Skype/src/skype_proto.h4
-rw-r--r--protocols/Skype/src/skype_utils.cpp20
3 files changed, 14 insertions, 28 deletions
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)
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index b87adf872d..2f2c48bbd7 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -72,10 +72,6 @@ public:
virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
- // utils
- static int countriesCount;
- static CountryListEntry* countryList;
-
// events
int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnPreShutdown(WPARAM, LPARAM);
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index 15f421cb2d..88e92b3d19 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -1,8 +1,5 @@
#include "skype_proto.h"
-int CSkypeProto::countriesCount;
-CountryListEntry* CSkypeProto::countryList;
-
void CSkypeProto::FakeAsync(void *param)
{
::Sleep(100);
@@ -10,23 +7,6 @@ void CSkypeProto::FakeAsync(void *param)
::mir_free(param);
}
-int CSkypeProto::GetCountryIdByName(const char* countryName)
-{
- for (int i = 0; i < CSkypeProto::countriesCount; i++)
- {
- const char* country = CSkypeProto::countryList[i].szName;
- if (strcmp(CSkypeProto::countryList[i].szName, countryName) == 0)
- return CSkypeProto::countryList[i].id;
- }
-
- return 0;
-}
-
-char* CSkypeProto::GetCountryNameById(int countryId)
-{
- return (char*)::CallService(MS_UTILS_GETCOUNTRYBYNUMBER, (WPARAM)countryId, NULL);
-}
-
wchar_t* CSkypeProto::GetAvatarFilePath(wchar_t* skypeName)
{
wchar_t* path = new wchar_t[MAX_PATH * 2];