diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2008-04-14 04:48:16 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2008-04-14 04:48:16 +0000 |
commit | 1f4071514a3f75e80c539fcedc4d9603f1cb6b46 (patch) | |
tree | 96504bbb586b3dd12fe07918135969c2cb906d75 | |
parent | 6ae86c78a2ab8ab7ee876f9caf11e5c3079284fe (diff) |
Allow service calls inside .emo
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@80 c086bb3d-8645-0410-b8da-73a8550f86e7
-rw-r--r-- | Plugins/emoticons/EmoticonsSelectionLayout.cpp | 61 | ||||
-rw-r--r-- | Plugins/emoticons/EmoticonsSelectionLayout.h | 7 | ||||
-rw-r--r-- | Plugins/emoticons/commons.h | 7 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/AIM.emo | 8 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/Default.emo | 7 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/ICQ.emo | 23 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/JGMAIL.emo | 5 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/MSN.emo | 23 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/MySpace.emo | 7 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/SAMETIME.emo | 5 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/Skype.emo | 5 | ||||
-rw-r--r-- | Plugins/emoticons/data/Plugins/Emoticons/YAHOO.emo | 5 | ||||
-rw-r--r-- | Plugins/emoticons/emoticons.cpp | 62 | ||||
-rw-r--r-- | Plugins/emoticons/selwin.cpp | 38 |
14 files changed, 238 insertions, 25 deletions
diff --git a/Plugins/emoticons/EmoticonsSelectionLayout.cpp b/Plugins/emoticons/EmoticonsSelectionLayout.cpp index a30bed0..b593bff 100644 --- a/Plugins/emoticons/EmoticonsSelectionLayout.cpp +++ b/Plugins/emoticons/EmoticonsSelectionLayout.cpp @@ -81,6 +81,26 @@ RECT EmoticonsSelectionLayout::CalcRect(TCHAR *txt) return rc;
}
+#ifdef UNICODE
+
+RECT EmoticonsSelectionLayout::CalcRect(char *txt)
+{
+ HDC hdc = GetDC(hwnd);
+ HFONT hFont = GetFont(hdc);
+ HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
+
+ RECT rc = { 0, 0, 0xFFFF, 0xFFFF };
+ DrawTextA(hdc, txt, strlen(txt), &rc, DT_CALCRECT | DT_NOPREFIX);
+
+ SelectObject(hdc, oldFont);
+ ReleaseFont(hFont);
+
+ ReleaseDC(hwnd, hdc);
+ return rc;
+}
+
+#endif
+
void EmoticonsSelectionLayout::GetEmoticonSize(Emoticon *e, int &width, int &height)
{
width = 0;
@@ -91,9 +111,18 @@ void EmoticonsSelectionLayout::GetEmoticonSize(Emoticon *e, int &width, int &hei if (e->img == NULL || e->img->img == NULL)
{
- RECT rc = CalcRect(e->texts[0]);
- height = rc.bottom - rc.top + 1;
- width = rc.right - rc.left + 1;
+ if (e->texts.getCount() > 0)
+ {
+ RECT rc = CalcRect(e->texts[0]);
+ height = rc.bottom - rc.top + 1;
+ width = rc.right - rc.left + 1;
+ }
+ else
+ {
+ RECT rc = CalcRect(e->description);
+ height = rc.bottom - rc.top + 1;
+ width = rc.right - rc.left + 1;
+ }
}
}
@@ -102,7 +131,7 @@ int EmoticonsSelectionLayout::GetNumOfCols(int num_emotes) int cols = num_emotes / MAX_LINES;
if (num_emotes % MAX_LINES != 0)
cols++;
- return min(max(cols, MIN_COLS), MAX_COLS);
+ return min(cols, MAX_COLS);
}
int EmoticonsSelectionLayout::GetNumOfLines(int num_emotes, int cols)
@@ -220,6 +249,21 @@ void EmoticonsSelectionLayout::DrawEmoticonText(HDC hdc, TCHAR *txt, RECT rc) ReleaseFont(hFont);
}
+#ifdef UNICODE
+
+void EmoticonsSelectionLayout::DrawEmoticonText(HDC hdc, char *txt, RECT rc)
+{
+ HFONT hFont = GetFont(hdc);
+ HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
+
+ DrawTextA(hdc, txt, strlen(txt), &rc, DT_NOPREFIX);
+
+ SelectObject(hdc, oldFont);
+ ReleaseFont(hFont);
+}
+
+#endif
+
void EmoticonsSelectionLayout::DrawEmoticon(HDC hdc, int index, RECT fullRc)
{
Emoticon *e = ssd->module->emoticons[index];
@@ -235,7 +279,14 @@ void EmoticonsSelectionLayout::DrawEmoticon(HDC hdc, int index, RECT fullRc) if (e->img == NULL || e->img->img == NULL)
{
- DrawEmoticonText(hdc, e->texts[0], rc);
+ if (e->texts.getCount() > 0)
+ {
+ DrawEmoticonText(hdc, e->texts[0], rc);
+ }
+ else
+ {
+ DrawEmoticonText(hdc, e->description, rc);
+ }
}
else
{
diff --git a/Plugins/emoticons/EmoticonsSelectionLayout.h b/Plugins/emoticons/EmoticonsSelectionLayout.h index e0b2bb7..f476ba4 100644 --- a/Plugins/emoticons/EmoticonsSelectionLayout.h +++ b/Plugins/emoticons/EmoticonsSelectionLayout.h @@ -6,6 +6,7 @@ struct EmoticonSelectionData
{
+ HANDLE hContact;
Module *module;
COLORREF background;
@@ -52,6 +53,9 @@ protected: HFONT GetFont(HDC hdc);
void ReleaseFont(HFONT hFont);
RECT CalcRect(TCHAR *txt);
+#ifdef UNICODE
+ RECT CalcRect(char *txt);
+#endif
void GetEmoticonSize(Emoticon *e, int &width, int &height);
@@ -64,5 +68,8 @@ protected: void DrawEmoticon(HDC hdc, int index, RECT rc);
void DrawEmoticonText(HDC hdc, TCHAR *txt, RECT rc);
+#ifdef UNICODE
+ void DrawEmoticonText(HDC hdc, char *txt, RECT rc);
+#endif
};
diff --git a/Plugins/emoticons/commons.h b/Plugins/emoticons/commons.h index 857840a..1653ed2 100644 --- a/Plugins/emoticons/commons.h +++ b/Plugins/emoticons/commons.h @@ -131,11 +131,16 @@ struct Emoticon char *group;
LIST<TCHAR> texts;
EmoticonImage *img;
+ char *service[3];
// For selection window
HWND tt;
- Emoticon() : name(0), description(0), group(""), texts(20), img(0), tt(0) {}
+ Emoticon() : name(0), description(0), group(""), texts(20), img(0), tt(0) {
+ service[0] = NULL;
+ service[1] = NULL;
+ service[2] = NULL;
+ }
~Emoticon();
};
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/AIM.emo b/Plugins/emoticons/data/Plugins/Emoticons/AIM.emo index c2e7940..b871eac 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/AIM.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/AIM.emo @@ -1,6 +1,8 @@ # AIM protocol emoticons
# http://www.aim.com/emoticons.adp
+[AIM]
+
"smile" = "Smiling", ":-) :)"
"wink" = "Winking", ";-) ;)"
"sad" = "Frowning", ":-( :("
@@ -17,3 +19,9 @@ "crying" = "Crying", ":'("
"shut-mouth" = "Lips-are-sealed", ":-X"
"glass-cool" = "Cool", "8-)"
+
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/Default.emo b/Plugins/emoticons/data/Plugins/Emoticons/Default.emo index 9eeaaec..bde2c21 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/Default.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/Default.emo @@ -13,4 +13,9 @@ "thinking" = "Thinking", ":-/" ":/" ":-\\" ":\\"
"devilish" = "Devil", "}:-)" "}:)"
"angel" = "Angel", "O:-)" "O:)" "0:-)" "0:)"
-"silly" = "Silly", "%)"
\ No newline at end of file +"silly" = "Silly", "%)"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/ICQ.emo b/Plugins/emoticons/data/Plugins/Emoticons/ICQ.emo index 687a362..6c4db69 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/ICQ.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/ICQ.emo @@ -1,5 +1,7 @@ # ICQ protocol emoticons
+[ICQ]
+
"smile" = "Smile", ":-)" ":)"
"neutral" = "Nothing to say", ":-$" ":-|"
"sad" = "Sad", ":-(" ":("
@@ -28,3 +30,24 @@ "beer" = "Drinking", "*DRINK*" "*drink*"
"rotfl" = "Laughing out loud (LOL)", ":-D" ":D" ":-d" ":d"
"in-love" = "In love", "*IN LOVE*" "*in love*"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
+
+
+[tZer]
+
+"service_tzer_Gangsta" = "Gangsta'", "<Service:/SendtZer:0:0>"
+"service_tzer_CantHearU" = "Can't Hear U", "<Service:/SendtZer:1:0>"
+"service_tzer_Scratch" = "Scratch", "<Service:/SendtZer:2:0>"
+"service_tzer_Booooo" = "Booooo", "<Service:/SendtZer:3:0>"
+"service_tzer_Kisses" = "Kisses", "<Service:/SendtZer:4:0>"
+"service_tzer_ChillOut" = "Chill Out!", "<Service:/SendtZer:5:0>"
+"service_tzer_Akitaka" = "Akitaka", "<Service:/SendtZer:6:0>"
+"service_tzer_Hilaaarious" = "Hilaaarious", "<Service:/SendtZer:8:0>"
+"service_tzer_LikeDuh" = "Like Duh!", "<Service:/SendtZer:9:0>"
+"service_tzer_L8R" = "L8R", "<Service:/SendtZer:10:0>"
+"service_tzer_LikeU" = "Like U!", "<Service:/SendtZer:11:0>"
+"service_tzer_ImSorry" = "I'm Sorry", "<Service:/SendtZer:7:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/JGMAIL.emo b/Plugins/emoticons/data/Plugins/Emoticons/JGMAIL.emo index 8da0fb3..3f5099d 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/JGMAIL.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/JGMAIL.emo @@ -27,3 +27,8 @@ "love-over" = "Broken Heart", "</3"
"kiss" = "Kiss", ":*" ":-x"
"mustache" = "Mustache", ":{"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/MSN.emo b/Plugins/emoticons/data/Plugins/Emoticons/MSN.emo index 6773c7e..856f7c2 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/MSN.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/MSN.emo @@ -1,8 +1,10 @@ # MSN protocol emoticons
+[MSN]
+
"smile" = "Smile", ":)" ":-)"
"laugh" = "Open-mouthed smile", ":D" ":-D" ":d" ":-d"
-"wink" = "", ";)" ";-)"
+"wink" = "Winking smile", ";)" ";-)"
"shock" = "Surprised smile", ":-O" ":o" ":O" ":-o"
"tongue" = "Smile with tongue out", ":P" ":-P" ":p" ":-p"
"glass-cool" = "Hot smile", "(H)" "(h)"
@@ -10,15 +12,14 @@ "confused" = "Confused smile", ":S" ":-S" ":s" ":-s"
"embarrassed" = "Embarrassed smile", ":$" ":-$"
"sad" = "Sad smile", ":(" ":-("
-"crying" = "", ":'("
+"crying" = "Crying face", ":'("
"neutral" = "Disappointed smile", ":|" ":-|"
-"devilish" = "Devil", "(6)"
"angel" = "Angel", "(A)" "(a)"
"teeth" = "Baring teeth smile", "8o|"
"glass-nerdy" = "Nerd smile", "8-|"
"sick" = "Sick smile", "+o("
-"party" = "", "<:o)"
-"sleepy" = "", "|-)"
+"party" = "Party smile", "<:o)"
+"sleepy" = "Sleepy smile", "|-)"
"thinking" = "Settings", "*-)"
"quiet" = "Don't tell anyone smile", ":-#"
"secret" = "Secret telling smile", ":-*"
@@ -41,6 +42,11 @@ "rose" = "Red rose", "(F)" "(f)"
"rose-dead" = "Wilted rose", "(W)" "(w)"
"clock" = "Clock", "(O)" "(o)"
+
+
+[Hidden]
+
+"devilish" = "Devil", "(6)"
"film" = "Filmstrip", "(~)"
"music" = "Note", "(8)"
"mail" = "E-mail", "(E)" "(e)"
@@ -80,4 +86,9 @@ "handcuffs" = "Handcuffs", "(%)"
"fingers-crossed" = "Cross Fingers", "(yn)"
"immakingadifference" = "i'm™ initiative", "*red+u" "*bgca" "*naf" "*hsus" "*9mil" "*mssoc" "*sierra" "*unicef" "*help" "*komen"
-"bunny" = "Bunny", "('.')"
\ No newline at end of file +"bunny" = "Bunny", "('.')"
+
+
+[Nudge]
+
+"service_nudge" = "Send a nudge to everyone in this conversation", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/MySpace.emo b/Plugins/emoticons/data/Plugins/Emoticons/MySpace.emo index d6145d4..0bc93ee 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/MySpace.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/MySpace.emo @@ -1,5 +1,7 @@ # My Space protocol emoticons
+[My Space]
+
"smile-big" = "bigsmile", ":D" ":-D"
"devilish" = "devil", "}:)" "}:-)"
"confused" = "frassled", ":Z"
@@ -24,3 +26,8 @@ "wink" = "wink", ";-)" ";)"
"sad" = "worried", ":["
"kiss" = "kiss", ":x" ":X"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/SAMETIME.emo b/Plugins/emoticons/data/Plugins/Emoticons/SAMETIME.emo index b354d20..99aca01 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/SAMETIME.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/SAMETIME.emo @@ -16,3 +16,8 @@ "crying" = "crying", ":'("
"confused" = "goofy", ":-S" ":-s"
"embarrassed" = "shy", ":-$"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/Skype.emo b/Plugins/emoticons/data/Plugins/Emoticons/Skype.emo index 562620a..e366f62 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/Skype.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/Skype.emo @@ -331,3 +331,8 @@ "flag_YE" = "Yemen", "(flag:YE)"
"flag_ZM" = "Zambia", "(flag:ZM)"
"flag_ZW" = "Zimbabwe", "(flag:ZW)"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/data/Plugins/Emoticons/YAHOO.emo b/Plugins/emoticons/data/Plugins/Emoticons/YAHOO.emo index 1a8a041..db4e62f 100644 --- a/Plugins/emoticons/data/Plugins/Emoticons/YAHOO.emo +++ b/Plugins/emoticons/data/Plugins/Emoticons/YAHOO.emo @@ -92,3 +92,8 @@ "male" = "Hiro / Billy", "o->" "o=>"
"female" = "April", "o-+"
"yin-yang" = "Yin yang", "(%)"
+
+
+[Nudge]
+
+"service_nudge" = "Nudge", "<Service:/SendNudge:hContact:0>"
diff --git a/Plugins/emoticons/emoticons.cpp b/Plugins/emoticons/emoticons.cpp index 16b3d6e..3918ae3 100644 --- a/Plugins/emoticons/emoticons.cpp +++ b/Plugins/emoticons/emoticons.cpp @@ -1097,7 +1097,7 @@ void UnloadRichEdit(RichEditCtrl *rec) HANDLE GetRealContact(HANDLE hContact)
{
- if (!ServiceExists(MS_MC_GETMOSTONLINECONTACT))
+ if (hContact == NULL || !ServiceExists(MS_MC_GETMOSTONLINECONTACT))
return hContact;
HANDLE hReal = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
@@ -1279,6 +1279,17 @@ void LoadModules() }
}
+
+// See if a protocol service exists
+__inline int ProtoServiceExists(const char *szModule,const char *szService)
+{
+ char str[MAXMODULELABELLENGTH];
+ strcpy(str,szModule);
+ strcat(str,szService);
+ return ServiceExists(str);
+}
+
+
void HandleEmoLine(Module *m, char *tmp, char *group)
{
int len = strlen(tmp);
@@ -1315,7 +1326,8 @@ void HandleEmoLine(Module *m, char *tmp, char *group) continue;
tmp[i] = 0;
- TCHAR * txt = mir_a2t(&tmp[pos]);
+ TCHAR *txt = mir_a2t(&tmp[pos]);
+ char *atxt = &tmp[pos];
for(int j = 0, orig = 0; j <= i - pos; j++)
{
@@ -1338,7 +1350,46 @@ void HandleEmoLine(Module *m, char *tmp, char *group) e->description = txt;
break;
case 5:
- e->texts.insert(txt);
+ if (strncmp(e->name, "service_", 8) == 0)
+ {
+ MIR_FREE(txt); // Not needed
+
+ int len = strlen(atxt);
+
+ // Is a service
+ if (!strncmp(atxt, "<Service:", 9) == 0 || atxt[len-1] != '>')
+ {
+ delete e;
+ e = NULL;
+ return;
+ }
+
+ atxt[len-1] = '\0';
+
+ char *params = &atxt[9];
+ for(int i = 0; i < 3; i++)
+ {
+ char *pos = strchr(params, ':');
+ if (pos != NULL)
+ *pos = '\0';
+
+ e->service[i] = mir_strdup(params);
+
+ if (pos == NULL)
+ break;
+
+ params = pos + 1;
+ }
+
+ if (e->service[0] == NULL || e->service[0][0] == '\0' || !ProtoServiceExists(m->name, e->service[0]))
+ {
+ delete e;
+ e = NULL;
+ return;
+ }
+ }
+ else
+ e->texts.insert(txt);
break;
}
@@ -1449,6 +1500,7 @@ BOOL isValidExtension(char *name) && strcmp(p, ".jpeg") != 0
&& strcmp(p, ".gif") != 0
&& strcmp(p, ".png") != 0
+ && strcmp(p, ".ico") != 0
&& strcmp(p, ".swf") != 0)
return FALSE;
return TRUE;
@@ -1465,6 +1517,7 @@ BOOL isValidExtension(WCHAR *name) && lstrcmpW(p, L".jpeg") != 0
&& lstrcmpW(p, L".gif") != 0
&& lstrcmpW(p, L".png") != 0
+ && lstrcmpW(p, L".ico") != 0
&& lstrcmpW(p, L".swf") != 0)
return FALSE;
return TRUE;
@@ -2006,6 +2059,9 @@ Emoticon::~Emoticon() MIR_FREE(name);
MIR_FREE(description);
+ for(int j = 0; j < MAX_REGS(service); j++)
+ MIR_FREE(service[j])
+
for(int i = 0; i < texts.getCount(); i++)
{
mir_free(texts[i]);
diff --git a/Plugins/emoticons/selwin.cpp b/Plugins/emoticons/selwin.cpp index 4395b76..adceeb6 100644 --- a/Plugins/emoticons/selwin.cpp +++ b/Plugins/emoticons/selwin.cpp @@ -73,6 +73,19 @@ void AssertInsideScreen(RECT &rc) }
+DWORD ConvertServiceParam(EmoticonsSelectionLayout *layout, char *param)
+{
+ DWORD ret;
+ if (param == NULL)
+ ret = 0;
+ else if (stricmp("hContact", param) == 0)
+ ret = (DWORD) layout->ssd->hContact;
+ else
+ ret = atoi(param);
+ return ret;
+}
+
+
INT_PTR CALLBACK EmoticonSeletionDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
@@ -274,14 +287,22 @@ INT_PTR CALLBACK EmoticonSeletionDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA EmoticonsSelectionLayout *layout = (EmoticonsSelectionLayout *) GetWindowLong(hwnd, GWL_USERDATA);
if (layout->selection >= 0 && layout->ssd->hwndTarget != NULL)
{
- if (opts.only_replace_isolated)
+ Emoticon *e = layout->ssd->module->emoticons[layout->selection];
+
+ if (e->service[0] != NULL)
{
- TCHAR tmp[16];
- mir_sntprintf(tmp, MAX_REGS(tmp), _T(" %s "), layout->ssd->module->emoticons[layout->selection]->texts[0]);
+ CallProtoService(layout->ssd->module->name, e->service[0],
+ ConvertServiceParam(layout, e->service[1]),
+ ConvertServiceParam(layout, e->service[2]));
+ }
+ else if (opts.only_replace_isolated)
+ {
+ TCHAR tmp[64];
+ mir_sntprintf(tmp, MAX_REGS(tmp), _T(" %s "), e->texts[0]);
SendMessage(layout->ssd->hwndTarget, layout->ssd->targetMessage, layout->ssd->targetWParam, (LPARAM) tmp);
}
else
- SendMessage(layout->ssd->hwndTarget, layout->ssd->targetMessage, layout->ssd->targetWParam, (LPARAM) layout->ssd->module->emoticons[layout->selection]->texts[0]);
+ SendMessage(layout->ssd->hwndTarget, layout->ssd->targetMessage, layout->ssd->targetWParam, (LPARAM) e->texts[0]);
}
PostMessage(hwnd, WM_CLOSE, 0, 0);
@@ -314,11 +335,9 @@ int ShowSelectionService(WPARAM wParam, LPARAM lParam) return FALSE;
const char *proto = NULL;
- if (sss->hContact != NULL)
- {
- HANDLE hReal = GetRealContact(sss->hContact);
- proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hReal, 0);
- }
+ HANDLE hContact = GetRealContact(sss->hContact);
+ if (hContact != NULL)
+ proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (proto == NULL)
proto = sss->Protocolname;
if (proto == NULL)
@@ -332,6 +351,7 @@ int ShowSelectionService(WPARAM wParam, LPARAM lParam) EmoticonSelectionData * ssd = new EmoticonSelectionData();
ssd->module = m;
+ ssd->hContact = hContact;
ssd->xPosition = sss->xPosition;
ssd->yPosition = sss->yPosition;
|