diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-20 11:01:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-20 11:01:54 +0000 |
commit | 4ac4df14e007a71bf195183a92113e29f984e31c (patch) | |
tree | bb74722f6383eaaef8a7b3758ff2fa2507c32be1 | |
parent | 215623574e21eba00255143c616d637db3a70a60 (diff) |
fix for the message length
git-svn-id: http://svn.miranda-ng.org/main/trunk@1606 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/MRA/MraProto.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/protocols/MRA/MraProto.cpp b/protocols/MRA/MraProto.cpp index c17e7f0d4d..563d2d3ca1 100644 --- a/protocols/MRA/MraProto.cpp +++ b/protocols/MRA/MraProto.cpp @@ -552,16 +552,13 @@ int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage) return 0;
}
- BOOL bMemAllocated = FALSE;
CHAR szEMail[MAX_EMAIL_LEN];
DWORD dwFlags = 0;
LPWSTR lpwszMessage = NULL;
- size_t dwEMailSize, dwMessageSize = 0;
int iRet = 0;
- dwMessageSize = lstrlenA(lpszMessage);
if (flags & PREF_UNICODE)
- lpwszMessage = (LPWSTR)(lpszMessage+dwMessageSize+1);
+ lpwszMessage = (LPWSTR)(lpszMessage + lstrlenA(lpszMessage)+1 );
else if (flags & PREF_UTF)
lpwszMessage = mir_utf8decodeT(lpszMessage);
else
@@ -572,12 +569,13 @@ int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage) return 0;
}
+ size_t dwEMailSize;
if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
if ( mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact) & FEATURE_FLAG_RTF_MESSAGE))
dwFlags |= MESSAGE_FLAG_RTF;
- iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, lpwszMessage, dwMessageSize, NULL, 0);
+ iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, lpwszMessage, lstrlen(lpwszMessage), NULL, 0);
if (bSlowSend == FALSE)
ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)NULL, 0);
}
|