summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber.h4
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp6
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp6
-rw-r--r--protocols/JabberG/src/jabber_util.cpp52
4 files changed, 5 insertions, 63 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h
index 2462fbaad6..7dfb28756e 100644
--- a/protocols/JabberG/src/jabber.h
+++ b/protocols/JabberG/src/jabber.h
@@ -745,8 +745,6 @@ TCHAR* JabberPrepareJid(LPCTSTR jid);
void __stdcall JabberUrlDecodeW(WCHAR *str);
char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf);
TCHAR* __stdcall JabberStrFixLines(const TCHAR *str);
-char* __stdcall JabberUnixToDos(const char *str);
-WCHAR* __stdcall JabberUnixToDosW(const WCHAR *str);
void __stdcall JabberHttpUrlDecode(TCHAR *str);
int __stdcall JabberCombineStatus(int status1, int status2);
TCHAR* __stdcall JabberErrorStr(int errorCode);
@@ -761,8 +759,6 @@ LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf);
TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen);
time_t str2time(const TCHAR*);
-#define JabberUnixToDosT JabberUnixToDosW
-
const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr);
void JabberCopyText(HWND hwnd, const TCHAR *text);
CJabberProto *JabberChooseInstance(bool bIsLink=false);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index d502c21daf..977da1b1e0 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -981,9 +981,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else if (!mir_tstrcmp(xmlGetName(n), _T("DESC"))) {
if (!hasDesc && xmlGetText(n) != NULL) {
hasDesc = true;
- TCHAR *szMemo = JabberUnixToDosT(xmlGetText(n));
- setTString(hContact, "About", szMemo);
- mir_free(szMemo);
+ CMString tszMemo(xmlGetText(n));
+ tszMemo.Replace(_T("\n"), _T("\r\n"));
+ setTString(hContact, "About", tszMemo);
}
}
else if (!mir_tstrcmp(xmlGetName(n), _T("PHOTO")))
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 6043baeafa..5440ad8122 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1348,10 +1348,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (szMessage == NULL)
return;
- ptrT tmp(JabberUnixToDosT(szMessage));
- if (tmp == NULL)
- tmp = mir_tstrdup(_T(""));
-
+ CMString tmp(szMessage);
+ tmp.Replace(_T("\n"), _T("\r\n"));
ptrA buf(mir_utf8encodeW(tmp));
if (item != NULL) {
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 5ca0204854..61522beadd 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -208,58 +208,6 @@ TCHAR* __stdcall JabberStrFixLines(const TCHAR *str)
return buf;
}
-char* __stdcall JabberUnixToDos(const char* str)
-{
- char* p, *q, *res;
- int extra;
-
- if (str == NULL || str[0] == '\0')
- return NULL;
-
- extra = 0;
- for (p = (char*)str; *p != '\0'; p++) {
- if (*p == '\n')
- extra++;
- }
- if ((res = (char*)mir_alloc(strlen(str) + extra + 1)) != NULL) {
- for (p = (char*)str, q = res; *p != '\0'; p++, q++) {
- if (*p == '\n') {
- *q = '\r';
- q++;
- }
- *q = *p;
- }
- *q = '\0';
- }
- return res;
-}
-
-WCHAR* __stdcall JabberUnixToDosW(const WCHAR* str)
-{
- if (str == NULL || str[0] == '\0')
- return NULL;
-
- const WCHAR* p;
- WCHAR* q, *res;
- int extra = 0;
-
- for (p = str; *p != '\0'; p++)
- if (*p == '\n')
- extra++;
-
- if ((res = (WCHAR*)mir_alloc(sizeof(WCHAR)*(wcslen(str) + extra + 1))) != NULL) {
- for (p = str, q = res; *p != '\0'; p++, q++) {
- if (*p == '\n') {
- *q = '\r';
- q++;
- }
- *q = *p;
- }
- *q = '\0';
- }
- return res;
-}
-
void __stdcall JabberHttpUrlDecode(TCHAR *str)
{
TCHAR *p, *q;