summaryrefslogtreecommitdiff
path: root/libs/mTextControl
diff options
context:
space:
mode:
Diffstat (limited to 'libs/mTextControl')
-rw-r--r--libs/mTextControl/src/services.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/libs/mTextControl/src/services.cpp b/libs/mTextControl/src/services.cpp
index 3dcb82fd19..040fa973c3 100644
--- a/libs/mTextControl/src/services.cpp
+++ b/libs/mTextControl/src/services.cpp
@@ -34,19 +34,6 @@ void MText_InitFormatting1(TextObject *text)
{
// bbcodes
bbCodeParse(text->ftd);
-
- // smilies
- HWND hwnd = CreateProxyWindow();
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)text->ftd->getTextService());
-
- SMADD_RICHEDIT sm = {};
- sm.hwndRichEditControl = hwnd;
- sm.rangeToReplace = nullptr;
- sm.Protocolname = text->szProto;
- sm.flags = SAFLRE_INSERTEMF;
- CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm);
-
- SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -205,6 +192,20 @@ MTEXTCONTROL_DLL(int) MTextSetProto(TextObject *text, MCONTACT hContact, const c
text->hContact = hContact;
text->szProto = szProto;
+
+ // smilies
+ HWND hwnd = CreateProxyWindow();
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)text->ftd->getTextService());
+
+ SMADD_RICHEDIT sm = {};
+ sm.hwndRichEditControl = hwnd;
+ sm.rangeToReplace = nullptr;
+ sm.hContact = text->hContact;
+ sm.Protocolname = text->szProto;
+ sm.flags = SAFLRE_INSERTEMF;
+ CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm);
+
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
return TRUE;
}