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/Discord/src/proto.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'protocols/Discord') diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 3eb222f68e..b346de4d88 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -92,6 +92,13 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) : dbEventType.eventIcon = g_plugin.getIconHandle(IDI_VOICE_ENDED); DbEvent_RegisterType(&dbEventType); + // Groupchat initialization + GCREGISTER gcr = {}; + gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; + gcr.ptszDispName = m_tszUserName; + gcr.pszModule = m_szModuleName; + Chat_Register(&gcr); + // Network initialization CMStringW descr; NETLIBUSER nlu = {}; @@ -145,12 +152,6 @@ void CDiscordProto::OnModulesLoaded() else pNew->channelId = getId(hContact, DB_KEY_CHANNELID); } - GCREGISTER gcr = {}; - gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; - gcr.ptszDispName = m_tszUserName; - gcr.pszModule = m_szModuleName; - Chat_Register(&gcr); - // Clist Clist_GroupCreate(0, m_wszDefaultGroup); -- cgit v1.2.3