From 5b9180012f495e23dfdd9fb7d91cfb1258734fe3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Jul 2020 18:39:15 +0300 Subject: group chat initialization to be done in protocol's constructor, not inside OnModulesLoaded --- protocols/Omegle/src/proto.cpp | 19 ++++++++----------- protocols/Omegle/src/proto.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'protocols/Omegle') diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 1ea0e17332..eee9e19127 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -61,6 +61,14 @@ OmegleProto::OmegleProto(const char* proto_name, const wchar_t* username) : g_plugin.addSound("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing")); g_plugin.addSound("StrangerChange", m_tszUserName, LPGENW("Changing stranger")); g_plugin.addSound("StrangerMessage", m_tszUserName, LPGENW("Receive message")); + + // Register group chat + GCREGISTER gcr = {}; + gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG; + gcr.pszModule = m_szModuleName; + gcr.ptszDispName = m_tszUserName; + gcr.iMaxText = OMEGLE_MESSAGE_LIMIT; + Chat_Register(&gcr); } OmegleProto::~OmegleProto() @@ -136,17 +144,6 @@ INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, OmegleAccountProc, (LPARAM)this); } -void OmegleProto::OnModulesLoaded() -{ - // Register group chat - GCREGISTER gcr = {}; - gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG; - gcr.pszModule = m_szModuleName; - gcr.ptszDispName = m_tszUserName; - gcr.iMaxText = OMEGLE_MESSAGE_LIMIT; - Chat_Register(&gcr); -} - void OmegleProto::OnShutdown() { SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index b84d023247..fe84b61698 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -52,7 +52,6 @@ public: int UserIsTyping(MCONTACT hContact, int type) override; void OnContactDeleted(MCONTACT) override; - void OnModulesLoaded() override; void OnShutdown() override; // Services -- cgit v1.2.3