summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_contacts.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-10-22 21:47:24 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-10-22 21:47:24 +0000
commitb21bfd5b0a6e525b5fce2e53d76351177d9b7e19 (patch)
tree6bdadbe570869b0c7c75fd53703526769df71578 /protocols/Skype/src/skype_contacts.cpp
parentf03c1017f5bd02238cdecff8280d59d303811610 (diff)
added contacts age
git-svn-id: http://svn.miranda-ng.org/main/trunk@2055 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_contacts.cpp')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp10
1 files changed, 9 insertions, 1 deletions
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