summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 1d9ec43d28..ffe181ffd9 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -75,20 +75,15 @@ int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto)
if (RTL_Detect(szMsg))
flags |= PREF_RTL;
- char *sendBuffer = mir_utf8encodeT(szMsg);
- if (!sendBuffer || !sendBuffer[0]) {
- mir_free(sendBuffer);
- return NULL;
- }
-
- if (sendBuffer == NULL)
+ T2Utf sendBuffer(szMsg);
+ if (!mir_strlen(sendBuffer))
return NULL;
if (db_mc_isMeta(hContact))
hContact = db_mc_getSrmmSub(hContact);
int sendId = CallContactService(hContact, PSS_MESSAGE, flags, (LPARAM)sendBuffer);
- msgQueue_add(hContact, sendId, sendBuffer, flags);
+ msgQueue_add(hContact, sendId, sendBuffer.detach(), flags);
return sendId;
}