summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/VKontakte/res/resource.rc8
-rw-r--r--protocols/VKontakte/src/resource.h1
-rw-r--r--protocols/VKontakte/src/vk_options.cpp5
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp1
-rw-r--r--protocols/VKontakte/src/vk_proto.h3
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp3
6 files changed, 16 insertions, 5 deletions
diff --git a/protocols/VKontakte/res/resource.rc b/protocols/VKontakte/res/resource.rc
index 0b3ca95bac..fd2c20fc51 100644
--- a/protocols/VKontakte/res/resource.rc
+++ b/protocols/VKontakte/res/resource.rc
@@ -35,7 +35,7 @@ BEGIN
CONTROL "Open VKontakte site",IDC_URL,"Hyperlink",WS_TABSTOP,0,49,174,12
END
-IDD_OPT_MAIN DIALOGEX 0, 0, 304, 222
+IDD_OPT_MAIN DIALOGEX 0, 0, 304, 244
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -49,7 +49,7 @@ BEGIN
GROUPBOX "Local settings",IDC_STATIC,4,73,293,33
LTEXT "Contact list group:",IDC_STATIC,12,88,146,8
EDITTEXT IDC_GROUPNAME,167,86,121,12,ES_AUTOHSCROLL
- GROUPBOX "Advanced",IDC_STATIC,4,108,293,108
+ GROUPBOX "Advanced",IDC_STATIC,4,108,293,124
CONTROL "Server-side delivery confirmation",IDC_DELIVERY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,120,278,10
CONTROL "Hide chats on startup",IDC_HIDECHATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,133,278,10
CONTROL "Automatically wipe local contacts missing in your Friends list",IDC_AUTOCLEAN,
@@ -60,6 +60,8 @@ BEGIN
CONTROL "Mark read on typing",IDC_MARKREADONTYPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,184,267,10
CONTROL "Automatically sync last messages",IDC_SYNCHISTOTYONONLINE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,197,278,10
+ CONTROL "Use local time for received messages",IDC_USE_LOCAL_TIME,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,209,278,10
END
IDD_CAPTCHAFORM DIALOGEX 0, 0, 258, 224
@@ -131,7 +133,7 @@ BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 297
TOPMARGIN, 7
- BOTTOMMARGIN, 217
+ BOTTOMMARGIN, 239
END
IDD_INVITE, DIALOG
diff --git a/protocols/VKontakte/src/resource.h b/protocols/VKontakte/src/resource.h
index 254b124515..7c3f798213 100644
--- a/protocols/VKontakte/src/resource.h
+++ b/protocols/VKontakte/src/resource.h
@@ -28,6 +28,7 @@
#define IDC_MARKREADONREPLY 1026
#define IDC_SYNCHISTOTYONONLINE 1027
#define IDC_MARKREADONTYPING 1028
+#define IDC_USE_LOCAL_TIME 1029
// Next default values for new objects
//
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 5ac052fcc1..147b65e676 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -126,6 +126,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg, IDC_MARKREADONTYPING), ppro->m_bMarkReadOnReply);
CheckDlgButton(hwndDlg, IDC_MARKREADONTYPING, ppro->m_bMarkReadOnTyping);
CheckDlgButton(hwndDlg, IDC_SYNCHISTOTYONONLINE, ppro->m_bAutoSyncHistory);
+ CheckDlgButton(hwndDlg, IDC_USE_LOCAL_TIME, ppro->m_bUseLocalTime);
return TRUE;
case WM_COMMAND:
@@ -147,6 +148,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDC_MESASUREAD:
case IDC_MARKREADONTYPING:
case IDC_SYNCHISTOTYONONLINE:
+ case IDC_USE_LOCAL_TIME:
if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -195,6 +197,9 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
ppro->m_bAutoSyncHistory = IsDlgButtonChecked(hwndDlg, IDC_SYNCHISTOTYONONLINE) == BST_CHECKED;
ppro->setByte("AutoSyncHistory", ppro->m_bAutoSyncHistory);
+
+ ppro->m_bUseLocalTime = IsDlgButtonChecked(hwndDlg, IDC_USE_LOCAL_TIME) == BST_CHECKED;
+ ppro->setByte("UseLocalTime", ppro->m_bUseLocalTime);
}
break;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 1e0a96bc65..5afa14dedf 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -66,6 +66,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
m_bMarkReadOnReply = getBool("MarkReadOnReply", false);
m_bMarkReadOnTyping = getBool("MarkReadOnTyping", false) && m_bMarkReadOnReply;
m_bAutoSyncHistory = getBool("AutoSyncHistory", true);
+ m_bUseLocalTime = getBool("LocalTime", false);
// Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index df8d7a2072..43608c2ee1 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -323,7 +323,8 @@ private:
m_bMesAsUnread,
m_bMarkReadOnReply,
m_bMarkReadOnTyping,
- m_bAutoSyncHistory;
+ m_bAutoSyncHistory,
+ m_bUseLocalTime;
LONG m_myUserId;
ptrA m_szAccessToken;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 7a68c79b52..a484ef5628 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -547,7 +547,8 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
recv.flags |= PREF_CREATEREAD;
if (isOut)
recv.flags |= PREF_SENT;
- recv.timestamp = datetime;
+
+ recv.timestamp = m_bUseLocalTime?time(NULL):datetime;
recv.tszMessage = ptszBody;
recv.lParam = isOut;
recv.pCustomData = szMid;