summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/TabSRMM/src/msgs.cpp3
-rw-r--r--src/core/stdmsg/src/msgs.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index b8fb252fbc..924a355aa3 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -285,6 +285,9 @@ INT_PTR SendMessageCommand_W(WPARAM hContact, LPARAM lParam)
return 0;
}
+ if (db_mc_isSub(hContact))
+ hContact = db_mc_getMeta(hContact);
+
// does the MCONTACT's protocol support IM messages?
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 0aa012ecf5..24e0b2da8b 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -108,6 +108,9 @@ INT_PTR SendMessageCmd(MCONTACT hContact, char* msg, int isWchar)
if (!szProto || (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 1;
+ if (db_mc_isSub(hContact))
+ hContact = db_mc_getMeta(hContact);
+
HWND hwnd;
if (hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact)) {
if (msg) {
@@ -115,7 +118,7 @@ INT_PTR SendMessageCmd(MCONTACT hContact, char* msg, int isWchar)
hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
SendMessage(hEdit, EM_SETSEL, -1, SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0));
if (isWchar)
- SendMessage(hEdit, EM_REPLACESEL, FALSE, (LPARAM)msg);
+ SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)msg);
else
SendMessageA(hEdit, EM_REPLACESEL, FALSE, (LPARAM)msg);
}