summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/smltool.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-08-16 14:54:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-08-16 14:54:26 +0300
commitafa6a68cca2865a4d974143dc1a289e4f83a5e1c (patch)
tree60deb305af0207f31fd5f62da5b160c25668dbfb /plugins/SmileyAdd/src/smltool.cpp
parent8e0f6324331fa9ac7425bb155321cbe2726e0161 (diff)
SmileyAdd:
- major update for custom smileys APIs (cause we have no MSN, there's no need to save MCONTACT for custom smileys); - added path type = 2 to download whole folder for custom smileys; - fixes #2524 (ICQ: стикеры должны приходить как custom smileys, а не как передачи файлов); - fixes #2533 (SmileyAdd не всегда распознаёт стикеры); - fixes #2532 (Полученные стикеры пропадают при переоткрытии окна); - version bump
Diffstat (limited to 'plugins/SmileyAdd/src/smltool.cpp')
-rw-r--r--plugins/SmileyAdd/src/smltool.cpp35
1 files changed, 5 insertions, 30 deletions
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp
index 1c50b5dc5b..648fa473f6 100644
--- a/plugins/SmileyAdd/src/smltool.cpp
+++ b/plugins/SmileyAdd/src/smltool.cpp
@@ -46,7 +46,6 @@ private:
int m_Direction;
UINT m_TargetMessage;
WPARAM m_TargetWParam;
- MCONTACT m_hContact;
int rowSel;
bool m_Choosing;
@@ -175,41 +174,18 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
return Result;
}
-struct smlsrvstruct
-{
- smlsrvstruct(SmileyType *tsml, MCONTACT thContact)
- : sml(tsml), hContact(thContact)
- {
- }
- SmileyType *sml;
- MCONTACT hContact;
-};
-
-void CALLBACK smileyServiceCallback(void *arg)
-{
- smlsrvstruct *p = (smlsrvstruct*)arg;
- p->sml->CallSmileyService(p->hContact);
- delete p;
-}
-
void SmileyToolWindowType::InsertSmiley(void)
{
if (m_CurrentHotTrack >= 0 && m_hWndTarget != nullptr) {
SmileyType *sml = m_pSmileyPack->GetSmiley(m_CurrentHotTrack);
- if (sml->IsService()) {
- smlsrvstruct *p = new smlsrvstruct(sml, m_hContact);
- CallFunctionAsync(smileyServiceCallback, p);
- }
- else {
- CMStringW insertText;
+ CMStringW insertText;
+ if (opt.SurroundSmileyWithSpaces) insertText = ' ';
+ insertText += sml->GetInsertText();
+ if (opt.SurroundSmileyWithSpaces) insertText += ' ';
- if (opt.SurroundSmileyWithSpaces) insertText = ' ';
- insertText += sml->GetInsertText();
- if (opt.SurroundSmileyWithSpaces) insertText += ' ';
+ SendMessage(m_hWndTarget, m_TargetMessage, m_TargetWParam, (LPARAM)insertText.c_str());
- SendMessage(m_hWndTarget, m_TargetMessage, m_TargetWParam, (LPARAM)insertText.c_str());
- }
m_Choosing = true;
DestroyWindow(m_hwndDialog);
}
@@ -469,7 +445,6 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam)
m_TargetMessage = stwp->targetMessage;
m_TargetWParam = stwp->targetWParam;
m_Direction = stwp->direction;
- m_hContact = stwp->hContact;
m_CurrentHotTrack = -2;
m_CurrMouseTrack = -1;