summaryrefslogtreecommitdiff
path: root/src/core/stdmsg/src/msglog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/stdmsg/src/msglog.cpp')
-rw-r--r--src/core/stdmsg/src/msglog.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index b06bdb9b64..c3527c5660 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -425,9 +425,21 @@ void CSrmmWindow::StreamInEvents(MEVENT hDbEventFirst, int count, bool bAppend)
if (!bottomScroll)
m_log.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&scrollPos);
}
+
+ FINDTEXTEXA fi;
if (bAppend) {
sel.cpMin = sel.cpMax = -1;
m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ fi.chrg.cpMin = 0;
+ }
+ else {
+ GETTEXTLENGTHEX gtxl = { 0 };
+ gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
+ gtxl.codepage = 1200;
+ fi.chrg.cpMin = m_log.SendMsg(EM_GETTEXTLENGTHEX, (WPARAM)&gtxl, 0);
+
+ sel.cpMin = sel.cpMax = m_log.GetRichTextLength();
+ m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
}
mir_strcpy(szSep2, bAppend ? "\\par\\sl0" : "\\sl1000");
@@ -444,6 +456,27 @@ void CSrmmWindow::StreamInEvents(MEVENT hDbEventFirst, int count, bool bAppend)
m_log.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&scrollPos);
}
+ if (g_dat.bSmileyInstalled) {
+ SMADD_RICHEDIT3 smre;
+ smre.cbSize = sizeof(SMADD_RICHEDIT3);
+ smre.hwndRichEditControl = m_log.GetHwnd();
+
+ MCONTACT hContact = db_mc_getSrmmSub(m_hContact);
+ smre.Protocolname = (hContact != 0) ? GetContactProto(hContact) : m_szProto;
+
+ if (fi.chrg.cpMin > 0) {
+ sel.cpMin = fi.chrg.cpMin;
+ sel.cpMax = -1;
+ smre.rangeToReplace = &sel;
+ }
+ else smre.rangeToReplace = nullptr;
+
+ smre.disableRedraw = TRUE;
+ smre.hContact = m_hContact;
+ smre.flags = 0;
+ CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&smre);
+ }
+
m_log.SendMsg(WM_SETREDRAW, TRUE, 0);
if (bottomScroll)
RedrawWindow(m_log.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);