diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-18 15:00:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-18 15:00:44 +0300 |
commit | b38f2534004135415ae8d576c7f3bb41785ca7e7 (patch) | |
tree | 895e89ce5da30f91995943686ef558a6ca8cd2ca /plugins/TabSRMM | |
parent | cd5679ac850cd43c1b681de6485c8ec30a9e8e1d (diff) |
- further group chats unification;
- LOGSTREAMDATA / GCLogStreamDataBase removed from g_chatApi;
- CRtfLogWindow now in charge of all RTF processing- Srmm_LogStreamCallback is also removed and hidden inside the core
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/chat.h | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_log.cpp | 230 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_main.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_options.cpp | 7 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 32 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgoptions.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 3 |
8 files changed, 120 insertions, 168 deletions
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h index 0c4a88a64b..29fd9e4596 100644 --- a/plugins/TabSRMM/src/chat.h +++ b/plugins/TabSRMM/src/chat.h @@ -50,12 +50,6 @@ struct MODULEINFO : public GCModuleInfoBase wchar_t tszIdleMsg[60];
};
-struct LOGSTREAMDATA : public GCLogStreamDataBase
-{
- int crCount;
- CMsgDialog *dat;
-};
-
struct TMUCSettings : public GlobalLogSettingsBase
{
HICON hIconOverlay;
@@ -81,10 +75,6 @@ extern TMUCSettings g_Settings; //////////////////////////////////////////////////////////////////////////////////
-// log.c
-char* Log_CreateRtfHeader(void);
-char* Log_CreateRTF(LOGSTREAMDATA *streamData);
-
// options.c
enum { FONTSECTION_AUTO, FONTSECTION_IM, FONTSECTION_IP };
void LoadMsgDlgFont(int section, int i, LOGFONTW *lf, COLORREF *colour = nullptr);
diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp index 624384a362..49e573aed3 100644 --- a/plugins/TabSRMM/src/chat_log.cpp +++ b/plugins/TabSRMM/src/chat_log.cpp @@ -133,7 +133,7 @@ static int EventToIcon(const LOGINFO &lin) return 0;
}
-static void Log_AppendRTF(LOGSTREAMDATA *streamData, const LOGINFO &lin, bool simpleMode, CMStringA &str, const wchar_t *line)
+static void Log_AppendRTF(RtfChatLogStreamData *streamData, const LOGINFO &lin, bool simpleMode, CMStringA &str, const wchar_t *line)
{
int textCharsCount = 0;
@@ -220,23 +220,10 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, const LOGINFO &lin, bool si str += res;
}
-static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData, const LOGINFO &lin)
-{
- if (streamData == nullptr)
- return;
-
- CMStringW wszCaption;
- bool bTextUsed = Chat_GetDefaultEventDescr(streamData->si, &lin, wszCaption);
- if (!wszCaption.IsEmpty())
- Log_AppendRTF(streamData, lin, !bTextUsed, str, wszCaption);
- if (!bTextUsed && lin.ptszText) {
- if (!wszCaption.IsEmpty())
- Log_AppendRTF(streamData, lin, false, str, L" ");
- Log_AppendRTF(streamData, lin, false, str, lin.ptszText);
- }
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// RTF header
-char* Log_CreateRtfHeader(void)
+void CLogWindow::CreateChatRtfHeader(RtfChatLogStreamData *streamData)
{
// get the number of pixels per logical inch
if (g_chatApi.logPixelSY == 0) {
@@ -247,9 +234,10 @@ char* Log_CreateRtfHeader(void) }
// ### RTF HEADER
+ CMStringA &str = streamData->buf;
// font table
- CMStringA str("{\\rtf1\\ansi\\deff0{\\fonttbl");
+ str.Append("{\\rtf1\\ansi\\deff0{\\fonttbl");
for (int i = 0; i < OPTIONS_FONTCOUNT; i++)
str.AppendFormat("{\\f%u\\fnil\\fcharset%u%S;}", i, g_chatApi.aFonts[i].lf.lfCharSet, g_chatApi.aFonts[i].lf.lfFaceName);
@@ -298,140 +286,122 @@ char* Log_CreateRtfHeader(void) iIndent += iSize;
}
str.AppendFormat("\\fi-%u\\li%u", iIndent, iIndent);
-
- return str.Detach();
}
-char* Log_CreateRTF(LOGSTREAMDATA *streamData)
+/////////////////////////////////////////////////////////////////////////////////////////
+// RTF event
+
+void CLogWindow::CreateChatRtfEvent(RtfChatLogStreamData *streamData, const LOGINFO &lin)
{
SESSION_INFO *si = streamData->si;
- MODULEINFO *mi = si->pMI;
+ CMStringA &str = streamData->buf;
- // ### RTF HEADER
+ if (streamData->iStartEvent != 0)
+ str.Append("\\par ");
- if (mi->pszHeader == nullptr)
- mi->pszHeader = Log_CreateRtfHeader();
+ if (m_pDlg.m_bDividerWanted) {
+ static char szStyle_div[128] = "\0";
+ if (szStyle_div[0] == 0)
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
- char *header = mi->pszHeader;
- streamData->crCount = 0;
+ if (streamData->iStartEvent != si->arEvents.getCount() - 1 || !streamData->bAppend)
+ str.AppendFormat("\\qc\\sl-1\\highlight%d %s ---------------------------------------------------------------------------------------\\par ", 18, szStyle_div);
+ m_pDlg.m_bDividerWanted = false;
+ }
+ // create new line, and set font and color
+ str.AppendFormat("\\ql\\sl0%s ", g_chatApi.Log_SetStyle(0));
+ str.AppendFormat("\\v~-+%p+-~\\v0 ", &lin);
- CMStringA str;
- if (header)
- str.Append(header);
+ // Insert icon
+ if (g_Settings.bLogSymbols) // use symbols
+ str.AppendFormat("%s %c", g_chatApi.Log_SetStyle(17), EventToSymbol(lin));
+ else if (g_Settings.dwIconFlags) {
+ int iIndex = lin.bIsHighlighted ? ICON_HIGHLIGHT : EventToIcon(lin);
+ str.Append("\\f0\\fs14");
+ str.Append(g_chatApi.pLogIconBmpBits[iIndex]);
+ }
- // ### RTF BODY (one iteration per event that should be streamed in)
- int iEventCount = si->arEvents.getCount();
- for (int i = streamData->iStartEvent; i < iEventCount; i++) {
- auto &lin = si->arEvents[i];
+ if (g_Settings.bTimeStampEventColour) {
+ // colored timestamps
+ static char szStyle[256];
+ LOGFONT &F = g_chatApi.aFonts[0].lf;
+ int iii;
+ if (lin.ptszNick && lin.iType == GC_EVENT_MESSAGE) {
+ iii = lin.bIsHighlighted ? 16 : (lin.bIsMe ? 2 : 1);
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / g_chatApi.logPixelSY);
+ str.Append(szStyle);
+ }
+ else {
+ iii = lin.bIsHighlighted ? 16 : EventToIndex(lin);
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / g_chatApi.logPixelSY);
+ str.Append(szStyle);
+ }
+ }
+ else str.Append(g_chatApi.Log_SetStyle(0));
+ str.AppendChar(' ');
- // filter
- if ((si->iType != GCW_CHATROOM && si->iType != GCW_PRIVMESS) || (si->pDlg->m_iLogFilterFlags & lin.iType) != 0) {
- if (i != 0)
- str.Append("\\par ");
+ // insert a TAB if necessary to put the timestamp in the right position
+ if (g_Settings.dwIconFlags)
+ str.Append("\\tab ");
- if (streamData->dat->m_bDividerWanted) {
- static char szStyle_div[128] = "\0";
- if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
+ // insert timestamp
+ if (g_Settings.bShowTime) {
+ wchar_t szTimeStamp[30], szOldTimeStamp[30];
- if (i != iEventCount - 1 || !streamData->bRedraw)
- str.AppendFormat("\\qc\\sl-1\\highlight%d %s ---------------------------------------------------------------------------------------\\par ", 18, szStyle_div);
- streamData->dat->m_bDividerWanted = false;
- }
- // create new line, and set font and color
- str.AppendFormat("\\ql\\sl0%s ", g_chatApi.Log_SetStyle(0));
- str.AppendFormat("\\v~-+%p+-~\\v0 ", &lin);
-
- // Insert icon
- if (g_Settings.bLogSymbols) // use symbols
- str.AppendFormat("%s %c", g_chatApi.Log_SetStyle(17), EventToSymbol(lin));
- else if (g_Settings.dwIconFlags) {
- int iIndex = lin.bIsHighlighted ? ICON_HIGHLIGHT : EventToIcon(lin);
- str.Append("\\f0\\fs14");
- str.Append(g_chatApi.pLogIconBmpBits[iIndex]);
- }
+ wcsncpy_s(szTimeStamp, g_chatApi.MakeTimeStamp(g_Settings.pszTimeStamp, lin.time), _TRUNCATE);
+ wcsncpy_s(szOldTimeStamp, g_chatApi.MakeTimeStamp(g_Settings.pszTimeStamp, si->LastTime), _TRUNCATE);
+ if (!g_Settings.bShowTimeIfChanged || si->LastTime == 0 || mir_wstrcmp(szTimeStamp, szOldTimeStamp)) {
+ si->LastTime = lin.time;
+ Log_AppendRTF(streamData, lin, TRUE, str, szTimeStamp);
+ }
+ str.Append("\\tab ");
+ }
- if (g_Settings.bTimeStampEventColour) {
- // colored timestamps
- static char szStyle[256];
- LOGFONT &F = g_chatApi.aFonts[0].lf;
- int iii;
- if (lin.ptszNick && lin.iType == GC_EVENT_MESSAGE) {
- iii = lin.bIsHighlighted ? 16 : (lin.bIsMe ? 2 : 1);
- mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
- iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / g_chatApi.logPixelSY);
- str.Append(szStyle);
- }
- else {
- iii = lin.bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
- iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / g_chatApi.logPixelSY);
- str.Append(szStyle);
- }
- }
- else str.Append(g_chatApi.Log_SetStyle(0));
- str.AppendChar(' ');
-
- // insert a TAB if necessary to put the timestamp in the right position
- if (g_Settings.dwIconFlags)
- str.Append("\\tab ");
-
- // insert timestamp
- if (g_Settings.bShowTime) {
- wchar_t szTimeStamp[30], szOldTimeStamp[30];
-
- wcsncpy_s(szTimeStamp, g_chatApi.MakeTimeStamp(g_Settings.pszTimeStamp, lin.time), _TRUNCATE);
- wcsncpy_s(szOldTimeStamp, g_chatApi.MakeTimeStamp(g_Settings.pszTimeStamp, si->LastTime), _TRUNCATE);
- if (!g_Settings.bShowTimeIfChanged || si->LastTime == 0 || mir_wstrcmp(szTimeStamp, szOldTimeStamp)) {
- si->LastTime = lin.time;
- Log_AppendRTF(streamData, lin, TRUE, str, szTimeStamp);
- }
- str.Append("\\tab ");
- }
+ // Insert the nick
+ if (lin.ptszNick && lin.iType == GC_EVENT_MESSAGE) {
+ char pszIndicator[3] = "\0\0";
+ int crNickIndex = 0;
- // Insert the nick
- if (lin.ptszNick && lin.iType == GC_EVENT_MESSAGE) {
- char pszIndicator[3] = "\0\0";
- int crNickIndex = 0;
+ if (g_Settings.bLogClassicIndicators || g_Settings.bColorizeNicksInLog)
+ pszIndicator[0] = GetIndicator(si, lin.ptszNick, &crNickIndex);
- if (g_Settings.bLogClassicIndicators || g_Settings.bColorizeNicksInLog)
- pszIndicator[0] = GetIndicator(si, lin.ptszNick, &crNickIndex);
+ str.Append(g_chatApi.Log_SetStyle(lin.bIsMe ? 2 : 1));
+ str.AppendChar(' ');
- str.Append(g_chatApi.Log_SetStyle(lin.bIsMe ? 2 : 1));
- str.AppendChar(' ');
+ if (g_Settings.bLogClassicIndicators)
+ str.Append(pszIndicator);
- if (g_Settings.bLogClassicIndicators)
- str.Append(pszIndicator);
+ CMStringW pszTemp(lin.bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick);
+ if (!lin.bIsMe) {
+ if (g_Settings.bClickableNicks)
+ pszTemp.Replace(L"%n", CLICKNICK_BEGIN L"%n" CLICKNICK_END);
- CMStringW pszTemp(lin.bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick);
- if (!lin.bIsMe) {
- if (g_Settings.bClickableNicks)
- pszTemp.Replace(L"%n", CLICKNICK_BEGIN L"%n" CLICKNICK_END);
+ if (g_Settings.bColorizeNicksInLog && pszIndicator[0])
+ str.AppendFormat("\\cf%u ", OPTIONS_FONTCOUNT + Utils::rtf_clrs.getCount() + crNickIndex);
+ }
+ pszTemp.Replace(L"%n", lin.ptszNick);
- if (g_Settings.bColorizeNicksInLog && pszIndicator[0])
- str.AppendFormat("\\cf%u ", OPTIONS_FONTCOUNT + Utils::rtf_clrs.getCount() + streamData->crCount + crNickIndex);
- }
- pszTemp.Replace(L"%n", lin.ptszNick);
+ if (g_Settings.bNewLineAfterNames)
+ pszTemp.AppendChar('\n');
- if (g_Settings.bNewLineAfterNames)
- pszTemp.AppendChar('\n');
+ Log_AppendRTF(streamData, lin, TRUE, str, pszTemp);
+ str.AppendChar(' ');
+ }
- Log_AppendRTF(streamData, lin, TRUE, str, pszTemp);
- str.AppendChar(' ');
- }
+ // Insert the message
+ str.Append(g_chatApi.Log_SetStyle(lin.bIsHighlighted ? 16 : EventToIndex(lin)));
+ str.AppendChar(' ');
- // Insert the message
- str.Append(g_chatApi.Log_SetStyle(lin.bIsHighlighted ? 16 : EventToIndex(lin)));
- str.AppendChar(' ');
- AddEventToBuffer(str, streamData, lin);
- }
+ CMStringW wszCaption;
+ bool bTextUsed = Chat_GetDefaultEventDescr(streamData->si, &lin, wszCaption);
+ if (!wszCaption.IsEmpty())
+ Log_AppendRTF(streamData, lin, !bTextUsed, str, wszCaption);
+ if (!bTextUsed && lin.ptszText) {
+ if (!wszCaption.IsEmpty())
+ Log_AppendRTF(streamData, lin, false, str, L" ");
+ Log_AppendRTF(streamData, lin, false, str, lin.ptszText);
}
-
- // ### RTF END
- if (streamData->bRedraw)
- str.Append("\\par}");
- else
- str.Append("}");
- return str.Detach();
}
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index c095cc94e0..1a4a20082a 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -376,8 +376,6 @@ int Chat_Load() g_chatApi.IsHighlighted = IsHighlighted;
oldDoPopup = g_chatApi.DoPopup; g_chatApi.DoPopup = DoPopup;
oldDoTrayIcon = g_chatApi.DoTrayIcon; g_chatApi.ShowPopup = ShowPopup;
- g_chatApi.Log_CreateRTF = Log_CreateRTF;
- g_chatApi.Log_CreateRtfHeader = Log_CreateRtfHeader;
g_chatApi.UM_CompareItem = UM_CompareItem;
g_chatApi.ReloadSettings();
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 93c78a9817..40c2c9ca4e 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -126,7 +126,7 @@ static FontOptionsList IP_fontOptionsList[] = { LPGENW("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
};
-void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour)
+void LoadMsgDlgFont(int section, int i, LOGFONTW *lf, COLORREF* colour)
{
char str[32];
int db_idx = (section == FONTSECTION_IM) ? i : i + 100;
@@ -394,8 +394,7 @@ int FontServiceFontsChanged(WPARAM, LPARAM) {
g_chatApi.ReloadSettings();
g_chatApi.MM_IconsChanged();
- g_chatApi.MM_FontsChanged();
-
+
PluginConfig.reloadSettings();
CSkin::initAeroEffect();
CacheMsgLogIcons();
@@ -469,7 +468,7 @@ protected: {
g_chatApi.ReloadSettings();
g_chatApi.MM_IconsChanged();
- g_chatApi.MM_FontsChanged();
+
Chat_UpdateOptions();
Chat_ReconfigureFilters();
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 1b3003ee04..5043f45e8d 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -56,7 +56,7 @@ void CMsgDialog::AddLog() }
}
- CSrmmBaseDialog::AddLog();
+ CSuper::AddLog();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 709b44a3d0..89cd3e7d34 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1226,24 +1226,22 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DB::Ev /////////////////////////////////////////////////////////////////////////////////////////
-void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bRedraw)
+void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bAppend)
{
if (m_rtf.GetHwnd() == nullptr || si == nullptr)
return;
auto &lin = si->arEvents[iStart];
- if (!bRedraw && m_pDlg.AllowTyping() && !(m_pDlg.m_iLogFilterFlags & lin.iType))
+ if (!bAppend && m_pDlg.AllowTyping() && !(m_pDlg.m_iLogFilterFlags & lin.iType))
return;
bool bFlag = false, bDoReplace, bAtBottom = AtBottom();
- LOGSTREAMDATA streamData;
- memset(&streamData, 0, sizeof(streamData));
- streamData.hwnd = m_rtf.GetHwnd();
+ RtfChatLogStreamData streamData;
+ streamData.pLog = this;
streamData.si = si;
streamData.iStartEvent = iStart;
streamData.bStripFormat = FALSE;
- streamData.dat = &m_pDlg;
POINT point = { 0 };
m_rtf.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&point);
@@ -1260,13 +1258,13 @@ void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bRedraw) // fix for the indent... must be a M$ bug
if (sel.cpMax == 0)
- bRedraw = TRUE;
+ bAppend = TRUE;
// should the event(s) be appended to the current log
- WPARAM wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
+ WPARAM wp = bAppend ? SF_RTF : SFF_SELECTION | SF_RTF;
// get the number of pixels per logical inch
- if (bRedraw) {
+ if (bAppend) {
HDC hdc = GetDC(nullptr);
g_chatApi.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
g_chatApi.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX);
@@ -1275,22 +1273,16 @@ void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bRedraw) bFlag = true;
}
- // stream in the event(s)
- streamData.bRedraw = bRedraw;
-
- EDITSTREAM stream = {};
- stream.pfnCallback = Srmm_LogStreamCallback;
- stream.dwCookie = (DWORD_PTR)&streamData;
- m_rtf.SendMsg(EM_STREAMIN, wp, (LPARAM)&stream);
+ StreamChatRtfEvents(&streamData, bAppend);
// for new added events, only replace in message or action events.
// no need to replace smileys or math formulas elsewhere
- bDoReplace = (bRedraw || (lin.ptszText && (lin.iType == GC_EVENT_MESSAGE || lin.iType == GC_EVENT_ACTION)));
+ bDoReplace = (bAppend || (lin.ptszText && (lin.iType == GC_EVENT_MESSAGE || lin.iType == GC_EVENT_ACTION)));
// replace marked nicknames with hyperlinks to make the nicks clickable
if (g_Settings.bClickableNicks) {
FINDTEXTEX fi, fi2;
- fi.chrg.cpMin = bRedraw ? 0 : sel.cpMin;
+ fi.chrg.cpMin = bAppend ? 0 : sel.cpMin;
fi.chrg.cpMax = -1;
fi.lpstrText = CLICKNICK_BEGIN;
@@ -1334,7 +1326,7 @@ void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bRedraw) SMADD_RICHEDIT3 sm = { sizeof(sm) };
sm.hwndRichEditControl = m_rtf.GetHwnd();
sm.Protocolname = si->pszModule;
- sm.rangeToReplace = bRedraw ? nullptr : &newsel;
+ sm.rangeToReplace = bAppend ? nullptr : &newsel;
sm.disableRedraw = TRUE;
sm.hContact = si->hContact;
CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm);
@@ -1358,7 +1350,7 @@ void CLogWindow::LogEvents(SESSION_INFO *si, int iStart, bool bRedraw) }
// scroll log to bottom if the log was previously scrolled to bottom, else restore old position
- if (bRedraw || bAtBottom)
+ if (bAppend || bAtBottom)
ScrollToBottom(false, false);
else
m_rtf.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&point);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index d94ecf0eb8..60cecb9087 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -578,7 +578,7 @@ public: TextOutW(dis->hDC, dis->rcItem.left, dis->rcItem.top, pwszName, (int)mir_wstrlen(pwszName));
}
- return CSrmmBaseDialog::DlgProc(uMsg, wParam, lParam);
+ return CSuper::DlgProc(uMsg, wParam, lParam);
}
void onChange_Text(CCtrlEdit *)
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 79032e37b0..439f506308 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -690,6 +690,9 @@ public: void CreateRtfHeader(RtfLogStreamData *streamData) override;
bool CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbei) override;
+ void CreateChatRtfHeader(RtfChatLogStreamData *dat) override;
+ void CreateChatRtfEvent(RtfChatLogStreamData *dat, const LOGINFO &lin) override;
+
void AppendUnicodeString(CMStringA &str, const wchar_t *pwszBuf) override;
void Attach() override;
void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override;
|