diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-16 20:46:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-16 20:46:48 +0000 |
commit | 8e87b243ac6adf4d6e179d6453d46c4211e6baa3 (patch) | |
tree | 64bea61e4ae673d9c536125cc91823908a16155a /protocols/MSN/src | |
parent | f2769285e5e68ae941fbe1010337039ae8222005 (diff) |
switch to the library ProtoBroadcastAck for Jabber, MSN & YAHOO
git-svn-id: http://svn.miranda-ng.org/main/trunk@4992 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src')
-rw-r--r-- | protocols/MSN/src/msn_auth.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_avatar.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 28 | ||||
-rw-r--r-- | protocols/MSN/src/msn_errors.cpp | 8 | ||||
-rw-r--r-- | protocols/MSN/src/msn_ftold.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_mail.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_msgqueue.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_p2p.cpp | 24 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 30 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.h | 1 | ||||
-rw-r--r-- | protocols/MSN/src/msn_std.cpp | 14 | ||||
-rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 2 |
14 files changed, 60 insertions, 75 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 5abe9160f2..178d36763c 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -308,7 +308,7 @@ int CMsnProto::MSN_GetPassportAuth(void) {
case 3:
MSN_ShowError("Your username or password is incorrect");
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
break;
case 5:
@@ -316,7 +316,7 @@ int CMsnProto::MSN_GetPassportAuth(void) default:
MSN_ShowError("Unable to contact MS Passport servers check proxy/firewall settings");
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
break;
}
}
diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp index eda6d98072..4543038281 100644 --- a/protocols/MSN/src/msn_avatar.cpp +++ b/protocols/MSN/src/msn_avatar.cpp @@ -37,7 +37,7 @@ void CMsnProto::AvatarQueue_Uninit() void CMsnProto::pushAvatarRequest(HANDLE hContact, LPCSTR pszUrl)
{
- SendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
if (pszUrl != NULL && *pszUrl != 0) {
mir_cslock lck(csAvatarQueue);
@@ -92,7 +92,7 @@ LBL_Error: _write(fileId, nlhrReply->pData, (unsigned)nlhrReply->dataLength);
_close(fileId);
- SendBroadcast(p->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
+ ProtoBroadcastAck(p->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
return true;
}
@@ -119,7 +119,7 @@ void __cdecl CMsnProto::MSN_AvatarsThread(void*) continue;
if ( !loadHttpAvatar(p))
- SendBroadcast(p->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, 0, 0);
+ ProtoBroadcastAck(p->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, 0, 0);
delete p;
}
}
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 057f2f3111..8b4091c313 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -532,7 +532,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para if (!MSN_RefreshContactList())
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
info->sendTerminate();
}
else
@@ -661,10 +661,10 @@ void CMsnProto::sttProcessYFind(char* buf, size_t len) isr.nick = szEmailT;
isr.email = szEmailT;
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, msnSearchId, (LPARAM)&isr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, msnSearchId, (LPARAM)&isr);
mir_free(szEmailT);
}
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, msnSearchId, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, msnSearchId, 0);
msnSearchId = NULL;
}
@@ -824,7 +824,7 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli {
ptrT tszStatus( mir_utf8decodeT(szStatMsg));
- SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, tszStatus);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, tszStatus);
}
// Process current media info
@@ -1040,7 +1040,7 @@ void CMsnProto::MSN_InitSB(ThreadData* info, const char* szEmail) else if (E.msgSize == 0)
{
info->sendMessage(E.msgType, NULL, 1, E.message, E.flags);
- SendBroadcast(cont->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)E.seq, 0);
+ ProtoBroadcastAck(cont->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)E.seq, 0);
}
else
{
@@ -1110,7 +1110,7 @@ int CMsnProto::MSN_HandleCommands(ThreadData* info, char* cmdString) ReleaseSemaphore(info->hWaitEvent, 1, NULL);
if (info->mJoinedContactsWLID.getCount() > 0 && MyOptions.SlowSend)
- SendBroadcast(info->getContactHandle(), ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)trid, 0);
+ ProtoBroadcastAck(info->getContactHandle(), ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)trid, 0);
break;
case ' YQF': //********* FQY: Find Yahoo User
@@ -1269,7 +1269,7 @@ LBL_InvalidCommand: if (newStatus != ID_STATUS_IDLE)
{
m_iStatus = newStatus;
- SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, newStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, newStatus);
MSN_DebugLog("Status change acknowledged: %s", params);
MSN_RemoveEmptyGroups();
}
@@ -1340,7 +1340,7 @@ LBL_InvalidCommand: {
int oldMode = m_iStatus;
m_iDesiredStatus = m_iStatus = newStatus;
- SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
}
}
@@ -1417,7 +1417,7 @@ remove: deleteSetting(hContact, "PictContext");
deleteSetting(hContact, "PictSavedContext");
- SendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
}
else if (lastStatus == ID_STATUS_OFFLINE)
@@ -1600,7 +1600,7 @@ remove: case ' KAN': //********* NAK: section 8.7 Instant Messages
if (info->mJoinedContactsWLID.getCount() > 0 && MyOptions.SlowSend)
- SendBroadcast(info->getContactHandle(),
+ ProtoBroadcastAck(info->getContactHandle(),
ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE)trid, (LPARAM)MSN_Translate("Message delivery failed"));
MSN_DebugLog("Message send failed (trid=%d)", trid);
@@ -1621,7 +1621,7 @@ remove: case ' TUO': //********* OUT: sections 7.10 Connection Close, 8.6 Leaving a Switchboard Session
if (!_stricmp(params, "OTH"))
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
MSN_DebugLog("You have been disconnected from the MSN server because you logged on from another location using the same MSN passport.");
}
@@ -1745,7 +1745,7 @@ remove: case 4:
case 8:
- SendBroadcast( NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION );
+ ProtoBroadcastAck( NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION );
MSN_DebugLog( "You have been disconnected from the MSN server because you logged on from another location using the same MSN passport." );
break;
@@ -1821,7 +1821,7 @@ remove: if (info->mType == SERVER_NOTIFICATION)
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPROTOCOL);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPROTOCOL);
}
return 1;
}
@@ -1868,7 +1868,7 @@ remove: if (info->mType == SERVER_NOTIFICATION)
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPROTOCOL);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPROTOCOL);
}
return 1;
}
diff --git a/protocols/MSN/src/msn_errors.cpp b/protocols/MSN/src/msn_errors.cpp index c468c7d645..fae9fd65f7 100644 --- a/protocols/MSN/src/msn_errors.cpp +++ b/protocols/MSN/src/msn_errors.cpp @@ -33,13 +33,13 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString) switch(errorCode) {
case ERR_INTERNAL_SERVER:
MSN_ShowError("MSN Services are temporarily unavailable, please try to connect later");
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
return 1;
case ERR_SERVER_BUSY:
case ERR_SERVER_UNAVAILABLE:
MSN_ShowError("MSN Services are too busy, please try to connect later");
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
return 1;
case ERR_NOT_ALLOWED_WHEN_OFFLINE:
@@ -63,7 +63,7 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString) case ERR_NOT_ONLINE:
if (info->mInitialContactWLID)
- SendBroadcast(MSN_HContactFromEmail(info->mInitialContactWLID), ACKTYPE_MESSAGE, ACKRESULT_FAILED,
+ ProtoBroadcastAck(MSN_HContactFromEmail(info->mInitialContactWLID), ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE)999999, (LPARAM)MSN_Translate("User not online"));
else
MSN_ShowError("User not online");
@@ -78,7 +78,7 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString) if (info->mType != SERVER_SWITCHBOARD)
{
MSN_ShowError("Your username or password is incorrect");
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
}
return 1;
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp index a204f7ded5..25e5f0279d 100644 --- a/protocols/MSN/src/msn_ftold.cpp +++ b/protocols/MSN/src/msn_ftold.cpp @@ -143,7 +143,7 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString) ft->std.totalProgress += packetLen;
ft->std.currentFileProgress += packetLen;
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
}
ft->complete();
@@ -238,7 +238,7 @@ LBL_Success: ft->std.totalProgress += dataLen;
ft->std.currentFileProgress += dataLen;
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
if (ft->std.currentFileProgress == ft->std.totalBytes)
{
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 87d6dbebed..faf479027b 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -318,7 +318,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) }
}
- SendBroadcast(NULL, ACKTYPE_EMAIL, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_EMAIL, ACKRESULT_STATUS, NULL, 0);
// Disable to notify receiving hotmail
if (ShowPopup && !getByte("DisableHotmail", 0))
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index dad0f8d79a..12c8d24064 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -474,7 +474,7 @@ void CMsnProto::MSN_GoOffline(void) if (!Miranda_Terminated()) {
int msnOldStatus = m_iStatus; m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)msnOldStatus, ID_STATUS_OFFLINE);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)msnOldStatus, ID_STATUS_OFFLINE);
isIdle = false;
int count = -1;
@@ -1090,7 +1090,7 @@ filetransfer::~filetransfer(void) {
std.ptszFiles = NULL;
std.totalFiles = 0;
- proto->SendBroadcast(std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, this, 0);
+ proto->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, this, 0);
}
mir_free(p2p_branch);
@@ -1121,7 +1121,7 @@ void filetransfer::complete(void) close();
bCompleted = true;
- proto->SendBroadcast(std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this, 0);
+ proto->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this, 0);
}
int filetransfer::create(void)
diff --git a/protocols/MSN/src/msn_msgqueue.cpp b/protocols/MSN/src/msn_msgqueue.cpp index af52e9cea7..3bc2eb25c4 100644 --- a/protocols/MSN/src/msn_msgqueue.cpp +++ b/protocols/MSN/src/msn_msgqueue.cpp @@ -157,7 +157,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) if (E.msgSize == 0)
{
HANDLE hContact = MSN_HContactFromEmail(E.wlid);
- SendBroadcast(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE)E.seq, (LPARAM)MSN_Translate("Message delivery failed"));
}
mir_free(E.message);
@@ -188,7 +188,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) {
LeaveCriticalSection(&csMsgQueue);
HANDLE hContact = MSN_HContactFromEmail(wlid);
- SendBroadcast(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq,
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq,
(LPARAM)MSN_Translate("Message delivery failed"));
i = 0;
EnterCriticalSection(&csMsgQueue);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 09c32ac1d9..353b4d1a95 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -205,7 +205,7 @@ void CMsnProto::p2p_pictureTransferFailed(filetransfer* ft) AI.cbSize = sizeof(AI);
AI.hContact = ft->std.hContact;
deleteSetting(ft->std.hContact, "AvatarHash");
- SendBroadcast(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
+ ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
}
break;
}
@@ -258,7 +258,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft) mir_free(szAvatarHash);
setString(ft->std.hContact, "PictSavedContext", ft->p2p_object);
- SendBroadcast(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
+ ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
char *filename = mir_utf8encodeT(AI.filename);
MSN_DebugLog("Avatar for contact %08x saved to file '%s'", AI.hContact, filename);
@@ -961,7 +961,7 @@ LONG CMsnProto::p2p_sendPortion(filetransfer* ft, ThreadData* T, bool isV2) ft->std.currentFileProgress += portion;
if (ft->p2p_appID == MSN_APPID_FILE && clock() >= ft->nNotify)
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
ft->nNotify = clock() + 500;
}
}
@@ -1052,7 +1052,7 @@ void __cdecl CMsnProto::p2p_sendFeedThread(void* arg) ReleaseMutex(hLockHandle);
if (ft->p2p_appID == MSN_APPID_FILE)
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
if (isV2)
{
@@ -1419,7 +1419,7 @@ void CMsnProto::p2p_InitDirectTransfer(MimeHeaders& tFileInfo, MimeHeaders& tFil return;
}
else
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
*/
}
@@ -1943,7 +1943,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* if (ft->p2p_appID == MSN_APPID_FILE && clock() >= ft->nNotify)
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
ft->nNotify = clock() + 500;
//---- send an ack: body was transferred correctly
@@ -1954,7 +1954,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* {
if (ft->p2p_appID == MSN_APPID_FILE)
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
ft->complete();
}
else
@@ -2115,7 +2115,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wl if (ft->p2p_appID == MSN_APPID_FILE && clock() >= ft->nNotify)
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
ft->nNotify = clock() + 500;
}
}
@@ -2126,7 +2126,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wl if (ft->std.currentFileProgress >= hdrdata.mTotalSize)
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
p2p_sendAck(ft->p2p_dest, &hdrdata);
if (ft->p2p_appID == MSN_APPID_FILE)
{
@@ -2403,17 +2403,17 @@ void CMsnProto::p2p_sessionComplete(filetransfer* ft) if (ft->openNext() == -1)
{
bool success = ft->std.currentFileNumber >= ft->std.totalFiles && ft->bCompleted;
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, success ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, success ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, ft, 0);
}
else
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
p2p_invite(ft->p2p_appID, ft, NULL);
}
}
else
{
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ft->bCompleted ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ft->bCompleted ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, ft, 0);
p2p_unregisterSession(ft);
}
}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 509084481d..e37531d34c 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -431,7 +431,7 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) if (Lists_IsInList(LIST_FL, email))
{
MSN_ShowPopup(emailT, TranslateT("Contact already in your contact list"), MSN_ALLOW_MSGBOX, NULL);
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
mir_free(arg);
return;
}
@@ -450,14 +450,14 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) isr.nick = (TCHAR*)emailT;
isr.email = (TCHAR*)emailT;
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, arg, (LPARAM)&isr);
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, arg, (LPARAM)&isr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
}
break;
case 1:
if (strstr(email, "@yahoo.com") == NULL)
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
else
{
msnSearchId = arg;
@@ -466,7 +466,7 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) break;
default:
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
break;
}
mir_free(email);
@@ -516,7 +516,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) mir_sntprintf(filefull, SIZEOF(filefull), _T("%s\\%s"), ft->std.tszWorkingDir, ft->std.tszCurrentFile);
replaceStrT(ft->std.tszCurrentFile, filefull);
- if (SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->std))
+ if (ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->std))
return;
bool fcrt = ft->create() != -1;
@@ -530,7 +530,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) else
msnftp_sendAcceptReject (ft, fcrt);
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
}
HANDLE __cdecl CMsnProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
@@ -652,7 +652,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR else
msnftp_sendAcceptReject (ft, fcrt);
- SendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
break;
}
@@ -675,10 +675,10 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) AwayMsgInfo *inf = (AwayMsgInfo*)arg;
DBVARIANT dbv;
if (!db_get_ts(inf->hContact, "CList", "StatusMsg", &dbv)) {
- SendBroadcast(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, (LPARAM)dbv.ptszVal);
+ ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, (LPARAM)dbv.ptszVal);
MSN_FreeVariant(&dbv);
}
- else SendBroadcast(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, 0);
+ else ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, 0);
mir_free(inf);
}
@@ -832,7 +832,7 @@ HANDLE __cdecl CMsnProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescripti msnftp_invite(sft);
}
- SendBroadcast(hContact, ACKTYPE_FILE, ACKRESULT_SENTREQUEST, sft, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_SENTREQUEST, sft, 0);
return sft;
}
@@ -859,7 +859,7 @@ void CMsnProto::MsnFakeAck(void* arg) TFakeAckParams* tParam = (TFakeAckParams*)arg;
Sleep(150);
- tParam->proto->SendBroadcast(tParam->hContact, ACKTYPE_MESSAGE,
+ tParam->proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE,
tParam->msg ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
(HANDLE)tParam->id, LPARAM(tParam->msg));
@@ -1051,14 +1051,14 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus) int ps = getStaticString(NULL, "Password", szPassword, sizeof(szPassword));
if (ps != 0 || *szPassword == 0)
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
return 0;
}
if (*MyOptions.szEmail == 0)
{
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
return 0;
}
@@ -1070,7 +1070,7 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus) int oldMode = m_iStatus;
m_iStatus = ID_STATUS_CONNECTING;
- SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
ThreadData* newThread = new ThreadData;
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 22b3a924a1..1f729be394 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -576,7 +576,6 @@ struct CMsnProto : public PROTO_INTERFACE void HookProtoEvent(const char* szEvent, MsnEventFunc pFunc);
void ForkThread(MsnThreadFunc pFunc, void* param);
- int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
TCHAR* GetContactNameT(HANDLE hContact);
void deleteSetting(HANDLE hContact, const char* valueName);
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp index 43532ec6a5..2ca835621b 100644 --- a/protocols/MSN/src/msn_std.cpp +++ b/protocols/MSN/src/msn_std.cpp @@ -173,20 +173,6 @@ void CMsnProto::ForkThread(MsnThreadFunc pFunc, void* param) CloseHandle((HANDLE)mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, this, param, &threadID));
}
-int CMsnProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
-{
- ACKDATA ack = {0};
- ack.cbSize = sizeof(ACKDATA);
- ack.szModule = m_szModuleName;
- ack.hContact = hContact;
- ack.type = type;
- ack.result = result;
- ack.hProcess = hProcess;
- ack.lParam = lParam;
- return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
-}
-
-
TCHAR* CMsnProto::GetContactNameT(HANDLE hContact)
{
if (hContact)
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 20d0aa2153..e8c6b80a12 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -58,7 +58,7 @@ INT_PTR CMsnProto::GetAvatar(WPARAM wParam, LPARAM lParam) void CMsnProto::sttFakeAvatarAck(void* arg)
{
Sleep(100);
- SendBroadcast(((PROTO_AVATAR_INFORMATIONT*)arg)->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, arg, 0);
+ ProtoBroadcastAck(((PROTO_AVATAR_INFORMATIONT*)arg)->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, arg, 0);
}
INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam)
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index 3db86cced2..8640a40140 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -279,7 +279,7 @@ LBL_Exit: }
if (info->s == NULL)
- SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
else
{
p2p_cancelAllSessions();
|