summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-17 14:01:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-17 14:01:50 +0300
commit99b43a519c595bd9c75c10ad204880c5b924db8c (patch)
tree968841711f3f599d8261947e4f3207bbcfbd3a4c /protocols
parentad306ac6ccc9ad3fc346d67140f6bcdb71857b7c (diff)
ICQCorp: fix for broken file transfers
Diffstat (limited to 'protocols')
-rw-r--r--protocols/ICQCorp/src/services.cpp10
-rw-r--r--protocols/ICQCorp/src/transfer.cpp19
-rw-r--r--protocols/ICQCorp/src/version.h2
3 files changed, 17 insertions, 14 deletions
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp
index 90f4354331..e50c3679e0 100644
--- a/protocols/ICQCorp/src/services.cpp
+++ b/protocols/ICQCorp/src/services.cpp
@@ -197,15 +197,15 @@ static INT_PTR icqRecvMessage(WPARAM, LPARAM lParam)
db_unset(ccs->hContact, "CList", "Hidden");
+ ptrA szMsg(Utf8CheckString(pre->szMessage) ? mir_strdup(pre->szMessage) : mir_utf8encode(pre->szMessage));
+
DBEVENTINFO dbei = {};
dbei.szModule = protoName;
dbei.timestamp = pre->timestamp;
- dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
- if (Utf8CheckString(pre->szMessage))
- dbei.flags |= DBEF_UTF;
+ dbei.flags = DBEF_UTF | (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)mir_strlen(pre->szMessage) + 1;
- dbei.pBlob = (PBYTE)pre->szMessage;
+ dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1;
+ dbei.pBlob = (PBYTE)szMsg.get();
db_event_add(ccs->hContact, &dbei);
return 0;
}
diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp
index 13a8eb6499..1bbfd9c14e 100644
--- a/protocols/ICQCorp/src/transfer.cpp
+++ b/protocols/ICQCorp/src/transfer.cpp
@@ -91,8 +91,7 @@ void ICQTransfer::processTcpPacket(Packet &packet)
case 0x01:
T("[tcp] ack initialising\n");
- packet >> speed
- >> name;
+ packet >> speed >> name;
ack(ACKRESULT_INITIALISING);
sendPacket0x02();
@@ -109,16 +108,20 @@ void ICQTransfer::processTcpPacket(Packet &packet)
++current;
if (directoryName[0])
- files[current] = CMStringW(FORMAT, L"%s\\%s", ptrW(Utf8DecodeW(directoryName)), ptrW(Utf8DecodeW(fileName))).Detach();
+ files[current] = CMStringW(FORMAT, L"%S\\%S", directoryName, fileName).Detach();
else
- files[current] = Utf8DecodeW(fileName);
+ files[current] = mir_a2u(fileName);
- if (directory) createDirectory();
- else openFile();
+ if (directory)
+ createDirectory();
+ else
+ openFile();
ack(ACKRESULT_NEXTFILE);
- if (fileProgress) ack(ACKRESULT_FILERESUME);
- else sendPacket0x03();
+ if (fileProgress)
+ ack(ACKRESULT_FILERESUME);
+ else
+ sendPacket0x03();
break;
case 0x03:
diff --git a/protocols/ICQCorp/src/version.h b/protocols/ICQCorp/src/version.h
index dea0e7a201..56f4f29843 100644
--- a/protocols/ICQCorp/src/version.h
+++ b/protocols/ICQCorp/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>