diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-06 08:33:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-06 08:33:44 +0000 |
commit | fbed4e49ff41a49e2b8b09e0ccc1268aeffbada1 (patch) | |
tree | 54c8ef840bbbbc2f12faf3c00700adb1b2741ff9 /plugins/TabSRMM/src/chat | |
parent | e2a9e8224e94127cc73cf62ebfb2a8dfee078c0c (diff) |
- 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
Diffstat (limited to 'plugins/TabSRMM/src/chat')
-rw-r--r-- | plugins/TabSRMM/src/chat/log.cpp | 16 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/muchighlight.h | 42 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 10 |
3 files changed, 33 insertions, 35 deletions
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);
|