From 72fc3f5206fc56f1a573d6a284be413411679c57 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Dec 2023 16:51:59 +0300 Subject: Telegram: stickers are back --- libs/mTextControl/src/services.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'libs/mTextControl') 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; } -- cgit v1.2.3