summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-10-23 05:17:35 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-10-23 05:17:35 +0000
commitb42fe046c66bcdfbce14bac30e2d9f10d5172541 (patch)
tree9cdd8d2173217db30ffcbe6666004ac3a295eebe /protocols
parent7e30d516e63cd31bfb40ba7b18db9a36cc0a9614 (diff)
timezones should be working. not compile, not test
git-svn-id: http://svn.miranda-ng.org/main/trunk@2057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Skype/src/resource.h7
-rw-r--r--protocols/Skype/src/skype_contacts.cpp25
-rw-r--r--protocols/Skype/src/skype_icons.cpp15
-rw-r--r--protocols/Skype/src/skype_proto.h1
4 files changed, 43 insertions, 5 deletions
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<SIZEOF(iconList); i++)
+ {
+ if(strcmp(iconList[i].Name, name) == 0)
+ return iconList[i].Handle;
+ }
+ return 0;
+}
+
void CSkypeProto::UninitIcons()
{
for (int i = 0; i < SIZEOF(iconList); i++)
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 2f2c48bbd7..4f06f95746 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -2,6 +2,7 @@
#include "skype.h"
#include <time.h>
+#include <stdlib.h>
struct CSkypeProto;