From 48266e479d1fcf5153b29c612866845990fccad8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 May 2015 16:11:58 +0000 Subject: 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 --- protocols/IcqOscarJ/src/fam_04message.cpp | 34 +++--------- protocols/IcqOscarJ/src/fam_13servclist.cpp | 18 ++---- protocols/IcqOscarJ/src/icq_filerequests.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 76 ++++++-------------------- protocols/IcqOscarJ/src/icq_proto.h | 4 +- protocols/IcqOscarJ/src/icq_xtraz.cpp | 2 +- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 4 +- protocols/IcqOscarJ/src/oscar_filetransfer.cpp | 10 +--- 8 files changed, 38 insertions(+), 112 deletions(-) (limited to 'protocols/IcqOscarJ') diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index 84339c2846..f3f4808b6b 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -302,9 +302,8 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, size_t wLen, DWORD dwUin, char SAFE_FREE(&szMsg); szMsg = szUtfMsg; } - pre.flags = PREF_UTF; } - if (!bMsgPartUnicode && pre.flags == PREF_UTF) { // convert message part to utf-8 and append + if (!bMsgPartUnicode) { // convert message part to utf-8 and append char *szUtfPart = ansi_to_utf8_codepage((char*)szMsgPart, getWord(hContact, "CodePage", m_wAnsiCodepage)); SAFE_FREE(&szMsgPart); @@ -327,7 +326,6 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, size_t wLen, DWORD dwUin, char if (usMsg) { SAFE_FREE(&szMsg); szMsg = usMsg; - pre.flags = PREF_UTF; } } @@ -1053,7 +1051,6 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c pre.timestamp = (DWORD)time(NULL); pre.szMessage = (char *)contacts; pre.lParam = nContacts; - pre.flags = PREF_TCHAR; ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre); } @@ -1414,7 +1411,7 @@ void packPluginTypeId(icq_packet *packet, int nTypeID) } -void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg) +void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, int bMsgType, WORD wCookie, const char *szMsg) { if (hContact == INVALID_CONTACT_ID) { debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin); @@ -1429,10 +1426,6 @@ void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DW // it is probably UTF-8 status reply PROTORECVEVENT pre = { 0 }; - if (wVersion >= 9) - if (UTF8_IsValid(szMsg)) - pre.flags |= PREF_UTF; - pre.szMessage = (char*)szMsg; pre.timestamp = time(NULL); pre.lParam = wCookie; @@ -1440,7 +1433,7 @@ void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DW } -HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD wVersion, int type, PBYTE buf, BYTE bFlags) +HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, int type, PBYTE buf, BYTE bFlags) { if (bFlags == 3) { MCONTACT hCookieContact; @@ -1463,7 +1456,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD } ReleaseCookie(wCookie); - handleStatusMsgReply("handleMessageAck: ", hContact, dwUin, wVersion, type, wCookie, (char*)buf); + handleStatusMsgReply("handleMessageAck: ", hContact, dwUin, type, wCookie, (char*)buf); } else // Should not happen debugLogA("%sIgnored type %u ack message (this should not happen)", "handleMessageAck: ", type); @@ -1504,7 +1497,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, } if (wAckType == 2) { - handleMessageAck(dwUin, szUID, wCookie, wVersion, type, (LPBYTE)pMsg, (BYTE)flags); + handleMessageAck(dwUin, szUID, wCookie, type, (LPBYTE)pMsg, (BYTE)flags); return; } @@ -1552,10 +1545,6 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, usMsg[dwExtraLen] = '\0'; SAFE_FREE(&szMsg); szMsg = (char*)make_utf8_string(usMsg); - - if (!IsUnicodeAscii(usMsg, dwExtraLen)) - pre.flags = PREF_UTF; // only mark real non-ascii messages as unicode - bDoubleMsg = 1; } } @@ -1568,7 +1557,6 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, while ((dwGuidLen >= 38) && (dwDataLen >= dwGuidLen)) { if (!strncmp(pMsg, CAP_UTF8MSGS, 38)) { // Found UTF8 cap, convert message to ansi - pre.flags = PREF_UTF; break; } else if (!strncmp(pMsg, CAP_RTFMSGS, 38)) { // Found RichText cap @@ -1583,14 +1571,13 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, } hContact = HContactFromUIN(dwUin, &bAdded); - sendMessageTypesAck(hContact, pre.flags & PREF_UTF, pAckParams); + sendMessageTypesAck(hContact, true, pAckParams); if (!pre.flags && !IsUSASCII(szMsg, mir_strlen(szMsg))) { // message is Ansi and contains national characters, create Unicode part by codepage char *usMsg = convertMsgToUserSpecificUtf(hContact, szMsg); if (usMsg) { SAFE_FREE(&szMsg); szMsg = (char*)usMsg; - pre.flags = PREF_UTF; } } @@ -1625,9 +1612,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, PROTORECVEVENT pre = { 0 }; pre.timestamp = dwTimestamp; pre.szMessage = (char *)szBlob; - pre.flags = PREF_UTF; ProtoChainRecvMsg(hContact, &pre); - SAFE_FREE(&szBlob); } break; @@ -1719,7 +1704,6 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, pre.timestamp = dwTimestamp; pre.szMessage = (char *)isrList; pre.lParam = nContacts; - pre.flags = PREF_TCHAR; ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre); } @@ -2025,7 +2009,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, size_t wLen) } if (bFlags == 3) // A status message reply - handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, wVersion, bMsgType, dwCookie, (char*)(buf + 2)); + handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, bMsgType, dwCookie, (char*)(buf + 2)); else { // An ack of some kind int ackType; @@ -2111,7 +2095,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, size_t wLen) if (dwDataLen > 0) memcpy(szMsg, buf, dwDataLen); szMsg[dwDataLen] = '\0'; - handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, wVersion, pCookieData->nAckType, dwCookie, szMsg); + handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, pCookieData->nAckType, dwCookie, szMsg); ReleaseCookie(dwCookie); return; @@ -2167,7 +2151,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, size_t wLen) szMsg[dwDataLen] = '\0'; szMsg = EliminateHtml(szMsg, dwDataLen); - handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, wVersion, pCookieData->nAckType, (WORD)dwCookie, szMsg); + handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, pCookieData->nAckType, (WORD)dwCookie, szMsg); SAFE_FREE(&szMsg); diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 77faf554f2..aa1a487ad1 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -1390,22 +1390,16 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, size_t wLen) nReasonLen = (int)mir_strlen(szReason); char *temp = (char*)_alloca(nReasonLen + 2); - if (!IsUSASCII(szReason, nReasonLen) && UTF8_IsValid(szReason) && utf8_decode_static(szReason, temp, nReasonLen + 1)) - pre.flags |= PREF_UTF; + if (!IsUSASCII(szReason, nReasonLen) && UTF8_IsValid(szReason)) + utf8_decode_static(szReason, temp, nReasonLen + 1); } // Read nick name from DB char *szNick = NULL; - if (dwUin) { - DBVARIANT dbv = { 0 }; - if (pre.flags & PREF_UTF) - szNick = getSettingStringUtf(hContact, "Nick", NULL); - else if (!getString(hContact, "Nick", &dbv)) { - szNick = null_strdup(dbv.pszVal); - db_free(&dbv); - } - } - else szNick = null_strdup(szUid); + if (dwUin) + szNick = getSettingStringUtf(hContact, "Nick", NULL); + else + szNick = null_strdup(szUid); size_t nNickLen = mir_strlen(szNick); diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index 0b93cf87a5..9d6891dfb6 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -155,7 +155,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, DWORD dwUin, DWORD dwCookie, DWORD TCHAR* ptszFileName = mir_utf8decodeT(pszFileName); PROTORECVFILET pre = { 0 }; - pre.flags = PREF_TCHAR; + pre.dwFlags = PRFF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); pre.tszDescription = mir_utf8decodeT(pszDescription); diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 8fb7f68e67..3095247501 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -633,7 +633,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact) break; case PFLAGNUM_4: - nReturn = PF4_SUPPORTIDLE | PF4_IMSENDUTF | PF4_IMSENDOFFLINE | PF4_INFOSETTINGSVC; + nReturn = PF4_SUPPORTIDLE | PF4_IMSENDOFFLINE | PF4_INFOSETTINGSVC; if (m_bAvatarsEnabled) nReturn |= PF4_AVATARS; #ifdef DBG_CAPMTN @@ -869,41 +869,27 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage; int i; size_t cbBlob = 0; - DWORD flags = 0; - - if (pre->flags & PREF_UTF || pre->flags & PREF_UNICODE) - flags |= DBEF_UTF; + DWORD flags = DBEF_UTF; for (i = 0; i < pre->lParam; i++) { - if (pre->flags & PREF_UNICODE) - cbBlob += get_utf8_size((WCHAR*)isrList[i]->hdr.nick) + 2; - else - cbBlob += mir_strlen((char*)isrList[i]->hdr.nick) + 2; // both trailing zeros + cbBlob += mir_strlen((char*)isrList[i]->hdr.nick) + 2; // both trailing zeros if (isrList[i]->uin) cbBlob += getUINLen(isrList[i]->uin); - else if (pre->flags & PREF_UNICODE) - cbBlob += mir_wstrlen((WCHAR*)isrList[i]->hdr.id); else cbBlob += mir_strlen((char*)isrList[i]->hdr.id); } PBYTE pBlob = (PBYTE)_alloca(cbBlob), pCurBlob; for (i = 0, pCurBlob = pBlob; i < pre->lParam; i++) { - if (pre->flags & PREF_UNICODE) - make_utf8_string_static((WCHAR*)isrList[i]->hdr.nick, (char*)pCurBlob, cbBlob - (pCurBlob - pBlob)); - else - strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick); + strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick); pCurBlob += mir_strlen((char*)pCurBlob) + 1; if (isrList[i]->uin) { char szUin[UINMAXLEN]; _itoa(isrList[i]->uin, szUin, 10); strcpy((char*)pCurBlob, szUin); } - else { // aim contact - if (pre->flags & PREF_UNICODE) - unicode_to_ansi_static((WCHAR*)isrList[i]->hdr.id, (char*)pCurBlob, cbBlob - (pCurBlob - pBlob)); - else - strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id); - } + else // aim contact + strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id); + pCurBlob += mir_strlen((char*)pCurBlob) + 1; } @@ -917,17 +903,8 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) int __cdecl CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { - DWORD flags = 0; - size_t cbBlob = mir_strlen(pre->szMessage) + 1; - // process utf-8 encoded messages - if ((pre->flags & PREF_UTF) && !IsUSASCII(pre->szMessage, mir_strlen(pre->szMessage))) - flags |= DBEF_UTF; - // process unicode ucs-2 messages - if ((pre->flags & PREF_UNICODE) && !IsUnicodeAscii((WCHAR*)(pre->szMessage + cbBlob), mir_wstrlen((WCHAR*)(pre->szMessage + cbBlob)))) - cbBlob *= (sizeof(WCHAR)+1); - - ICQAddRecvEvent(hContact, EVENTTYPE_MESSAGE, pre, cbBlob, (PBYTE)pre->szMessage, flags); + ICQAddRecvEvent(hContact, EVENTTYPE_MESSAGE, pre, cbBlob, (PBYTE)pre->szMessage, DBEF_UTF); // stop contact from typing - some clients do not sent stop notify if (CheckContactCapabilities(hContact, CAPF_TYPING)) @@ -1275,13 +1252,13 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription //////////////////////////////////////////////////////////////////////////////////////// // PS_SendMessage - sends a message -int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) { if (hContact == NULL || pszSrc == NULL) return NULL; DWORD dwCookie; - char* puszText = NULL; + char* puszText = (char*)pszSrc; int bNeedFreeU = 0; // Invalid contact @@ -1290,23 +1267,11 @@ int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) if (getContactUid(hContact, &dwUin, &szUID)) return ReportGenericSendError(hContact, ACKTYPE_MESSAGE, "The receiver has an invalid user ID."); - if (flags & PREF_UNICODE) { - puszText = make_utf8_string((WCHAR*)(pszSrc + mir_strlen(pszSrc) + 1)); // get the UTF-16 part - bNeedFreeU = 1; - } - else if (flags & PREF_UTF) - puszText = (char*)pszSrc; - else { - puszText = (char*)ansi_to_utf8(pszSrc); - bNeedFreeU = 1; - } - WORD wRecipientStatus = getContactStatus(hContact); BOOL plain_ascii = IsUSASCII(puszText, mir_strlen(puszText)); BOOL oldAnsi = plain_ascii || !m_bUtfEnabled || - (!(flags & (PREF_UTF | PREF_UNICODE)) && m_bUtfEnabled == 1) || !CheckContactCapabilities(hContact, CAPF_UTF) || !getByte(hContact, "UnicodeSend", 1); @@ -1342,11 +1307,9 @@ int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) dwCookie = icq_SendDirectMessage(hContact, dc_msg, mir_strlen(dc_msg), pCookieData, dc_cap); SAFE_FREE(&szUserAnsi); - if (dwCookie) { // free the buffers if alloced - if (bNeedFreeU) SAFE_FREE(&puszText); - + if (dwCookie) // free the buffers if alloced return dwCookie; // we succeded, return - } + // on failure, fallback to send thru server } @@ -1358,7 +1321,6 @@ int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) memmove(mng + 12, mng, len + 1); memcpy(mng, "", 12); strcat(mng, ""); - if (bNeedFreeU) SAFE_FREE(&puszText); puszText = mng; bNeedFreeU = 1; } @@ -1779,17 +1741,11 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(MCONTACT hContact) int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt) { - if (evt->flags & PREF_UTF) { - setStatusMsgVar(hContact, evt->szMessage, false); + setStatusMsgVar(hContact, evt->szMessage, false); - TCHAR* pszMsg = mir_utf8decodeT(evt->szMessage); - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)pszMsg); - mir_free(pszMsg); - } - else { - setStatusMsgVar(hContact, evt->szMessage, true); - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)(TCHAR*)_A2T(evt->szMessage)); - } + TCHAR* pszMsg = mir_utf8decodeT(evt->szMessage); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)pszMsg); + mir_free(pszMsg); return 0; } diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 97666e109d..f0e7be49f6 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -290,7 +290,7 @@ struct CIcqProto : public PROTO void handleRecvServMsgError(BYTE *buf, size_t wLen, DWORD dwRef); void handleRecvMsgResponse(BYTE *buf, size_t wLen); void handleServerAck(BYTE *buf, size_t wLen, DWORD dwRef); - void handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg); + void handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, int bMsgType, WORD wCookie, const char *szMsg); void handleTypingNotification(BYTE *buf, size_t wLen); void handleMissedMsg(BYTE *buf, size_t wLen); void handleOffineMessagesReply(DWORD dwRef); @@ -300,7 +300,7 @@ struct CIcqProto : public PROTO void parseServRelayData(BYTE *pDataBuf, size_t wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType); void parseServRelayPluginData(BYTE *pDataBuf, size_t wLen, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion); - HANDLE handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD wVersion, int type, PBYTE buf, BYTE bFlags); + HANDLE handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, int type, PBYTE buf, BYTE bFlags); void handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, DWORD dwMsgID, DWORD dwMsgID2, WORD wCookie, WORD wVersion, int type, int flags, WORD wAckType, size_t dwDataLen, size_t wMsgLen, char *pMsg, int nMsgFlags, message_ack_params *pAckParams); void sendMessageTypesAck(MCONTACT hContact, int bUnicode, message_ack_params *pArgs); void sendTypingNotification(MCONTACT hContact, WORD wMTNCode); diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 334ed7455b..bbd5eb7146 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -332,7 +332,7 @@ void CIcqProto::handleXtrazData(DWORD dwUin, char* szMsg, BOOL bThruDC) PROTORECVEVENT pre = { 0 }; pre.timestamp = time(NULL); pre.szMessage = szWork; - pre.flags = PREF_UTF; + pre.flags = 0; int bAdded; ProtoChainRecvMsg(HContactFromUIN(dwUin, &bAdded), &pre); diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 5193eac141..4c325a7b6e 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -586,12 +586,10 @@ MCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) void CIcqProto::ICQAddRecvEvent(MCONTACT hContact, WORD wType, PROTORECVEVENT* pre, size_t cbBlob, PBYTE pBlob, DWORD flags) { + flags |= DBEF_UTF; if (pre->flags & PREF_CREATEREAD) flags |= DBEF_READ; - if (pre->flags & PREF_UTF) - flags |= DBEF_UTF; - if (hContact && db_get_b(hContact, "CList", "Hidden", 0)) { // if the contact was hidden, add to client-list if not in server-list authed if (!getWord(hContact, DBSETTING_SERVLIST_ID, 0) || getByte(hContact, "Auth", 0)) { diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 917977dad5..8ac157c740 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -499,19 +499,13 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char * strcpy(szBlob + sizeof(DWORD), pszFileName); strcpy(szBlob + sizeof(DWORD) + mir_strlen(pszFileName) + 1, pszDescription); - TCHAR* ptszFileName = mir_utf8decodeT(pszFileName); - PROTORECVFILET pre = { 0 }; - pre.flags = PREF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); - pre.tszDescription = mir_utf8decodeT(pszDescription); - pre.ptszFiles = &ptszFileName; + pre.szDescription = pszDescription; + pre.pszFiles = &pszFileName; pre.lParam = (LPARAM)ft; ProtoChainRecvFile(hContact, &pre); - - mir_free(pre.tszDescription); - mir_free(ptszFileName); } else if (wAckType == 2) { // First attempt failed, reverse requested oscar_filetransfer *ft = FindOscarTransfer(hContact, dwID1, dwID2); -- cgit v1.2.3