diff options
34 files changed, 73 insertions, 118 deletions
diff --git a/include/m_chat.h b/include/m_chat.h index 6ea7a048ba..d3b91c1e3d 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -477,16 +477,13 @@ EXTERN_C MIR_APP_DLL(int) Chat_GetInfo(GC_INFO*); struct GCHOOK
{
- LPCSTR pszModule; // Name of the protocol (same as you registered with)
- LPCTSTR ptszID; // Unique identifier of the session, or NULL to broadcast to all sessions as specified above
int iType; // Use GC_EVENT_* as defined above. Only one event per service call.
-
LPTSTR ptszText; // usage depends on type of event
LPTSTR ptszUID; // unique identifier, usage depends on type of event
LPTSTR ptszNick; // user nick, as displayed in a nicklist
INT_PTR dwData; // user defined data, usage depends on type of event
- class CSrmmBaseDialog *pDlg; // dialog from which this event was called
+ SESSION_INFO *si; // session information
};
/*
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 291a95a71a..3bf29fc7d1 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -249,9 +249,14 @@ public: virtual LRESULT WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam); __forceinline bool isChat() const { return m_si != nullptr; } + __forceinline CSrmmLogWindow *log() const { return m_pLog; } __inline void *operator new(size_t size) { return calloc(1, size); } __inline void operator delete(void *p) { free(p); } }; +#ifndef SRMM_OWN_STRUCTURES +class CMsgDialog : public CSrmmBaseDialog {}; +#endif + #endif // M_MESSAGE_H__ diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 3b1764e595..146727511f 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -33,32 +33,17 @@ #include <newpluginapi.h>
-#include <m_awaymsg.h> // not used
-#include <m_button.h> // not used
-#include <m_chat.h> // not used
#include <m_clc.h>
#include <m_clist.h>
#include <m_contacts.h>
#include <m_database.h>
-#include <m_email.h> // not used
-#include <m_file.h> // not used
-#include <m_findadd.h> // not used
-#include <m_fontservice.h> // not used
-#include <m_genmenu.h> // not used
-#include <m_history.h> // not used
#include <m_icolib.h>
-#include <m_idle.h> // not used
-#include <m_ignore.h> // not used
#include <m_langpack.h>
-#include <m_message.h> // not used
-#include <m_netlib.h> // not used
#include <m_options.h>
-#include <m_popup.h> // not used
#include <m_protocols.h>
#include <m_protosvc.h>
#include <m_skin.h>
#include <m_system.h>
-#include <m_userinfo.h> // not used
#include <m_utils.h>
#include <m_imgsrvc.h>
#include <m_timezones.h>
diff --git a/plugins/IEView/src/ieview_logger.cpp b/plugins/IEView/src/ieview_logger.cpp index b9a8490011..2437b65bf9 100644 --- a/plugins/IEView/src/ieview_logger.cpp +++ b/plugins/IEView/src/ieview_logger.cpp @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EVENTTYPE_STATUSCHANGE 25368 #define EVENTTYPE_ERRMSG 25366 -class CMsgDialog : public CSrmmBaseDialog {}; - ///////////////////////////////////////////////////////////////////////////////////////// // CIeviewLogWindow class diff --git a/plugins/IEView/src/stdafx.h b/plugins/IEView/src/stdafx.h index 3e72669271..a91545c28f 100644 --- a/plugins/IEView/src/stdafx.h +++ b/plugins/IEView/src/stdafx.h @@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_contacts.h>
#include <win2k.h>
#include <m_avatars.h>
-#include <m_chat.h>
#include <m_icolib.h>
#include <m_netlib.h>
#include <m_srmm_int.h>
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index fcbb94a66a..d5c9e650ca 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -408,11 +408,9 @@ static int PluginMessageEventHook(WPARAM hContact, LPARAM hEvent) static int OnGcEvent(WPARAM, LPARAM lParam)
{
GCHOOK *gc = (GCHOOK *)lParam;
- if (gc->iType == GC_USER_MESSAGE && bFlashOnGC) {
- if (SESSION_INFO *si = g_chatApi.SM_FindSession(gc->ptszID, gc->pszModule))
- if (contactCheckProtocol(gc->pszModule, si->hContact, EVENTTYPE_MESSAGE) && checkNotifyOptions() && checkStatus(gc->pszModule))
- SetEvent(hFlashEvent);
- }
+ if (gc->iType == GC_USER_MESSAGE && bFlashOnGC)
+ if (contactCheckProtocol(gc->si->pszModule, gc->si->hContact, EVENTTYPE_MESSAGE) && checkNotifyOptions() && checkStatus(gc->si->pszModule))
+ SetEvent(hFlashEvent);
return 0;
}
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 7ce114f952..f56f0cfeec 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -19,7 +19,6 @@ #include <m_protocols.h>
#include <m_popup_int.h>
#include <m_message.h>
-#include <m_chat.h>
#include <m_skin.h>
#include <m_imgsrvc.h>
#include <m_xml.h>
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 <http://www.gnu.org/licenses/>. #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 <http://www.gnu.org/licenses/>. #include <m_system.h> #include <m_avatars.h> -#include <m_chat.h> #include <m_clistint.h> #include <m_contacts.h> #include <m_database.h> 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 <m_avatars.h>
#include <m_xml.h>
#include <m_json.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_popup.h>
#include <win2k.h>
#include <m_folders.h>
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<GCHOOK>(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",
"<thread><id>%d:%s</id><members><member><mri>%s</mri></member></members></thread>",
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",
"<thread><id>%d:%s</id><members><member><mri>%s</mri><role>%s</role></member></members></thread>",
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 <http://www.gnu.org/licenses/>. #include <m_langpack.h>
#include <m_netlib.h>
#include <m_popup.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_avatars.h>
#include <m_timezones.h>
#include <m_extraicons.h>
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<GCHOOK*>(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 <http://www.gnu.org/licenses/>. #include <newpluginapi.h> #include <m_system.h> -#include <m_chat.h> +#include <m_chat_int.h> #include <m_clistint.h> #include <m_langpack.h> #include <m_netlib.h> 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<GCHOOK*>(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 <http://www.gnu.org/licenses/>. #include <newpluginapi.h>
#include <m_system.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_clistint.h>
#include <m_langpack.h>
#include <m_netlib.h>
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 <m_idle.h>
#include <m_contacts.h>
#include <m_popup.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_genmenu.h>
#include <m_icolib.h>
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<GCHOOK*>(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<wchar_t> wstring; #include <newpluginapi.h>
#include <m_avatars.h>
#include <m_button.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_clistint.h>
#include <m_database.h>
#include <m_folders.h>
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;
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 3cc64078fe..4685fa5685 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -30,13 +30,6 @@ void Srmm_ProcessToolbarHotkey(MCONTACT hContact, INT_PTR iButtonFrom, HWND hwnd class CLogWindow : public CSrmmLogWindow {};
-class CMsgDialog : public CSrmmBaseDialog
-{
- friend void RedrawLog2(SESSION_INFO *si);
-
- CMsgDialog(); // just to suppress compiler's warnings, never implemented
-};
-
extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
extern HPLUGIN g_pChatPlugin;
extern GlobalLogSettingsBase *g_Settings;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 5a18edbe4f..9a514bb6cd 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -558,7 +558,9 @@ MIR_APP_DLL(BOOL) Chat_DoEventHook(SESSION_INFO *si, int iType, const USERINFO * if (si == nullptr)
return FALSE;
- GCHOOK gch = { si->pszModule, si->ptszID, iType };
+ GCHOOK gch = {};
+ gch.iType = iType;
+ gch.si = si;
if (pUser != nullptr) {
gch.ptszUID = pUser->pszUID;
gch.ptszNick = pUser->pszNick;
@@ -567,7 +569,6 @@ MIR_APP_DLL(BOOL) Chat_DoEventHook(SESSION_INFO *si, int iType, const USERINFO * gch.ptszText = (LPTSTR)pszText;
gch.dwData = dwItem;
- gch.pDlg = si->pDlg;
NotifyEventHooks(hevSendEvent, 0, (WPARAM)&gch);
return TRUE;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 4a92f525a5..bc8f8229f5 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -720,3 +720,4 @@ _UnregisterSrmmLog@4 @806 NONAME _WebSocket_Send@12 @808 NONAME
_WebSocket_InitHeader@12 @809 NONAME
_WebSocket_Connect@12 @810 NONAME
+?log@CSrmmBaseDialog@@QBEPAVCSrmmLogWindow@@XZ @811 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 447cc83c99..b952ccb7ef 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -720,3 +720,4 @@ UnregisterSrmmLog @806 NONAME WebSocket_Send @808 NONAME
WebSocket_InitHeader @809 NONAME
WebSocket_Connect @810 NONAME
+?log@CSrmmBaseDialog@@QEBAPEAVCSrmmLogWindow@@XZ @811 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 569b3eb5d8..4ee3aa3318 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -557,7 +557,7 @@ void RedrawLog2(SESSION_INFO *si) { si->LastTime = 0; if (si->pLog) - si->pDlg->m_pLog->LogEvents(si->pLogEnd, TRUE); + si->pDlg->log()->LogEvents(si->pLogEnd, TRUE); } static void __cdecl phase2(SESSION_INFO *si) |