summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-01 14:17:39 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-01 14:17:39 +0300
commitaae341e9afbea80ab1f1003307571625e73f1446 (patch)
tree8ad3f11f9bc604a41cdc5d0de3b065e811b7a2fc /plugins/SmileyAdd
parent48fce208e06bcc228c63087d264b783740f17cd6 (diff)
SmileyAdd: added SMADD_SELECTSMILEY::szProto field for #4615
Diffstat (limited to 'plugins/SmileyAdd')
-rw-r--r--plugins/SmileyAdd/src/services.cpp10
1 files changed, 7 insertions, 3 deletions
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;