diff options
-rw-r--r-- | src/core/stdmsg/src/chat_util.cpp | 66 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 7 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 8 |
3 files changed, 7 insertions, 74 deletions
diff --git a/src/core/stdmsg/src/chat_util.cpp b/src/core/stdmsg/src/chat_util.cpp index 9e7654c57a..4e2c25b689 100644 --- a/src/core/stdmsg/src/chat_util.cpp +++ b/src/core/stdmsg/src/chat_util.cpp @@ -124,24 +124,6 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, bool bRedraw) ///////////////////////////////////////////////////////////////////////////////////////// -char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si) -{ - if (hwndDlg == 0 || si == 0) - return nullptr; - - char* pszText = nullptr; - EDITSTREAM stream; - memset(&stream, 0, sizeof(stream)); - stream.pfnCallback = Srmm_MessageStreamCallback; - stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer - - DWORD dwFlags = SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE | (CP_UTF8 << 16); - SendDlgItemMessage(hwndDlg, IDC_SRMM_MESSAGE, EM_STREAMOUT, dwFlags, (LPARAM)&stream); - return pszText; // pszText contains the text -} - -///////////////////////////////////////////////////////////////////////////////////////// - int GetRichTextLength(HWND hwnd) { GETTEXTLENGTHEX gtl; @@ -149,51 +131,3 @@ int GetRichTextLength(HWND hwnd) gtl.codepage = CP_ACP; return (int)SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0); } - -int GetColorIndex(const char* pszModule, COLORREF cr) -{ - MODULEINFO *pMod = pci->MM_FindModule(pszModule); - int i = 0; - - if (!pMod || pMod->nColorCount == 0) - return -1; - - for (i = 0; i < pMod->nColorCount; i++) - if (pMod->crColors[i] == cr) - return i; - - return -1; -} - -// obscure function that is used to make sure that any of the colors -// passed by the protocol is used as fore- or background color -// in the messagebox. THis is to vvercome limitations in the richedit -// that I do not know currently how to fix - -void CheckColorsInModule(const char* pszModule) -{ - MODULEINFO *pMod = pci->MM_FindModule(pszModule); - if (!pMod) - return; - - COLORREF crBG = (COLORREF)db_get_dw(0, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW)); - for (int i = 0; i < pMod->nColorCount; i++) { - if (pMod->crColors[i] == g_Settings.MessageAreaColor || pMod->crColors[i] == crBG) { - if (pMod->crColors[i] == RGB(255, 255, 255)) - pMod->crColors[i]--; - else - pMod->crColors[i]++; - } - } -} - -void ValidateFilename(wchar_t *filename) -{ - wchar_t *p1 = filename; - wchar_t szForbidden[] = L"\\/:*?\"<>|"; - while (*p1 != '\0') { - if (wcschr(szForbidden, *p1)) - *p1 = '_'; - p1 += 1; - } -} diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index bc644da732..8432929f09 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -121,7 +121,12 @@ void CChatRoomDlg::onClick_Ok(CCtrlButton *pButton) if (!pButton->Enabled()) return; - ptrA pszRtf(Message_GetFromStream(m_hwnd, m_si)); + ptrA pszRtf; + EDITSTREAM stream; + memset(&stream, 0, sizeof(stream)); + stream.pfnCallback = Srmm_MessageStreamCallback; + stream.dwCookie = (DWORD_PTR)&pszRtf; // pass pointer to pointer + m_message.SendMsg(EM_STREAMOUT, SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE | (CP_UTF8 << 16), (LPARAM)&stream); if (pszRtf == nullptr) return; diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 53cfdb2a66..29d888b6a1 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -123,7 +123,6 @@ void Unload_ChatModule(void); void Load_ChatModule(void);
// log.cpp
-void ValidateFilename(wchar_t *filename);
char* Log_CreateRtfHeader(MODULEINFO *mi);
// window.cpp
@@ -136,14 +135,9 @@ HICON LoadIconEx(const char *pszIcoLibName, bool big); HANDLE GetIconHandle(const char *pszIcolibName);
// tools.cpp
-int GetColorIndex(const char* pszModule, COLORREF cr);
-void CheckColorsInModule(const char* pszModule);
int GetRichTextLength(HWND hwnd);
void SetButtonsPos(HWND hwndDlg, bool bIsChat);
-// message.cpp
-char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si);
-
/////////////////////////////////////////////////////////////////////////////////////////
// tabs.cpp
@@ -222,7 +216,7 @@ public: virtual void CloseTab() override;
virtual void LoadSettings() override;
virtual void RedrawLog() override;
- virtual void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
+ virtual void StreamInEvents(LOGINFO *lin, bool bRedraw) override;
virtual void ScrollToBottom() override;
virtual void ShowFilterMenu() override;
virtual void UpdateNickList() override;
|