diff options
author | George Hazan <george.hazan@gmail.com> | 2015-09-28 19:41:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-09-28 19:41:16 +0000 |
commit | dae0ea5313c8691fcc8f761ac9647b8996c8824c (patch) | |
tree | 1e13ae35c0898ef035ef975b644107c911acabf6 | |
parent | bc2780159221f9d9ef825e41d16cfdaa23c956b2 (diff) |
crash fix in mra
git-svn-id: http://svn.miranda-ng.org/main/trunk@15466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 22 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 3 |
3 files changed, 14 insertions, 13 deletions
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 2ac6cdec77..bd109c77f5 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -172,7 +172,7 @@ MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent) char *firstName = nick + mir_strlen(nick) + 1;
char *lastName = firstName + mir_strlen(firstName) + 1;
char *email = lastName + mir_strlen(lastName) + 1;
- return AddToListByEmail(_A2T(email), _A2T(nick), _A2T(firstName), _A2T(lastName), 0);
+ return AddToListByEmail(ptrT(mir_utf8decodeT(email)), ptrT(mir_utf8decodeT(nick)), ptrT(mir_utf8decodeT(firstName)), ptrT(mir_utf8decodeT(lastName)), 0);
}
}
return 0;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 23b3abe993..bdbae4e273 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -909,24 +909,24 @@ DWORD CMraProto::ProtoBroadcastAckAsync(MCONTACT hContact, int type, int hResult CMStringA CMraProto::CreateBlobFromContact(MCONTACT hContact, const CMStringW &wszRequestReason)
{
- CMStringA res('\0', 8), tmp;
+ CMStringA res('\0', 8);
+ CMStringW tmp;
DWORD *p = (DWORD*)res.c_str();
p[0] = 0; p[1] = (DWORD)hContact;
- mraGetStringA(hContact, "Nick", tmp);
- res += tmp; res.AppendChar(0);
+ mraGetStringW(hContact, "Nick", tmp);
+ res.Append(ptrA(mir_utf8encodeW(tmp))); res.AppendChar(0);
- mraGetStringA(hContact, "FirstName", tmp);
- res += tmp; res.AppendChar(0);
+ mraGetStringW(hContact, "FirstName", tmp);
+ res.Append(ptrA(mir_utf8encodeW(tmp))); res.AppendChar(0);
- mraGetStringA(hContact, "LastName", tmp);
- res += tmp; res.AppendChar(0);
+ mraGetStringW(hContact, "LastName", tmp);
+ res.Append(ptrA(mir_utf8encodeW(tmp))); res.AppendChar(0);
- mraGetStringA(hContact, "e-mail", tmp);
- res += tmp; res.AppendChar(0);
+ mraGetStringW(hContact, "e-mail", tmp);
+ res.Append(ptrA(mir_utf8encodeW(tmp))); res.AppendChar(0);
- tmp = wszRequestReason;
- res += tmp; res.AppendChar(0);
+ res.Append(ptrA(mir_utf8encodeW(wszRequestReason))); res.AppendChar(0);
return res;
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 23f02d6ed6..82a25af521 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -555,6 +555,7 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf) CMStringA szBuff = CreateBlobFromContact(hContact, _T(""));
DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.flags = DBEF_UTF;
dbei.szModule = m_szModuleName;
dbei.timestamp = (DWORD)_time32(NULL);
dbei.eventType = EVENTTYPE_ADDED;
@@ -1743,7 +1744,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = _time32(NULL);
- dbei.flags = DBEF_READ;
+ dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.pBlob = (PBYTE)szBlob.c_str();
dbei.cbBlob = szBlob.GetLength();
|