diff options
-rw-r--r-- | Plugins/emoticons/Docs/langpack_emoticons.txt | 1 | ||||
-rw-r--r-- | Plugins/emoticons/emoticons.cpp | 18 | ||||
-rw-r--r-- | Plugins/emoticons/sdk/m_anismiley.h | 39 |
3 files changed, 24 insertions, 34 deletions
diff --git a/Plugins/emoticons/Docs/langpack_emoticons.txt b/Plugins/emoticons/Docs/langpack_emoticons.txt index 22cbeac..e3f605e 100644 --- a/Plugins/emoticons/Docs/langpack_emoticons.txt +++ b/Plugins/emoticons/Docs/langpack_emoticons.txt @@ -12,6 +12,7 @@ [Use default emoticon pack for unknown protocols]
[Only replace emoticons surrounded by spaces]
[Enable custom smileys]
+[Embed videos]
[Download more emoticon packs]
[Protocols Configuration]
diff --git a/Plugins/emoticons/emoticons.cpp b/Plugins/emoticons/emoticons.cpp index faec624..2eb9378 100644 --- a/Plugins/emoticons/emoticons.cpp +++ b/Plugins/emoticons/emoticons.cpp @@ -30,7 +30,7 @@ PLUGININFOEX pluginInfo={ #else
"Emoticons",
#endif
- PLUGIN_MAKE_VERSION(0,3,0,0),
+ PLUGIN_MAKE_VERSION(0,3,0,1),
"Emoticons",
"Ricardo Pescuma Domenecci",
"",
@@ -289,7 +289,7 @@ protected: url = &url[pos];
removeOtherArguments(url, out, outLen);
- return true;
+ return out[0] != _T('\0');
}
void removeOtherArguments(const TCHAR *url, TCHAR *out, size_t outLen)
@@ -562,7 +562,7 @@ BOOL isVideo(const TCHAR *url, size_t urlLen, FlashData *flash) for (int j = 0; j < MAX_REGS(videos); j++)
{
- if (videos[j]->convertToFlash(tmp, flash))
+ if (videos[j]->convertToFlash(tmp, flash))
return TRUE;
}
@@ -1031,7 +1031,7 @@ int AddVideo(RichEditCtrl &rec, int pos, const FlashData *flash) cf.dwMask = CFM_ALL2;
SendMessage(rec.hwnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
- sel.cpMin = sel.cpMax = pos + 1;
+ sel.cpMin = sel.cpMax = pos;
SendMessage(rec.hwnd, EM_EXSETSEL, 0, (LPARAM) &sel);
if (cf.dwEffects & CFE_AUTOBACKCOLOR)
@@ -1054,13 +1054,6 @@ int AddVideo(RichEditCtrl &rec, int pos, const FlashData *flash) SendMessage(rec.hwnd, EM_REPLACESEL, FALSE, (LPARAM) _T("\n"));
ret++;
- /* StreamData data("aaaa");
- EDITSTREAM stream = {0};
- stream.pfnCallback = StreamInEvents;
- stream.dwCookie = (DWORD_PTR) &data;
- SendMessage(rec.hwnd, EM_STREAMIN, SFF_SELECTION | SF_RTF, (LPARAM) &stream);
- */
-
sel.cpMin = pos;
sel.cpMax = pos + 3;
SendMessage(rec.hwnd, EM_EXSETSEL, 0, (LPARAM) &sel);
@@ -1188,7 +1181,7 @@ void ReplaceAllEmoticons(RichEditCtrl &rec, Contact *contact, Module *module, TC {
int urlLen = findURLEnd(&text[i], len - i);
- if (!inInputArea)
+ if (allowVideo)
{
FlashData flash;
if (isVideo(&text[i], urlLen, &flash))
@@ -1209,6 +1202,7 @@ void ReplaceAllEmoticons(RichEditCtrl &rec, Contact *contact, Module *module, TC int this_dif = AddVideo(rec, pos, &flash);
+ diff += this_dif;
i += this_dif - 1;
continue;
}
diff --git a/Plugins/emoticons/sdk/m_anismiley.h b/Plugins/emoticons/sdk/m_anismiley.h index 9020e35..19cdb62 100644 --- a/Plugins/emoticons/sdk/m_anismiley.h +++ b/Plugins/emoticons/sdk/m_anismiley.h @@ -40,30 +40,25 @@ typedef struct _tagINSERTANISMILEY #if defined ServiceExists && defined CallService && !defined InsertAnimatedSmiley
-#ifdef _cplusplus
-extern "C" {
-#endif
static BOOL InsertAnimatedSmiley(HWND _hwnd, const TCHAR * _szFilename, COLORREF _dwBack, int _nWidth, int _nHeight, const TCHAR * _szText, const TCHAR * _szFlashVars)
- {
- static int bServiceExists=-1;
- INSERTANISMILEY ias={0};
- if (bServiceExists==-1)
- bServiceExists=ServiceExists(MS_INSERTANISMILEY);
- if (!bServiceExists) return FALSE;
- ias.cbSize=sizeof(INSERTANISMILEY);
- ias.hWnd=_hwnd;
- ias.tcsFilename=_szFilename;
- ias.dwFlags=IASF_TCHAR;
- ias.nWidth=_nWidth;
- ias.nHeight=_nHeight;
- ias.dwBackColor=_dwBack;
- ias.tcsText=_szText;
- ias.tcsFlashVars=_szFlashVars;
- return (BOOL) CallService(MS_INSERTANISMILEY,(WPARAM)&ias, 0);
- };
-#ifdef _cplusplus
+{
+ static int bServiceExists=-1;
+ INSERTANISMILEY ias={0};
+ if (bServiceExists==-1)
+ bServiceExists=ServiceExists(MS_INSERTANISMILEY);
+ if (!bServiceExists) return FALSE;
+ ias.cbSize=sizeof(INSERTANISMILEY);
+ ias.hWnd=_hwnd;
+ ias.tcsFilename=_szFilename;
+ ias.dwFlags=IASF_TCHAR;
+ ias.nWidth=_nWidth;
+ ias.nHeight=_nHeight;
+ ias.dwBackColor=_dwBack;
+ ias.tcsText=_szText;
+ ias.tcsFlashVars=_szFlashVars;
+ return (BOOL) CallService(MS_INSERTANISMILEY,(WPARAM)&ias, 0);
};
-#endif
+
#endif // defined ServiceExists && defined CallService
|