From fbed4e49ff41a49e2b8b09e0ccc1268aeffbada1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 6 Aug 2013 08:33:44 +0000 Subject: - DoTrimMessage removed and replaced with rtrim() - contactcache.cpp moved from a linked list to a sorted list git-svn-id: http://svn.miranda-ng.org/main/trunk@5598 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/log.cpp | 16 ++++++------- plugins/TabSRMM/src/chat/muchighlight.h | 42 ++++++++++++++++----------------- plugins/TabSRMM/src/chat/window.cpp | 10 ++++---- 3 files changed, 33 insertions(+), 35 deletions(-) (limited to 'plugins/TabSRMM/src/chat') diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 37930006af..25ff4df187 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -517,13 +517,14 @@ static void Log_Append(char **buffer, int *cbBufferEnd, int *cbBufferAlloced, co static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR *fmt, ...) { va_list va; - int lineLen, textCharsCount = 0; - TCHAR* line = (TCHAR*)alloca(8001 * sizeof(TCHAR)); - char* d; + int textCharsCount = 0; + char *d; + TCHAR *line = (TCHAR*)alloca(8001 * sizeof(TCHAR)); va_start(va, fmt); - lineLen = mir_vsntprintf(line, 8000, fmt, va); - if (lineLen < 0) lineLen = 8000; + int lineLen = mir_vsntprintf(line, 8000, fmt, va); + if (lineLen < 0) + lineLen = 8000; line[lineLen] = 0; va_end(va); @@ -546,9 +547,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff CopyMemory(d, "\\line ", 6); d += 6; } else if (*line == '%' && !simpleMode) { - char szTemp[200]; - - szTemp[0] = '\0'; + char szTemp[200]; szTemp[0] = '\0'; switch (*++line) { case '\0': case '%': @@ -559,7 +558,6 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff case 'f': if (g_Settings.bStripFormat || streamData->bStripFormat) line += 2; - else if (line[1] != '\0' && line[2] != '\0') { TCHAR szTemp3[3], c = *line; int col; diff --git a/plugins/TabSRMM/src/chat/muchighlight.h b/plugins/TabSRMM/src/chat/muchighlight.h index c552468577..8e9018778e 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.h +++ b/plugins/TabSRMM/src/chat/muchighlight.h @@ -58,26 +58,26 @@ public: cleanup(); } - void init (); - void cleanup (); - int match (const GCEVENT *pgce, const SESSION_INFO *psi, - DWORD dwFlags = MATCH_NICKNAME); + void init(); + void cleanup(); + int match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwFlags = MATCH_NICKNAME); + + static INT_PTR CALLBACK dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // option page dlg proc + static INT_PTR CALLBACK dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // for the "add to" dialog - static INT_PTR CALLBACK dlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // option page dlg proc - static INT_PTR CALLBACK dlgProcAdd (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // for the "add to" dialog private: - void tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr); - int wildmatch (const TCHAR *pattern, const TCHAR *tszString); - DWORD m_dwFlags; - bool m_fInitialized; - TCHAR** m_NickPatterns; - TCHAR** m_TextPatterns; - UINT m_iNickPatterns; - UINT m_iTextPatterns; - TCHAR * m_NickPatternString; - TCHAR * m_TextPatternString; - bool m_Valid; - bool m_fHighlightMe; + void tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr); + int wildmatch (const TCHAR *pattern, const TCHAR *tszString); + DWORD m_dwFlags; + bool m_fInitialized; + TCHAR** m_NickPatterns; + TCHAR** m_TextPatterns; + UINT m_iNickPatterns; + UINT m_iTextPatterns; + TCHAR *m_NickPatternString; + TCHAR *m_TextPatternString; + bool m_Valid; + bool m_fHighlightMe; }; struct THighLightEdit @@ -87,8 +87,8 @@ struct THighLightEdit CMD_EDIT = 2 }; - UINT uCmd; - SESSION_INFO *si; - USERINFO *ui; + UINT uCmd; + SESSION_INFO *si; + USERINFO *ui; }; diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 1c1d5c0b11..29941c9312 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1568,13 +1568,13 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, else if (wParam < ' ') break; else { - TCHAR szNew[2]; - szNew[0] = (TCHAR) wParam; - szNew[1] = '\0'; if (lstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) { MessageBeep(MB_OK); break; } + TCHAR szNew[2]; + szNew[0] = (TCHAR) wParam; + szNew[1] = '\0'; _tcscat(si->szSearch, szNew); } if (si->szSearch[0]) { @@ -3003,10 +3003,10 @@ LABEL_SHOWWINDOW: SM_AddCommand(si->ptszID, si->pszModule, pszRtf); ptrT ptszText( Chat_DoRtfToTags(pszRtf, si)); - if ((TCHAR*)ptszText == NULL) + if (ptszText == NULL) break; - DoTrimMessage(ptszText); + rtrimt(ptszText); if (mi && mi->bAckMsg) { Utils::enableDlgControl(hwndDlg, IDC_CHAT_MESSAGE, FALSE); -- cgit v1.2.3