diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-21 10:31:17 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-21 10:31:17 +0000 |
commit | 9306d732027781d6e6cbcc02f6fc5e1765a88bf7 (patch) | |
tree | c3bbe0888461ee1fbd8164b77b0df71664d3d365 /protocols/Skype | |
parent | 84fc6ba7d2399bfe5db16c044bace2642f9df8a6 (diff) |
added first and last names
git-svn-id: http://svn.miranda-ng.org/main/trunk@2012 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r-- | protocols/Skype/src/skype_contacts.cpp | 28 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 43560ca93d..2353bbd004 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -261,6 +261,30 @@ void CSkypeProto::UpdateContactTimezone(HANDLE hContact, CContact::Ref contact) this->DeleteSetting(hContact, "TimeZone");
}
+void CSkypeProto::UpdateFullName(HANDLE hContact, CContact::Ref contact)
+{
+ SEString data;
+ contact->GetPropFullname(data);
+ wchar_t* fullname = ::mir_utf8decodeW((const char*)data);
+ if (wcscmp(fullname, L"") == 0)
+ {
+ this->DeleteSetting(hContact, "FirstName");
+ this->DeleteSetting(hContact, "LastName");
+ }
+ else
+ {
+ wchar_t* last = _tcstok(fullname, L" ");
+ wchar_t* first = _tcstok(NULL, L" ");
+ if (first == NULL)
+ {
+ first = L"";
+ }
+ this->SetSettingString(hContact, "LastName", last);
+ this->SetSettingString(hContact, "FirstName", first);
+ }
+ ::mir_free(fullname);
+}
+
void CSkypeProto::UpdateContactProfile(HANDLE hContact, CContact::Ref contact)
{
uint newTS = 0;
@@ -281,6 +305,7 @@ void CSkypeProto::UpdateContactProfile(HANDLE hContact, CContact::Ref contact) this->UpdateContactOfficePhone(hContact, contact);
this->UpdateContactState(hContact, contact);
this->UpdateContactTimezone(hContact, contact);
+ this->UpdateFullName(hContact, contact);
this->SetSettingDword(hContact, "ProfileTS", newTS);
}
@@ -383,6 +408,9 @@ void CSkypeProto::OnContactChanged(CContact::Ref contact, int prop) case CContact::P_TIMEZONE:
this->UpdateContactTimezone(hContact, contact);
break;
+ case CContact::P_FULLNAME:
+ this->UpdateFullName(hContact, contact);
+ break;
}
}
else
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 295f1fcbf7..9edd4283c6 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -142,6 +142,7 @@ protected: void UpdateContactStatusMessage(HANDLE hContact, CContact::Ref contact);
void UpdateContactTimezone(HANDLE hContact, CContact::Ref contact);
void UpdateContactProfile(HANDLE hContact, CContact::Ref contact);
+ void UpdateFullName(HANDLE hContact, CContact::Ref contact);
void OnSearchCompleted(HANDLE hSearch);
void OnContactFinded(HANDLE hSearch, CContact::Ref contact);
|