From f52b5cc86d9eff2494902157c8fc0a4e019a3c95 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 15 Aug 2017 13:49:37 +0300 Subject: fixes #799 (Crash on receiving msg in FB group chat) --- include/delphi/m_message.inc | 19 +++---------------- include/m_chat_int.h | 1 + include/m_message.h | 18 +++++------------- 3 files changed, 9 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/include/delphi/m_message.inc b/include/delphi/m_message.inc index 764287720a..c564f602f6 100644 --- a/include/delphi/m_message.inc +++ b/include/delphi/m_message.inc @@ -78,19 +78,10 @@ type function Srmm_GetWindowData(hContact:TMCONTACT; pResult:PMessageWindowData) : int; stdcall; external AppDll; -type - PStatusTextData = ^TStatusTextData; - TStatusTextData = record - hIcon :HICON; - tszText:array [0..99] of WideChar; - end; - -{ wparam=(TMCONTACT)hContact - lparam=PStatusTextData or NIL to clear statusbar - Sets a statusbar line text for the appropriate contact +{ wparam=0(unused) + lparam=(pMessageWindowEvent) event written + fired before SRMM writes an entered message into the database } -const - MS_MSG_SETSTATUSTEXT:PAnsiChar = 'MessageAPI/SetStatusText'; type pMessageWindowEvent = ^tMessageWindowEvent; @@ -101,10 +92,6 @@ type end; const -{ wparam=0(unused) - lparam=(pMessageWindowEvent) event written - fired before SRMM writes an entered message into the database -} ME_MSG_PRECREATEEVENT:PAnsiChar = 'MessageAPI/PreCreateEvent'; { wParam = 0 diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 83d81e3405..c1bee5babe 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -457,6 +457,7 @@ public: virtual void LoadSettings() PURE; virtual void RedrawLog() {} virtual void ScrollToBottom() {} + virtual void SetStatusText(const wchar_t*, HICON) {} virtual void ShowFilterMenu() {} virtual void StreamInEvents(LOGINFO*, bool) {} virtual void UpdateNickList() {} diff --git a/include/m_message.h b/include/m_message.h index 1af56057d0..f892f10219 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -67,19 +67,6 @@ struct MessageWindowEventData #define ME_MSG_WINDOWEVENT "MessageAPI/WindowEvent" -///////////////////////////////////////////////////////////////////////////////////////// -// wparam = (MCONTACT)hContact -// lparam = (StatusTextData*) or NULL to clear statusbar -// Sets a statusbar line text for the appropriate contact - -struct StatusTextData -{ - HICON hIcon; - wchar_t tszText[100]; -}; - -#define MS_MSG_SETSTATUSTEXT "MessageAPI/SetStatusText" - ///////////////////////////////////////////////////////////////////////////////////////// // retrieves some particular info about a SRMM window by contact // returns 0 if a window was found or an error code otherwise @@ -98,6 +85,11 @@ struct MessageWindowData EXTERN_C MIR_APP_DLL(int) Srmm_GetWindowData(MCONTACT hContact, MessageWindowData &mwd); +///////////////////////////////////////////////////////////////////////////////////////// +// sets the status text & icon in a window associated with hContact + +EXTERN_C MIR_APP_DLL(void) Srmm_SetStatusText(MCONTACT hContact, const wchar_t *wszText, HICON hIcon = nullptr); + ///////////////////////////////////////////////////////////////////////////////////////// // wparam = 0 (unused) // lparam = (MessageWindowEvent*) -- cgit v1.2.3