diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 27 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.h | 1 |
2 files changed, 16 insertions, 12 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 892ad9e373..6b61cca21c 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -14,9 +14,9 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : CreateProtoService(PS_JOINCHAT, &WhatsAppProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &WhatsAppProto::OnLeaveChat);
- HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::OnChatOutgoing);
- HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
HookProtoEvent(ME_OPT_INITIALISE, &WhatsAppProto::OnOptionsInit);
+ HookProtoEvent(ME_SYSTEM_MODULESLOADED, &WhatsAppProto::OnModulesLoaded);
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
this->InitContactMenus();
@@ -37,16 +37,6 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName;
- // Register group chat
- GCREGISTER gcr = { sizeof(gcr) };
- gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
- gcr.ptszDispName = m_tszUserName;
- gcr.pszModule = m_szModuleName;
- CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
-
- //HookProtoEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook);
- //HookProtoEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook);
-
SetAllContactStatuses(ID_STATUS_OFFLINE, true);
}
@@ -58,6 +48,19 @@ WhatsAppProto::~WhatsAppProto() delete this->challenge;
}
+int WhatsAppProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ // Register group chat
+ GCREGISTER gcr = { sizeof(gcr) };
+ gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.pszModule = m_szModuleName;
+ CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
+
+ HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::OnChatOutgoing);
+ return 0;
+}
+
DWORD_PTR WhatsAppProto::GetCaps( int type, HANDLE hContact )
{
switch(type)
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 0afa3e3a55..d8bdab70a6 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -86,6 +86,7 @@ public: INT_PTR __cdecl OnLeaveChat(WPARAM, LPARAM);
INT_PTR __cdecl OnCreateGroup(WPARAM,LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl RefreshBuddyList(WPARAM, LPARAM);
int __cdecl RequestFriendship(WPARAM, LPARAM);
|