summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorleecher1337 <leecher@dose.0wnz.at>2016-08-01 23:43:49 +0000
committerleecher1337 <leecher@dose.0wnz.at>2016-08-01 23:43:49 +0000
commitf972259d059e76876530e95a7d7b4919aa7e7128 (patch)
tree3a95c87bbb412d6154bddcebddc7e9d06bf66eec /protocols
parentd3ba0b768a78875a90542a930fc33b0c757bf328 (diff)
MSN: Filter some control charaxters in text that MSN protocol doesn't seem to like.
git-svn-id: http://svn.miranda-ng.org/main/trunk@17153 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-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;