From 3e00af6e0b04bca9e5398f250c7dd4280da608cc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 28 Jan 2023 19:58:25 +0300 Subject: IRC: fix for event broadcasting --- include/m_chat.h | 12 +++++++++--- include/m_chat_int.h | 5 ----- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/m_chat.h b/include/m_chat.h index 096811cf3c..5cb316087a 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -354,12 +354,17 @@ MIR_APP_DLL(struct SESSION_INFO*) Chat_NewSession( #define GCEF_SILENT 0x0002 // never add to log #define GCEF_NOTNOTIFY 0x0004 #define GCEF_UTF8 0x0008 +#define GCEF_BROADCAST 0x0010 // means that pszModule is used struct SESSION_INFO; struct GCEVENT { - SESSION_INFO *si; // session to deal with + union { + SESSION_INFO *si; // session to deal with + const char *pszModule; // module name to broadcast + }; + int iType; // Use GC_EVENT_* as defined above. Only one event per service call. MAllCStrings pszText; // @@ -414,11 +419,12 @@ MIR_APP_DLL(int) Chat_SetStatusEx(SESSION_INFO *si, int flags, const wchar_t *ws #define WINDOW_HIDDEN 3 // close the room window. Session is not terminated. #define WINDOW_CLEARLOG 6 // clear the log of the room window -// if wszId == NULL, this message is broadcasted to all windows of specified szModule MIR_APP_DLL(int) Chat_Control(SESSION_INFO *si, int command); +MIR_APP_DLL(int) Chat_Terminate(SESSION_INFO *si, bool bRemoveContact = false); +// these functions broadcast a command to all windows of specified szModule +MIR_APP_DLL(int) Chat_Control(const char *szModule, int command); MIR_APP_DLL(int) Chat_Terminate(const char *szModule, bool bRemoveContact = false); -MIR_APP_DLL(int) Chat_Terminate(SESSION_INFO *si, bool bRemoveContact = false); ///////////////////////////////////////////////////////////////////////////////////////// // Use this function to get information on different aspects of the sessions that are registered with Chat. diff --git a/include/m_chat_int.h b/include/m_chat_int.h index b7be21801a..d72bff1b0f 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -273,9 +273,6 @@ struct CHAT_MANAGER { CHAT_MANAGER(); - void (*SetActiveSession)(SESSION_INFO *si); - SESSION_INFO* (*GetActiveSession)(void); - SESSION_INFO* (*SM_CreateSession)(void); SESSION_INFO* (*SM_FindSession)(const wchar_t *pszID, const char *pszModule); HICON (*SM_GetStatusIcon)(SESSION_INFO *si, USERINFO * ui); @@ -328,8 +325,6 @@ struct CHAT_MANAGER void (*CreateNick)(const SESSION_INFO *si, const LOGINFO *lin, CMStringW &dest); int logPixelSY, logPixelSX; - char *szActiveWndModule; - wchar_t *szActiveWndID; HICON hStatusIcons[STATUSICONCOUNT]; HBRUSH hListBkgBrush, hListSelectedBkgBrush; HANDLE hevWinPopup, hevPreCreate; -- cgit v1.2.3