diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-20 16:51:59 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-20 16:51:59 +0300 |
commit | 72fc3f5206fc56f1a573d6a284be413411679c57 (patch) | |
tree | f24cba22844714c423931157d8045f839f736c00 /libs/mTextControl | |
parent | d80970d9b26b5e9b7868ec61349490da5e24dc64 (diff) |
Telegram: stickers are back
Diffstat (limited to 'libs/mTextControl')
-rw-r--r-- | libs/mTextControl/src/services.cpp | 27 |
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; } |