summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/MSN/src/msn_misc.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 7fa82d51e8..82808220e3 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -483,6 +483,9 @@ int ThreadData::sendMessage(int, const char *email, int netId, const char *parMs
if (!proto->getString("Nick", &dbv))
pszNick = dbv.pszVal;
+ CMStringA msgClean;
+
+ for (BYTE *p = (BYTE*)parMsg; *p; p++) if (*p >= 0x20 || (*p>=0x09 && *p<=0x0D)) msgClean.AppendChar(*p);
buf.AppendFormat(
"Messaging: 2.0\r\n"
"Client-Message-ID: %llu\r\n"
@@ -490,11 +493,11 @@ int ThreadData::sendMessage(int, const char *email, int netId, const char *parMs
"IM-Display-Name: %s\r\n"
"Content-Type: %s\r\n"
"Content-Length: %d\r\n",
- msgid, pszMsgType, pszNick, pszContType, mir_strlen(parMsg));
+ msgid, pszMsgType, pszNick, pszContType, msgClean.GetLength());
if (*tFontName) buf.AppendFormat("X-MMS-IM-Format: FN=%s; EF=%s; CO=%x; CS=0; PF=31%s\r\n",
tFontName, tFontStyle, tFontColor, (parFlags & MSG_RTL) ? ";RL=1" : "");
- buf.AppendFormat("\r\n%s", parMsg);
+ buf.AppendFormat("\r\n%s", msgClean);
if (pszNick!=proto->MyOptions.szEmail) db_free(&dbv);
parMsg = buf;