diff options
-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);
|