From aae341e9afbea80ab1f1003307571625e73f1446 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 1 Dec 2024 14:17:39 +0300 Subject: SmileyAdd: added SMADD_SELECTSMILEY::szProto field for #4615 --- plugins/SmileyAdd/src/services.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/SmileyAdd') diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index f7419c7b77..5391ce58b1 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -326,14 +326,18 @@ static INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam) static INT_PTR SelectSmiley(WPARAM, LPARAM lParam) { auto *pParam = (SMADD_SELECTSMILEY *)lParam; - if (pParam == nullptr || !g_pEmoji) + if (pParam == nullptr) return 1; + auto *sml = (pParam->pszProto) ? FindSmileyPack(pParam->pszProto) : g_pEmoji; + if (sml == nullptr) + return 2; + SmileyPackType *pPack; if (pParam->pszSmileys) { ptrW pText(mir_utf8decodeW(pParam->pszSmileys)); pPack = new SmileyPackType(); - auto &pList = g_pEmoji->GetSmileyList(); + auto &pList = sml->GetSmileyList(); for (auto *p = wcstok(pText, L" "); p; p = wcstok(0, L" ")) { for (auto &it : pList) { @@ -344,7 +348,7 @@ static INT_PTR SelectSmiley(WPARAM, LPARAM lParam) } } } - else pPack = new SmileyPackType(*g_pEmoji); + else pPack = new SmileyPackType(*sml); SmileyToolWindowParam *stwp = new SmileyToolWindowParam; stwp->pSmileyPack = pPack; -- cgit v1.2.3