diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-11 20:14:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-11 20:14:55 +0000 |
commit | e5a8933a9842f02a322ecb59d720030e4e81593d (patch) | |
tree | a11239111aa37da4b46b40862ee269cce28a886e /protocols/VKontakte/src/vk_proto.cpp | |
parent | adbbb8b03e941e2c0b099b9e6a90f2b178dd1afa (diff) |
VK: chat creation works
git-svn-id: http://svn.miranda-ng.org/main/trunk@7600 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 9a0c122eaf..aad19ae036 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -31,10 +31,8 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : CreateProtoService(PS_CREATEACCMGRUI, &CVkProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETAVATARINFOT, &CVkProto::SvcGetAvatarInfo);
- CreateProtoService(PS_GETAVATARCAPS, &CVkProto::SvcGetAvatarCaps);
+ CreateProtoService(PS_GETAVATARCAPS, &CVkProto::SvcGetAvatarCaps);
- HookProtoEvent(ME_GC_EVENT, &CVkProto::OnChatEvent);
- HookProtoEvent(ME_GC_BUILDMENU, &CVkProto::OnGcMenuHook);
HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit);
TCHAR descr[512];
@@ -56,6 +54,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : m_bServerDelivery = getBool("ServerDelivery", true);
+ // Chats
GCREGISTER gcr = { sizeof(gcr) };
gcr.ptszDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
@@ -63,6 +62,11 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : gcr.pColors = sttColors;
CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
+ CreateProtoService(PS_CREATECHAT, &CVkProto::SvcCreateChat);
+
+ HookProtoEvent(ME_GC_EVENT, &CVkProto::OnChatEvent);
+ HookProtoEvent(ME_GC_BUILDMENU, &CVkProto::OnGcMenuHook);
+
// Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
}
@@ -75,6 +79,17 @@ CVkProto::~CVkProto() int CVkProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
+ char szService[100];
+ mir_snprintf(szService, sizeof(szService), "%s%s", m_szModuleName, PS_CREATECHAT);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.hParentMenu = MO_GetProtoRootMenu(m_szModuleName);
+ mi.pszService = szService;
+ mi.position = 10009;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);
+ mi.pszName = LPGEN("Create new chat");
+ Menu_AddProtoMenuItem(&mi);
return 0;
}
|