diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-27 12:37:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-27 12:37:42 +0000 |
commit | 3ef638023d476a91128f287fe454b547836a4b90 (patch) | |
tree | 46c8e3340f5ce59fdb8bce2ef758e3c32d78fb01 /protocols/MRA/Mra_proto.cpp | |
parent | 6035c2ae283bd8743a7484ed8796bd845afec4d5 (diff) |
automatic lock management
git-svn-id: http://svn.miranda-ng.org/main/trunk@1680 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/Mra_proto.cpp')
-rw-r--r-- | protocols/MRA/Mra_proto.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/protocols/MRA/Mra_proto.cpp b/protocols/MRA/Mra_proto.cpp index 6abb2fbd3e..268834835e 100644 --- a/protocols/MRA/Mra_proto.cpp +++ b/protocols/MRA/Mra_proto.cpp @@ -107,7 +107,7 @@ void CMraProto::MraThreadProc(LPVOID lpParameter) else {
if (bConnected == FALSE) {
ShowFormattedErrorMessage(L"Can't connect to MRIM server, error", GetLastError());
- ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK, 0);
+ ProtoBroadcastAckEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
}
}
@@ -270,13 +270,13 @@ DWORD CMraProto::MraNetworkDispatcher() //nothing to do
break;
case ACKTYPE_MESSAGE:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, (LPARAM)"Undefined message deliver error, time out", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, (LPARAM)"Undefined message deliver error, time out");
break;
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL);
break;
case ACKTYPE_SEARCH:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)dwCMDNum, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)dwCMDNum, (LPARAM)NULL);
break;
case ICQACKTYPE_SMS:
mir_free(lpbData);
@@ -454,7 +454,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd break;
case MRIM_CS_LOGIN_REJ: // Unsuccessful authorization //LPS ## reason ## причина отказа
- ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD, 0);
+ ProtoBroadcastAckEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
dwStringSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpsString.lpszData, lpsString.dwSize, szBuff, SIZEOF(szBuff));
@@ -483,33 +483,33 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd break;
case MRIM_CS_MESSAGE_STATUS:
- if (MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize) == NO_ERROR) {
+ if ( !MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize)) {
dwTemp = GetUL(&lpbDataCurrent);
switch (dwTemp) {
case MESSAGE_DELIVERED:// Message delivered directly to user
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL);
break;//***deb возможны сбои из-за асинхронности тк там передаётся указатель
case MESSAGE_REJECTED_NOUSER:// Message rejected - no such user
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message rejected - no such user", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message rejected - no such user");
break;
case MESSAGE_REJECTED_INTERR:// Internal server error
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Internal server error", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Internal server error");
break;
case MESSAGE_REJECTED_LIMIT_EXCEEDED:// Offline messages limit exceeded
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Offline messages limit exceeded", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Offline messages limit exceeded");
break;
case MESSAGE_REJECTED_TOO_LARGE:// Message is too large
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message is too large", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message is too large");
break;
case MESSAGE_REJECTED_DENY_OFFMSG:// User does not accept offline messages
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline messages", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline messages");
break;
case MESSAGE_REJECTED_DENY_OFFFLSH:// User does not accept offline flash animation
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline flash animation", -1);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline flash animation");
break;
default:
dwTemp = mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "Undefined message deliver error, code: %lu", dwTemp);
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)szBuff, dwTemp);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)szBuff);
break;
}
MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
@@ -1116,11 +1116,11 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd switch (dwAckType) {
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL);
break;
case ACKTYPE_SEARCH:
default:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL);
break;
}
break;
@@ -1131,10 +1131,10 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd case MRIM_ANKETA_INFO_STATUS_RATELIMERR:// слишком много запросов, поиск временно запрещен
switch (dwAckType) {
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL);
break;
case ACKTYPE_SEARCH:
- ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
+ ProtoBroadcastAckEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL);
break;
default:
DebugBreak();
@@ -1576,7 +1576,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd lpwszMessage = (LPWSTR)(lpszPhone+dwPhoneSize+1);
dwTemp = mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "<sms_response><source>Mail.ru</source><deliverable>Yes</deliverable><network>Mail.ru, Russia</network><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><messages_left>0</messages_left></sms_response>\r\n", szEMail, lpszPhone, lpszPhone);
- ProtoBroadcastAckAsynchEx(NULL, dwAckType, ACKRESULT_SENTREQUEST, (HANDLE)pmaHeader->seq, (LPARAM)szBuff, dwTemp);
+ ProtoBroadcastAckEx(NULL, dwAckType, ACKRESULT_SENTREQUEST, (HANDLE)pmaHeader->seq, (LPARAM)szBuff);
}
mir_free(lpsString.lpszData);
@@ -1903,11 +1903,11 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl if (dwFlags & MESSAGE_SMS_DELIVERY_REPORT) {
dwBuffLen = mir_snprintf(lpszBuff, (dwBuffLen*sizeof(WCHAR)), "<sms_delivery_receipt><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><delivered>No</delivered><submition_time>%s</submition_time><error_code>0</error_code><error><id>15</id><params><param>%s</param></params></error></sms_delivery_receipt>", szEMail, szPhone, szPhone, szTime, lpszMessageUTF);
- ProtoBroadcastAckAsynchEx(NULL, ICQACKTYPE_SMS, ACKRESULT_FAILED, (HANDLE)0, (LPARAM)lpszBuff, dwBuffLen);
+ ProtoBroadcastAckEx(NULL, ICQACKTYPE_SMS, ACKRESULT_FAILED, (HANDLE)0, (LPARAM)lpszBuff);
}
else { // new sms
dwBuffLen = mir_snprintf(lpszBuff, (dwBuffLen*sizeof(WCHAR)), "<sms_message><source>Mail.ru</source><destination_UIN>%s</destination_UIN><sender>%s</sender><senders_network>Mail.ru</senders_network><text>%s</text><time>%s</time></sms_message>", szEMail, szPhone, lpszMessageUTF, szTime);
- ProtoBroadcastAckAsynchEx(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, (HANDLE)0, (LPARAM)lpszBuff, dwBuffLen);
+ ProtoBroadcastAckEx(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, (HANDLE)0, (LPARAM)lpszBuff);
}
}
else dwRetErrorCode = GetLastError();
|