summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp21
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;
}