summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-21 13:03:07 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-21 13:03:07 +0000
commitf6ccc9a04a25f10090c2619f07956b87a18311ce (patch)
tree5c7f1ed137d08609b295fb4f5cf8f855465f5487
parent517640c8d103686ed84725236a8e6d8c03bbf906 (diff)
all SRMMs to send messages right trimmed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Scriver/src/msgdialog.cpp11
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
3 files changed, 7 insertions, 8 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 3ee6777259..e40d7cf57d 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1634,12 +1634,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
pf2.dwMask = PFM_RTLPARA;
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
+ ptrA szSendBuffer((char*)mir_alloc(bufSize));
+
MessageSendQueueItem msi = { 0 };
msi.flags = PREF_TCHAR;
if (pf2.wEffects & PFE_RTLPARA)
msi.flags |= PREF_RTL;
msi.sendBufferSize = bufSize;
- msi.sendBuffer = (char*)mir_alloc(msi.sendBufferSize);
+ msi.sendBuffer = szSendBuffer;
GETTEXTEX gt = { 0 };
gt.flags = GT_USECRLF;
@@ -1652,10 +1654,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (RTL_Detect((wchar_t*)&msi.sendBuffer[ansiBufSize]))
msi.flags |= PREF_RTL;
- if (msi.sendBuffer[0] == 0) {
- mir_free(msi.sendBuffer);
+ if (msi.sendBuffer[0] == 0)
break;
- }
/* Store messaging history */
char *msgText = GetRichTextEncoded(GetDlgItem(hwndDlg, IDC_MESSAGE), dat->codePage);
@@ -1665,7 +1665,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
cmdListNew = tcmdlist_last(dat->cmdList);
}
if (msgText != NULL) {
- dat->cmdList = tcmdlist_append(dat->cmdList, msgText, 20, FALSE);
+ dat->cmdList = tcmdlist_append(dat->cmdList, rtrim(msgText), 20, FALSE);
mir_free(msgText);
}
dat->cmdListCurrent = NULL;
@@ -1681,7 +1681,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(dat->hwndParent, DM_SENDMESSAGE, 0, (LPARAM)&msi);
else
SendMessage(hwndDlg, DM_SENDMESSAGE, 0, (LPARAM)&msi);
- mir_free(msi.sendBuffer);
}
return TRUE;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 8abe5a823d..e0648f09e3 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -2690,7 +2690,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char *utfResult = NULL;
if (final_sendformat)
DoRtfToTags(dat, decoded, SIZEOF(rtfDefColors), rtfDefColors);
- decoded.Trim();
+ decoded.TrimRight();
int bufSize = WideCharToMultiByte(dat->codePage, 0, decoded, -1, dat->sendBuffer, 0, 0, 0);
size_t memRequired = 0;
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index ee401f03f4..67daa77a1a 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1451,7 +1451,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (!temp[0])
break;
- int sendId = SendMessageDirect(temp, dat->hContact, dat->szProto);
+ int sendId = SendMessageDirect(rtrimt(temp), dat->hContact, dat->szProto);
if (sendId) {
dat->cmdList.insert(mir_tstrdup(temp));