From 9cca190bc3022311915eb1e95b3cc3bb89aed328 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 25 Jan 2020 14:24:53 +0300 Subject: massive code cleaning: - GCHOOK structure normalized (i.e. inlined SESSION_INFO fields replaced with a reference to SESSION_INFO); - fake CMsgDialog declaration added to m_srmm_int.h, thus duplicated declarations in plugins aren't needed anymore - other minor changes --- protocols/Discord/src/groupchat.cpp | 10 +++++----- protocols/Discord/src/guilds.cpp | 5 ----- protocols/Dummy/src/stdafx.h | 1 - protocols/Facebook/src/groupchats.cpp | 4 ++-- protocols/Gadu-Gadu/src/gg.h | 2 +- protocols/Gadu-Gadu/src/groupchat.cpp | 16 +++++++--------- protocols/ICQ-WIM/src/groupchats.cpp | 4 ++-- protocols/IRCG/src/scripting.cpp | 13 ------------- protocols/IRCG/src/services.cpp | 4 ++-- protocols/JabberG/src/jabber_chat.cpp | 28 ++++++++++++++-------------- protocols/MSN/src/msn_chat.cpp | 22 +++++++++++----------- protocols/MSN/src/stdafx.h | 2 +- protocols/MinecraftDynmap/src/chat.cpp | 3 +-- protocols/MinecraftDynmap/src/stdafx.h | 2 +- protocols/Omegle/src/chat.cpp | 2 +- protocols/Omegle/src/stdafx.h | 2 +- protocols/Sametime/src/StdAfx.h | 2 +- protocols/Sametime/src/conference.cpp | 4 ++-- protocols/SkypeWeb/src/skype_chatrooms.cpp | 4 ++-- protocols/Twitter/src/chat.cpp | 2 +- protocols/Twitter/src/stdafx.h | 2 +- protocols/VKontakte/src/vk_chats.cpp | 4 ++-- 22 files changed, 58 insertions(+), 80 deletions(-) (limited to 'protocols') diff --git a/protocols/Discord/src/groupchat.cpp b/protocols/Discord/src/groupchat.cpp index c353879559..8b68a6a20b 100644 --- a/protocols/Discord/src/groupchat.cpp +++ b/protocols/Discord/src/groupchat.cpp @@ -80,7 +80,7 @@ void CDiscordProto::Chat_SendPrivateMessage(GCHOOK *gch) return; setId(hContact, DB_KEY_ID, userId); - setId(hContact, DB_KEY_CHANNELID, _wtoi64(gch->ptszID)); + setId(hContact, DB_KEY_CHANNELID, _wtoi64(gch->si->ptszID)); setWString(hContact, "Nick", gch->ptszNick); Contact_Hide(hContact); db_set_dw(hContact, "Ignore", "Mask1", 0); @@ -92,7 +92,7 @@ void CDiscordProto::Chat_SendPrivateMessage(GCHOOK *gch) void CDiscordProto::Chat_ProcessLogMenu(GCHOOK *gch) { - CDiscordUser *pUser = FindUserByChannel(_wtoi64(gch->ptszID)); + CDiscordUser *pUser = FindUserByChannel(_wtoi64(gch->si->ptszID)); if (pUser == nullptr) return; @@ -152,7 +152,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam) if (gch == nullptr) return 0; - if (mir_strcmpi(gch->pszModule, m_szModuleName)) + if (mir_strcmpi(gch->si->pszModule, m_szModuleName)) return 0; switch (gch->iType) { @@ -165,7 +165,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam) if (pos != -1) { auto wszWord = wszText.Left(pos); wszWord.Trim(); - if (auto *si = g_chatApi.SM_FindSession(gch->ptszID, gch->pszModule)) { + if (auto *si = g_chatApi.SM_FindSession(gch->si->ptszID, gch->si->pszModule)) { USERINFO *pUser = nullptr; for (auto &U : si->getUserList()) @@ -184,7 +184,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam) Chat_UnescapeTags(wszText.GetBuffer()); JSONNode body; body << WCHAR_PARAM("content", wszText); - CMStringA szUrl(FORMAT, "/channels/%S/messages", gch->ptszID); + CMStringA szUrl(FORMAT, "/channels/%S/messages", gch->si->ptszID); Push(new AsyncHttpRequest(this, REQUEST_POST, szUrl, nullptr, &body)); } break; diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index 3408141ecf..c19237c7e4 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -17,11 +17,6 @@ along with this program. If not, see . #include "stdafx.h" -class CMsgDialog : public CSrmmBaseDialog -{ - CMsgDialog(); // just to suppress compiler's warnings, never implemented -}; - int compareUsers(const CDiscordUser *p1, const CDiscordUser *p2); static int compareRoles(const CDiscordRole *p1, const CDiscordRole *p2) diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h index 2a48b7265d..dc268b3711 100644 --- a/protocols/Dummy/src/stdafx.h +++ b/protocols/Dummy/src/stdafx.h @@ -29,7 +29,6 @@ along with this program. If not, see . #include #include -#include #include #include #include diff --git a/protocols/Facebook/src/groupchats.cpp b/protocols/Facebook/src/groupchats.cpp index 7f17c63cb7..92ff8c2e55 100644 --- a/protocols/Facebook/src/groupchats.cpp +++ b/protocols/Facebook/src/groupchats.cpp @@ -153,10 +153,10 @@ int FacebookProto::GroupchatEventHook(WPARAM, LPARAM lParam) if (gch == nullptr) return 0; - if (mir_strcmpi(gch->pszModule, m_szModuleName)) + if (mir_strcmpi(gch->si->pszModule, m_szModuleName)) return 0; - SESSION_INFO *si = g_chatApi.SM_FindSession(gch->ptszID, gch->pszModule); + SESSION_INFO *si = g_chatApi.SM_FindSession(gch->si->ptszID, gch->si->pszModule); if (si == nullptr) return 0; diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index 2da3bbb811..21a763db6a 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 63a2547cf7..7d09dfc691 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -112,17 +112,15 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) uin_t uin; // Check if we got our protocol, and fields are set - if (!gch - || !gch->ptszID - || !gch->pszModule - || mir_strcmpi(gch->pszModule, m_szModuleName) + if (!gch || !gch->si->ptszID || !gch->si->pszModule + || mir_strcmpi(gch->si->pszModule, m_szModuleName) || !(uin = getDword(GG_KEY_UIN, 0)) - || !(chat = gc_lookup(gch->ptszID))) + || !(chat = gc_lookup(gch->si->ptszID))) return 0; // Window terminated (Miranda exit) if (gch->iType == SESSION_TERMINATE) { - debugLogW(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->ptszID); + debugLogW(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->si->ptszID); // Destroy chat entry free(chat->recipients); list_remove(&chats, chat, 1); @@ -132,7 +130,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) MCONTACT hNext = db_find_next(hContact); DBVARIANT dbv; if (!getWString(hContact, "ChatRoomID", &dbv)) { - if (dbv.pwszVal && !mir_wstrcmp(gch->ptszID, dbv.pwszVal)) + if (dbv.pwszVal && !mir_wstrcmp(gch->si->ptszID, dbv.pwszVal)) db_delete_contact(hContact); db_free(&dbv); } @@ -148,7 +146,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) DBVARIANT dbv; GCEVENT gce = { m_szModuleName, 0, GC_EVENT_MESSAGE }; - gce.pszID.w = gch->ptszID; + gce.pszID.w = gch->si->ptszID; gce.pszUID.w = id; gce.pszText.w = gch->ptszText; wchar_t* nickT; @@ -169,7 +167,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) gce.time = time(0); gce.bIsMe = 1; gce.dwFlags = GCEF_ADDTOLOG; - debugLogW(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->ptszID, gch->ptszText); + debugLogW(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->si->ptszID, gch->ptszText); Chat_Event(&gce); mir_free(nickT); diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp index 57951c07c5..9226a30db5 100644 --- a/protocols/ICQ-WIM/src/groupchats.cpp +++ b/protocols/ICQ-WIM/src/groupchats.cpp @@ -206,10 +206,10 @@ int CIcqProto::GroupchatEventHook(WPARAM, LPARAM lParam) if (gch == nullptr) return 0; - if (mir_strcmpi(gch->pszModule, m_szModuleName)) + if (mir_strcmpi(gch->si->pszModule, m_szModuleName)) return 0; - SESSION_INFO *si = g_chatApi.SM_FindSession(gch->ptszID, gch->pszModule); + SESSION_INFO *si = g_chatApi.SM_FindSession(gch->si->ptszID, gch->si->pszModule); if (si == nullptr) return 0; diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index 3926b6aefc..620072fa8e 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -59,8 +59,6 @@ static void __stdcall OnHook(void * pi) GCHOOK* gch = (GCHOOK*)pi; free(gch->ptszUID); free(gch->ptszText); - free((void*)gch->ptszID); - free((void*)gch->pszModule); delete gch; } @@ -88,17 +86,6 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam) else gchook->ptszUID = nullptr; - if (gch->ptszID) { - CMStringW S = MakeWndID(gch->ptszID); - gchook->ptszID = wcsdup(S.c_str()); - } - else gchook->ptszID = nullptr; - - if (gch->pszModule) - gchook->pszModule = _strdup(gch->pszModule); - else - gchook->pszModule = nullptr; - mir_forkThread(GuiOutThread, gchook); return 0; } diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index acc55c5654..04a1ea6936 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -462,8 +462,8 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) // handle the hook if (gch) { - if (!mir_strcmpi(gch->pszModule, m_szModuleName)) { - wchar_t *p1 = mir_wstrdup(gch->ptszID); + if (!mir_strcmpi(gch->si->pszModule, m_szModuleName)) { + wchar_t *p1 = mir_wstrdup(gch->si->ptszID); wchar_t *p2 = wcsstr(p1, L" - "); if (p2) *p2 = 0; diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 746914f726..3df9b3df91 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1212,35 +1212,35 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *gch) { CMStringW szBuffer, szTitle; - T2Utf roomJid(gch->ptszID); + T2Utf roomJid(gch->si->ptszID); switch (gch->dwData) { case IDM_LST_PARTICIPANT: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "participant", &CJabberProto::OnIqResultMucGetVoiceList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "participant", &CJabberProto::OnIqResultMucGetVoiceList, gch->si->pDlg); break; case IDM_LST_MEMBER: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "member", &CJabberProto::OnIqResultMucGetMemberList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "member", &CJabberProto::OnIqResultMucGetMemberList, gch->si->pDlg); break; case IDM_LST_MODERATOR: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "moderator", &CJabberProto::OnIqResultMucGetModeratorList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "moderator", &CJabberProto::OnIqResultMucGetModeratorList, gch->si->pDlg); break; case IDM_LST_BAN: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "outcast", &CJabberProto::OnIqResultMucGetBanList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "outcast", &CJabberProto::OnIqResultMucGetBanList, gch->si->pDlg); break; case IDM_LST_ADMIN: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "admin", &CJabberProto::OnIqResultMucGetAdminList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "admin", &CJabberProto::OnIqResultMucGetAdminList, gch->si->pDlg); break; case IDM_LST_OWNER: - ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "owner", &CJabberProto::OnIqResultMucGetOwnerList, gch->pDlg); + ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "owner", &CJabberProto::OnIqResultMucGetOwnerList, gch->si->pDlg); break; case IDM_TOPIC: - szTitle.Format(TranslateT("Set topic for %s"), gch->ptszID); + szTitle.Format(TranslateT("Set topic for %s"), gch->si->ptszID); szBuffer = Utf2T(item->getTemp()->m_szStatusMessage); szBuffer.Replace(L"\n", L"\r\n"); if (ppro->EnterString(szBuffer, szTitle, ESF_RICHEDIT, "gcTopic_")) @@ -1249,7 +1249,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g break; case IDM_NICK: - szTitle.Format(TranslateT("Change nickname in %s"), gch->ptszID); + szTitle.Format(TranslateT("Change nickname in %s"), gch->si->ptszID); if (item->nick) szBuffer = Utf2T(item->nick); if (ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) @@ -1260,8 +1260,8 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g case IDM_INVITE: { auto *pDlg = new CGroupchatInviteDlg(ppro, roomJid); - if (gch->pDlg) - pDlg->SetParent(gch->pDlg->GetHwnd()); + if (gch->si->pDlg) + pDlg->SetParent(gch->si->pDlg->GetHwnd()); pDlg->Show(); } break; @@ -1286,7 +1286,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g break; case IDM_DESTROY: - szTitle.Format(TranslateT("Reason to destroy %s"), gch->ptszID); + szTitle.Format(TranslateT("Reason to destroy %s"), gch->si->ptszID); if (ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE, "gcReason_")) ppro->m_ThreadInfo->send( XmlNodeIq("set", ppro->SerialNext(), roomJid) << XQUERY(JABBER_FEAT_MUC_OWNER) @@ -1362,10 +1362,10 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam) if (gch == nullptr) return 0; - if (mir_strcmpi(gch->pszModule, m_szModuleName)) + if (mir_strcmpi(gch->si->pszModule, m_szModuleName)) return 0; - T2Utf roomJid(gch->ptszID); + T2Utf roomJid(gch->si->ptszID); JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, roomJid); if (item == nullptr) return 0; diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 3bd58d51fe..4cbdab32b4 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -138,7 +138,7 @@ void CMsnProto::MSN_KillChatSession(const wchar_t* id) void CMsnProto::MSN_Kickuser(GCHOOK *gch) { - GCThreadData *thread = MSN_GetThreadByChatId(gch->ptszID); + GCThreadData *thread = MSN_GetThreadByChatId(gch->si->ptszID); msnNsThread->sendPacketPayload("DEL", "MSGR\\THREAD", "%d:%s%s", thread->netId, thread->szEmail, _T2A(gch->ptszUID).get()); @@ -146,7 +146,7 @@ void CMsnProto::MSN_Kickuser(GCHOOK *gch) void CMsnProto::MSN_Promoteuser(GCHOOK *gch, const char *pszRole) { - GCThreadData *thread = MSN_GetThreadByChatId(gch->ptszID); + GCThreadData *thread = MSN_GetThreadByChatId(gch->si->ptszID); msnNsThread->sendPacketPayload("PUT", "MSGR\\THREAD", "%d:%s%s%s", thread->netId, thread->szEmail, _T2A(gch->ptszUID).get(), pszRole); @@ -458,12 +458,12 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) if (!gch) return 1; - if (_stricmp(gch->pszModule, m_szModuleName)) return 0; + if (_stricmp(gch->si->pszModule, m_szModuleName)) return 0; switch (gch->iType) { case GC_SESSION_TERMINATE: { - GCThreadData* thread = MSN_GetThreadByChatId(gch->ptszID); + GCThreadData* thread = MSN_GetThreadByChatId(gch->si->ptszID); if (thread == nullptr) break; @@ -476,7 +476,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case GC_USER_MESSAGE: if (gch->ptszText && gch->ptszText[0]) { - GCThreadData* thread = MSN_GetThreadByChatId(gch->ptszID); + GCThreadData* thread = MSN_GetThreadByChatId(gch->si->ptszID); if (thread) { wchar_t* pszMsg = Chat_UnescapeTags(NEWWSTR_ALLOCA(gch->ptszText)); rtrimw(pszMsg); // remove the ending linebreak @@ -486,7 +486,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) int bError = getWString("Nick", &dbv); GCEVENT gce = { m_szModuleName, 0, GC_EVENT_MESSAGE }; - gce.pszID.w = gch->ptszID; + gce.pszID.w = gch->si->ptszID; gce.dwFlags = GCEF_ADDTOLOG; gce.pszNick.w = bError ? L"" : dbv.pwszVal; gce.pszUID.w = mir_a2u(MyOptions.szEmail); @@ -504,7 +504,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case GC_USER_CHANMGR: DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat, - LPARAM(new InviteChatParam(gch->ptszID, NULL, this))); + LPARAM(new InviteChatParam(gch->si->ptszID, NULL, this))); break; case GC_USER_PRIVMESS: @@ -515,11 +515,11 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) switch (gch->dwData) { case 10: DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat, - LPARAM(new InviteChatParam(gch->ptszID, NULL, this))); + LPARAM(new InviteChatParam(gch->si->ptszID, NULL, this))); break; case 20: - MSN_KillChatSession(gch->ptszID); + MSN_KillChatSession(gch->si->ptszID); break; } break; @@ -539,11 +539,11 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) break; case 110: - MSN_KillChatSession(gch->ptszID); + MSN_KillChatSession(gch->si->ptszID); break; case 40: - const wchar_t *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->ptszID), _T2A(gch->ptszUID)); + const wchar_t *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->si->ptszID), _T2A(gch->ptszUID)); MSN_Promoteuser(gch, (pszRole && !mir_wstrcmp(pszRole, L"admin")) ? "user" : "admin"); break; } diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index 3cea2d0513..2541a56b48 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -56,7 +56,7 @@ along with this program. If not, see . #include #include #include -#include +#include #include #include #include diff --git a/protocols/MinecraftDynmap/src/chat.cpp b/protocols/MinecraftDynmap/src/chat.cpp index 31112b00d2..dabf9b4741 100644 --- a/protocols/MinecraftDynmap/src/chat.cpp +++ b/protocols/MinecraftDynmap/src/chat.cpp @@ -49,8 +49,7 @@ void MinecraftDynmapProto::UpdateChat(const char *name, const char *message, con int MinecraftDynmapProto::OnChatEvent(WPARAM, LPARAM lParam) { GCHOOK *hook = reinterpret_cast(lParam); - - if(strcmp(hook->pszModule,m_szModuleName)) + if(strcmp(hook->si->pszModule,m_szModuleName)) return 0; switch(hook->iType) { diff --git a/protocols/MinecraftDynmap/src/stdafx.h b/protocols/MinecraftDynmap/src/stdafx.h index 7965e5fd05..a9f1e1a0a6 100644 --- a/protocols/MinecraftDynmap/src/stdafx.h +++ b/protocols/MinecraftDynmap/src/stdafx.h @@ -40,7 +40,7 @@ along with this program. If not, see . #include #include -#include +#include #include #include #include diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index c1f41f9df3..7f13e74967 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -72,7 +72,7 @@ int OmegleProto::OnChatEvent(WPARAM, LPARAM lParam) { GCHOOK *hook = reinterpret_cast(lParam); - if (mir_strcmp(hook->pszModule, m_szModuleName)) + if (mir_strcmp(hook->si->pszModule, m_szModuleName)) return 0; switch (hook->iType) { diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h index b722e2696a..999e1e20d0 100644 --- a/protocols/Omegle/src/stdafx.h +++ b/protocols/Omegle/src/stdafx.h @@ -41,7 +41,7 @@ along with this program. If not, see . #include #include -#include +#include #include #include #include diff --git a/protocols/Sametime/src/StdAfx.h b/protocols/Sametime/src/StdAfx.h index 86a25658ad..1d16c4493a 100644 --- a/protocols/Sametime/src/StdAfx.h +++ b/protocols/Sametime/src/StdAfx.h @@ -71,6 +71,6 @@ extern "C" { #include #include #include -#include +#include #include #include diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 666ed44cfe..ee0a6a35b9 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -281,12 +281,12 @@ int CSametimeProto::GcEventHook(WPARAM, LPARAM lParam) { GCHOOK* gch = (GCHOOK*)lParam; - if (strcmp(gch->pszModule, m_szModuleName) != 0) return 0; + if (strcmp(gch->si->pszModule, m_szModuleName) != 0) return 0; GList *conferences = mwServiceConference_getConferences(service_conference); for (GList *conf = conferences;conf;conf = conf->next) { wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName((mwConference*)conf->data)); - if (mir_wstrcmp(gch->ptszID, tszConfId) == 0) { + if (mir_wstrcmp(gch->si->ptszID, tszConfId) == 0) { switch(gch->iType) { case GC_USER_MESSAGE: { diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index d3c8421a74..d0577bb99f 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -91,10 +91,10 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) if (!gch) return 1; - if (mir_strcmp(gch->pszModule, m_szModuleName) != 0) + if (mir_strcmp(gch->si->pszModule, m_szModuleName) != 0) return 0; - T2Utf chat_id(gch->ptszID), user_id(gch->ptszUID); + T2Utf chat_id(gch->si->ptszID), user_id(gch->ptszUID); switch (gch->iType) { case GC_USER_MESSAGE: diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index bf7e1b6c36..a9e75c3392 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -54,7 +54,7 @@ void TwitterProto::UpdateChat(const twitter_user &update) int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam) { GCHOOK *hook = reinterpret_cast(lParam); - if (mir_strcmp(hook->pszModule, m_szModuleName)) + if (mir_strcmp(hook->si->pszModule, m_szModuleName)) return 0; switch (hook->iType) { diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h index c543da1301..8317f41793 100644 --- a/protocols/Twitter/src/stdafx.h +++ b/protocols/Twitter/src/stdafx.h @@ -42,7 +42,7 @@ typedef std::basic_string wstring; #include #include #include -#include +#include #include #include #include diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index bdbd18462e..1668e2959b 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -453,10 +453,10 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam) if (gch == nullptr) return 0; - if (mir_strcmpi(gch->pszModule, m_szModuleName)) + if (mir_strcmpi(gch->si->pszModule, m_szModuleName)) return 0; - CVkChatInfo *cc = GetChatById(gch->ptszID); + CVkChatInfo *cc = GetChatById(gch->si->ptszID); if (cc == nullptr) return 0; -- cgit v1.2.3