summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/directpackets.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-10 20:34:46 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-10 20:34:53 +0300
commit916d3c8fc91d4290aaf5625db636b6cf102306a6 (patch)
tree2a29cc423ec49112abf48066369629ce92fc068d /protocols/IcqOscarJ/src/directpackets.cpp
parent8b981c349ce9489de8c3866bac909f091bb41f8c (diff)
ICQ:
- warning fixes; - minor code cleaning
Diffstat (limited to 'protocols/IcqOscarJ/src/directpackets.cpp')
-rw-r--r--protocols/IcqOscarJ/src/directpackets.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp
index 14f8db4afc..a7f32e7248 100644
--- a/protocols/IcqOscarJ/src/directpackets.cpp
+++ b/protocols/IcqOscarJ/src/directpackets.cpp
@@ -194,7 +194,7 @@ int CIcqProto::icq_sendFileSendDirectv8(filetransfer *ft, const char *pszFiles)
if (!utf8_decode(pszFiles, &szFilesAnsi))
szFilesAnsi = _strdup(pszFiles); // Legacy fix
- size_t wFilesLen = mir_strlen(szFilesAnsi)+1;
+ size_t wFilesLen = mir_strlen(szFilesAnsi) + 1;
icq_packet packet;
packDirectMsgHeader(&packet, 0x2E + 22 + wDescrLen + wFilesLen, DIRECT_MESSAGE, (WORD)ft->dwCookie, MTYPE_PLUGIN, 0, 0, 0);
@@ -227,18 +227,17 @@ DWORD CIcqProto::icq_SendDirectMessage(MCONTACT hContact, const char *szMessage,
icq_packet packet;
packDirectMsgHeader(&packet, nBodyLength + (szCap ? 53 : 11), DIRECT_MESSAGE, dwCookie, (BYTE)pCookieData->bMessageType, 0, 0, 0);
- packLEWord(&packet, WORD(nBodyLength+1)); // Length of message
- packBuffer(&packet, (LPBYTE)szMessage, nBodyLength+1); // Message
+ packLEWord(&packet, WORD(nBodyLength + 1)); // Length of message
+ packBuffer(&packet, (LPBYTE)szMessage, nBodyLength + 1); // Message
packMsgColorInfo(&packet);
- if (szCap)
- {
+ if (szCap) {
packLEDWord(&packet, 0x00000026); // length of GUID
packBuffer(&packet, (LPBYTE)szCap, 0x26); // UTF-8 GUID
}
if (SendDirectMessage(hContact, &packet))
return dwCookie; // Success
-
+
FreeCookie(dwCookie); // release cookie
return 0; // Failure
}