summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/chat/log.cpp
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/log.cpp
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/log.cpp')
-rw-r--r--plugins/Scriver/src/chat/log.cpp20
1 files changed, 10 insertions, 10 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;