summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/ExternalAPI/m_smileyadd.h1
-rw-r--r--plugins/SmileyAdd/src/services.cpp10
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/ExternalAPI/m_smileyadd.h b/plugins/ExternalAPI/m_smileyadd.h
index f9bc17ea6a..e93c36a936 100644
--- a/plugins/ExternalAPI/m_smileyadd.h
+++ b/plugins/ExternalAPI/m_smileyadd.h
@@ -213,6 +213,7 @@ void __forceinline SmileyAdd_LoadContactSmileys(int type, const char *pszModule,
struct SMADD_SELECTSMILEY
{
+ const char *pszProto; // protocol module or NULL for emoji
const char *pszSmileys; // list of smileys or zero to display all pack
int xPosition;
int yPosition;
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;