diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
commit | 48266e479d1fcf5153b29c612866845990fccad8 (patch) | |
tree | c8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /protocols/Tlen/src/tlen_svc.cpp | |
parent | ebdb556f152734035846f120eb8112f88ef91281 (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/Tlen/src/tlen_svc.cpp')
-rw-r--r-- | protocols/Tlen/src/tlen_svc.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 96e20cdc21..9481729dd8 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -601,7 +601,7 @@ INT_PTR TlenProtocol::SendAlert(WPARAM hContact, LPARAM lParam) return 0;
}
-int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW)
+int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW)
{
DBVARIANT dbv;
if (!isOnline || db_get(hContact, m_szModuleName, "jid", &dbv)) {
@@ -609,30 +609,21 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) return 2;
}
- char* msg;
- if (flags & PREF_UNICODE)
- msg = mir_u2a((wchar_t*)&msgRAW[strlen(msgRAW) + 1]);
- else if (flags & PREF_UTF)
- msg = mir_utf8decodeA(msgRAW);
- else
- msg = mir_strdup(msgRAW);
-
TLEN_LIST_ITEM *item;
char msgType[16];
-
int id = TlenSerialNext(this);
- if (!strcmp(msg, "<alert>")) {
+ if (!strcmp(msgRAW, "<alert>")) {
TlenSend(this, "<m tp='a' to='%s'/>", dbv.pszVal);
forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id));
}
- else if (!strcmp(msg, "<image>")) {
+ else if (!strcmp(msgRAW, "<image>")) {
TlenSend(this, "<message to='%s' type='%s' crc='%x' idt='%d'/>", dbv.pszVal, "pic", 0x757f044, id);
forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id));
}
else {
- char *msgEnc=TlenTextEncode(msg);
+ char *msgEnc = TlenTextEncode(msgRAW);
if (msgEnc != NULL) {
if (TlenListExist(this, LIST_CHATROOM, dbv.pszVal) && strchr(dbv.pszVal, '/') == NULL)
strcpy(msgType, "groupchat");
@@ -660,7 +651,6 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) mir_free(msgEnc);
}
- mir_free(msg);
db_free(&dbv);
return id;
}
|