summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_messages.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
commit48266e479d1fcf5153b29c612866845990fccad8 (patch)
treec8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /protocols/VKontakte/src/vk_messages.cpp
parentebdb556f152734035846f120eb8112f88ef91281 (diff)
war against atavisms continues
- everything that goes to PSS_MESSAGE should be sent as utf8 string; - thus PREF_UNICODE & PREF_UTF support discontinued, these constants are removed; - support for PREF_UNICODE & PREF_UTF in protocols also removed; - PREF_UNICODE used in file transfers (PROTOFILERECVT) replaced with PRFF_UNICODE / PRFF_TCHAR git-svn-id: http://svn.miranda-ng.org/main/trunk@13734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_messages.cpp')
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 57f25817af..6a9d6825ed 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -37,7 +37,7 @@ void CVkProto::SendMsgAck(void *param)
delete ack;
}
-int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
+int CVkProto::SendMsg(MCONTACT hContact, int, const char *szMsg)
{
debugLogA("CVkProto::SendMsg");
if (!IsOnline())
@@ -48,14 +48,6 @@ int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
return 0;
}
- ptrA szMsg;
- if (flags & PREF_UTF)
- szMsg = mir_strdup(msg);
- else if (flags & PREF_UNICODE)
- szMsg = mir_utf8encodeW((wchar_t*)&msg[mir_strlen(msg) + 1]);
- else
- szMsg = mir_utf8encode(msg);
-
int StickerId = 0;
ptrA retMsg(GetStickerId(szMsg, StickerId));
@@ -77,9 +69,8 @@ int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
ForkThread(&CVkProto::SendMsgAck, new TFakeAckParams(hContact, msgId));
if (retMsg) {
- int _flags = flags | PREF_UTF;
Sleep(330);
- SendMsg(hContact, _flags, retMsg);
+ SendMsg(hContact, 0, retMsg);
}
return msgId;
}
@@ -255,7 +246,6 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
PROTORECVEVENT recv = { 0 };
- recv.flags = PREF_TCHAR;
if (isRead && !m_bMesAsUnread)
recv.flags |= PREF_CREATEREAD;
if (isOut)
@@ -264,7 +254,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
SetInvisible(hContact);
recv.timestamp = m_bUseLocalTime ? time(NULL) : datetime;
- recv.tszMessage = ptszBody;
+ recv.szMessage = mir_utf8encodeT(ptszBody);
recv.lParam = isOut;
recv.pCustomData = szMid;
recv.cbCustomDataSize = (int)mir_strlen(szMid);
@@ -280,6 +270,8 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (!isOut)
m_incIds.insert((HANDLE)mid);
}
+
+ mir_free((char*)recv.szMessage);
}
if (!mids.IsEmpty())