summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-01 21:43:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-01 21:43:00 +0000
commita4570b58a7efb3b61db6d03b86d51d7be85a5f03 (patch)
tree059840bb704c9553a3c1c94514359b431231fcb3 /plugins/Scriver/src/chat
parent585bd37dd3830d07c1d20b492fe0d4a84201b09a (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11204 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/chat')
-rw-r--r--plugins/Scriver/src/chat/log.cpp20
-rw-r--r--plugins/Scriver/src/chat/options.cpp4
-rw-r--r--plugins/Scriver/src/chat/window.cpp6
3 files changed, 15 insertions, 15 deletions
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp
index 225945e3d7..3a616bff6e 100644
--- a/plugins/Scriver/src/chat/log.cpp
+++ b/plugins/Scriver/src/chat/log.cpp
@@ -33,11 +33,11 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = pci->Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
+ lstrdat->bufferLen = (int)mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
- *pcb = min(cb, lstrdat->bufferLen - lstrdat->bufferOffset);
+ *pcb = min(cb, LONG(lstrdat->bufferLen - lstrdat->bufferOffset));
CopyMemory(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
lstrdat->bufferOffset += *pcb;
@@ -56,6 +56,11 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra
if (hwndDlg == 0 || lin == 0 || si == 0)
return;
+ if (!bRedraw && (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) && si->bFilterEnabled && !(si->iLogFilterFlags & lin->iType))
+ return;
+
+ BOOL bFlag = FALSE;
+
HWND hwndRich = GetDlgItem(hwndDlg, IDC_CHAT_LOG);
LOGSTREAMDATA streamData;
@@ -66,14 +71,9 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra
streamData.bStripFormat = FALSE;
streamData.isFirst = bRedraw ? 1 : (GetRichTextLength(hwndRich, CP_ACP, FALSE) == 0);
- if (!bRedraw && (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) && si->bFilterEnabled && !(si->iLogFilterFlags & lin->iType))
- return;
-
- BOOL bFlag = FALSE;
-
EDITSTREAM stream = { 0 };
stream.pfnCallback = Log_StreamCallback;
- stream.dwCookie = (DWORD_PTR)& streamData;
+ stream.dwCookie = (DWORD_PTR)&streamData;
SCROLLINFO scroll;
scroll.cbSize = sizeof(SCROLLINFO);
@@ -113,8 +113,8 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra
SendMessage(hwndRich, EM_STREAMIN, wp, (LPARAM)&stream);
// do smileys
- if (g_dat.smileyAddInstalled && (bRedraw || (lin->ptszText && lin->iType != GC_EVENT_JOIN
- && lin->iType != GC_EVENT_NICK && lin->iType != GC_EVENT_ADDSTATUS && lin->iType != GC_EVENT_REMOVESTATUS)))
+ if (g_dat.smileyAddInstalled && (bRedraw || (lin->ptszText &&
+ lin->iType != GC_EVENT_JOIN && lin->iType != GC_EVENT_NICK && lin->iType != GC_EVENT_ADDSTATUS && lin->iType != GC_EVENT_REMOVESTATUS)))
{
newsel.cpMax = -1;
newsel.cpMin = sel.cpMin;
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index d06a6a8c50..09b24b9483 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -520,7 +520,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS));
if (iLen > 0) {
- TCHAR *ptszText = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR));
+ TCHAR *ptszText = (TCHAR*)mir_alloc((iLen + 2) * sizeof(TCHAR));
TCHAR *p2 = NULL;
if (ptszText) {
@@ -538,7 +538,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
if (iLen > 0) {
- TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR)+2);
+ TCHAR *pszText1 = (TCHAR*)malloc(iLen*sizeof(TCHAR)+2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
free(pszText1);
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index 0fa3c1485d..833b8acfc1 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -221,7 +221,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
bool isTopic = false, isRoom = false;
TCHAR *pszName = NULL;
- TCHAR* pszText = (TCHAR *)mir_alloc(iLen + 100 * sizeof(TCHAR));
+ TCHAR* pszText = (TCHAR*)mir_alloc(iLen + 100 * sizeof(TCHAR));
gt.cb = iLen + 99 * sizeof(TCHAR);
gt.flags = GT_DEFAULT;
@@ -285,7 +285,7 @@ LBL_SkipEnd:
if (end != start) {
ptrT szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (TCHAR *)mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
+ szReplace = (TCHAR*)mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
_tcscpy(szReplace, pszName);
_tcscat(szReplace, _T(": "));
pszName = szReplace;
@@ -1441,7 +1441,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
}
SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, mir_tstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;