From b42fe046c66bcdfbce14bac30e2d9f10d5172541 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 23 Oct 2012 05:17:35 +0000 Subject: timezones should be working. not compile, not test git-svn-id: http://svn.miranda-ng.org/main/trunk@2057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/resource.h | 7 +++++-- protocols/Skype/src/skype_contacts.cpp | 25 +++++++++++++++++++++++-- protocols/Skype/src/skype_icons.cpp | 15 ++++++++++++++- protocols/Skype/src/skype_proto.h | 1 + 4 files changed, 43 insertions(+), 5 deletions(-) (limited to 'protocols/Skype/src') diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index 3581f001a1..e5a3950e49 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -6,7 +6,10 @@ #define IDD_OPTIONS 10 #define IDI_ICON 101 #define IDR_RUNTIME 102 -#define IDD_PASSWORDREQUEST 105 +#define IDI_AUTH_GRANT 103 +#define IDI_AUTH_ASK 104 +#define IDI_AUTH_REVOKE 105 +#define IDD_PASSWORDREQUEST 106 #define IDC_SN 1001 #define IDC_PW 1002 #define IDC_SL 1003 @@ -19,7 +22,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_RESOURCE_VALUE 107 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1004 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 50ebc7d576..33f37ee86f 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -93,6 +93,7 @@ void CSkypeProto::UpdateContactBirthday(HANDLE hContact, CContact::Ref contact) this->DeleteSetting(hContact, "BirthDay"); this->DeleteSetting(hContact, "BirthMonth"); this->DeleteSetting(hContact, "BirthYear"); + this->DeleteSetting(hContact, "Age"); } } @@ -266,9 +267,29 @@ void CSkypeProto::UpdateContactTimezone(HANDLE hContact, CContact::Ref contact) { uint data; contact->GetPropTimezone(data); - // todo: из числа вычесть 24*3600 и поделить на 60, получим зону в минутах, взять знак и поделить с остатком на 60. итог: строка формата "+4:00" if (data > 0) - this->SetSettingByte(hContact, "TimeZone", (data - 24*3600) / 3600); + { + uint diffmin = (data - 24*3600) / 60; + TCHAR sign[2]; + if (diffmin < 0) + sign = _T("-"); + else + sign = _T("+"); + uint hours = abs(diffmin / 60); + uint mins = abs(diffmin % 60); + TCHAR timeshift[7]; + mir_sntprinf(timeshift, SIZEOF(timeshift), _T("%s%d:%02d"), sign, hours, mins); + + LPCTSTR szMin = _tcschr(timeshift, ':'); + int nTz = _ttoi(timeshift) * -2; + nTz += (nTz < 0 ? -1 : 1) * (szMin ? _ttoi( szMin + 1 ) / 30 : 0); + + TIME_ZONE_INFORMATION tzinfo; + if (GetTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_DAYLIGHT) + nTz -= tzinfo.DaylightBias / 30; + + this->SetSettingByte(hContact, "Timezone", (signed char)nTz); + } else this->DeleteSetting(hContact, "TimeZone"); } diff --git a/protocols/Skype/src/skype_icons.cpp b/protocols/Skype/src/skype_icons.cpp index 005fff931a..6f46e7d319 100644 --- a/protocols/Skype/src/skype_icons.cpp +++ b/protocols/Skype/src/skype_icons.cpp @@ -2,7 +2,10 @@ _tag_iconList CSkypeProto::iconList[] = { - { LPGENT("Protocol icon"), "main", IDI_ICON }, + { LPGENT("Protocol icon"), "main", IDI_ICON }, + { LPGENT("Revoke authorization"), "authRevoke", IDI_AUTH_REVOKE }, + { LPGENT("Request authorization"), "authAsk", IDI_AUTH_ASK }, + { LPGENT("Grant authorization"), "authGrant", IDI_AUTH_GRANT }, }; void CSkypeProto::InitIcons() @@ -31,6 +34,16 @@ void CSkypeProto::InitIcons() } } +HANDLE GetIconHandle(const char* name) +{ + for(size_t i=0; i +#include struct CSkypeProto; -- cgit v1.2.3