From b21bfd5b0a6e525b5fce2e53d76351177d9b7e19 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 22 Oct 2012 21:47:24 +0000 Subject: added contacts age git-svn-id: http://svn.miranda-ng.org/main/trunk@2055 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 d825c85546..50ebc7d576 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -79,6 +79,14 @@ void CSkypeProto::UpdateContactBirthday(HANDLE hContact, CContact::Ref contact) this->SetSettingByte(hContact, "BirthDay", day); this->SetSettingByte(hContact, "BirthMonth", month); this->SetSettingWord(hContact, "BirthYear", year); + + SYSTEMTIME sToday = {0}; + GetLocalTime(&sToday); + int nAge = sToday.wYear - year; + if (sToday.wMonth < month || (sToday.wMonth == month && sToday.wDay < day)) + nAge--; + if (nAge) + this->SetSettingWord( hContact, "Age", ( WORD )nAge ); } else { @@ -258,7 +266,7 @@ void CSkypeProto::UpdateContactTimezone(HANDLE hContact, CContact::Ref contact) { uint data; contact->GetPropTimezone(data); - // todo: check me + // todo: из числа вычесть 24*3600 и поделить на 60, получим зону в минутах, взять знак и поделить с остатком на 60. итог: строка формата "+4:00" if (data > 0) this->SetSettingByte(hContact, "TimeZone", (data - 24*3600) / 3600); else -- cgit v1.2.3