diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-11 21:06:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-11 21:06:58 +0000 |
commit | 07f097177f76d22f8d3490e9ea439913c73e29a0 (patch) | |
tree | a28d8b0a18d3e68a8dbbaa0531c13231c1b01ba0 /protocols/VKontakte/src | |
parent | fb0c50db69b803edd6664b1bc2e83bc6a02c4835 (diff) |
VK:
- setting nicks for the new chats;
- added an option to hide chat windows on startup
git-svn-id: http://svn.miranda-ng.org/main/trunk@7604 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/resource.h | 5 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_options.cpp | 9 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 2 |
5 files changed, 14 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/resource.h b/protocols/VKontakte/src/resource.h index 6b3d64d274..3624c5ca01 100644 --- a/protocols/VKontakte/src/resource.h +++ b/protocols/VKontakte/src/resource.h @@ -21,12 +21,11 @@ #define IDC_DELIVERY 1011
#define IDC_GROUPNAME 1012
#define IDC_CLIST 1013
+#define IDC_HIDECHATS 1014
#define IDC_CONTACT 1015
-#define IDC_BUTTON1 1018
-#define IDC_BUTTON2 1019
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 29b3a8a5e4..efdf937973 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -58,6 +58,8 @@ CVkChatInfo* CVkProto::AppendChat(int id, JSONNODE *pDlg) gci.Flags = BYID | HCONTACT;
CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci);
c->m_hContact = gci.hContact;
+
+ setTString(gci.hContact, "Nick", tszTitle);
m_chats.insert(c);
GCDEST gcd = { m_szModuleName, sid, GC_EVENT_ADDGROUP };
@@ -69,7 +71,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, JSONNODE *pDlg) gcd.iType = GC_EVENT_CONTROL;
gce.ptszStatus = 0;
- CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, (m_bHideChats) ? WINDOW_HIDDEN : SESSION_INITDONE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
RetrieveChatInfo(c);
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index 35fc818bd3..60cfb60407 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -34,11 +34,11 @@ INT_PTR CALLBACK VKAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
{
- ptrT tszLogin( ppro->getTStringA("Login"));
+ ptrT tszLogin(ppro->getTStringA("Login"));
if (tszLogin != NULL)
SetDlgItemText(hwndDlg, IDC_LOGIN, tszLogin);
- ptrT tszPassw( ppro->GetUserStoredPassword());
+ ptrT tszPassw(ppro->GetUserStoredPassword());
if (tszPassw != NULL)
SetDlgItemText(hwndDlg, IDC_PASSWORD, tszPassw);
}
@@ -119,6 +119,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SetDlgItemText(hwndDlg, IDC_GROUPNAME, ppro->getGroup());
}
CheckDlgButton(hwndDlg, IDC_DELIVERY, ppro->m_bServerDelivery);
+ CheckDlgButton(hwndDlg, IDC_HIDECHATS, ppro->m_bHideChats);
return TRUE;
case WM_COMMAND:
@@ -135,6 +136,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L break;
case IDC_DELIVERY:
+ case IDC_HIDECHATS:
if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -160,6 +162,9 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->m_bServerDelivery = IsDlgButtonChecked(hwndDlg, IDC_DELIVERY) == BST_CHECKED;
ppro->setByte("ServerDelivery", ppro->m_bServerDelivery);
+
+ ppro->m_bHideChats = IsDlgButtonChecked(hwndDlg, IDC_HIDECHATS) == BST_CHECKED;
+ ppro->setByte("HideChats", ppro->m_bHideChats);
}
break;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index aad19ae036..b94497d54b 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -53,6 +53,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : db_set_resident(m_szModuleName, "Status");
m_bServerDelivery = getBool("ServerDelivery", true);
+ m_bHideChats = getBool("HideChats", true);
// Chats
GCREGISTER gcr = { sizeof(gcr) };
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 34f036393a..a98ad33681 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -224,7 +224,7 @@ private: void __cdecl SendMsgAck(void *param);
- bool m_bOnline;
+ bool m_bOnline, m_bHideChats;
LONG m_myUserId;
ptrA m_szAccessToken;
|