summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp63
-rw-r--r--protocols/JabberG/src/jabber_file.cpp26
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp18
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp34
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp18
-rw-r--r--protocols/JabberG/src/jabber_proto.h2
-rw-r--r--protocols/JabberG/src/jabber_search.cpp10
-rw-r--r--protocols/JabberG/src/jabber_std.cpp20
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp34
-rw-r--r--protocols/JabberG/src/jabber_util.cpp4
-rw-r--r--protocols/MSN/src/msn_auth.cpp4
-rw-r--r--protocols/MSN/src/msn_avatar.cpp6
-rw-r--r--protocols/MSN/src/msn_commands.cpp28
-rw-r--r--protocols/MSN/src/msn_errors.cpp8
-rw-r--r--protocols/MSN/src/msn_ftold.cpp4
-rw-r--r--protocols/MSN/src/msn_mail.cpp2
-rw-r--r--protocols/MSN/src/msn_misc.cpp6
-rw-r--r--protocols/MSN/src/msn_msgqueue.cpp4
-rw-r--r--protocols/MSN/src/msn_p2p.cpp24
-rw-r--r--protocols/MSN/src/msn_proto.cpp30
-rw-r--r--protocols/MSN/src/msn_proto.h1
-rw-r--r--protocols/MSN/src/msn_std.cpp14
-rw-r--r--protocols/MSN/src/msn_svcs.cpp2
-rw-r--r--protocols/MSN/src/msn_threads.cpp2
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp2
-rw-r--r--protocols/Yahoo/src/proto.cpp2
-rw-r--r--protocols/Yahoo/src/proto.h2
-rw-r--r--protocols/Yahoo/src/search.cpp16
-rw-r--r--protocols/Yahoo/src/util.cpp12
-rw-r--r--protocols/Yahoo/src/yahoo.cpp2
32 files changed, 180 insertions, 224 deletions
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index be9afd0603..2aff62d257 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -746,40 +746,35 @@ int CJabberDlgDiscovery::Resizer(UTILRESIZECONTROL *urc)
RECT rc;
switch (urc->wId) {
- case IDC_COMBO_JID:
- {
- GetWindowRect(GetDlgItem(m_hwnd, urc->wId), &rc);
- urc->rcItem.right += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
- urc->rcItem.bottom = urc->rcItem.top + rc.bottom - rc.top;
- return 0;
- }
- case IDC_TXT_NODELABEL:
- {
- urc->rcItem.left += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
- urc->rcItem.right += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
- return 0;
- }
- case IDC_COMBO_NODE:
- {
- GetWindowRect(GetDlgItem(m_hwnd, urc->wId), &rc);
- urc->rcItem.left += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
- urc->rcItem.right += urc->dlgNewSize.cx - urc->dlgOriginalSize.cx;
- urc->rcItem.bottom = urc->rcItem.top + rc.bottom - rc.top;
- return 0;
- }
- case IDC_BUTTON_BROWSE:
- return RD_ANCHORX_RIGHT|RD_ANCHORY_TOP;
-
- case IDC_TREE_DISCO:
- return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT;
-
- case IDC_TXT_FILTER:
- return RD_ANCHORX_LEFT|RD_ANCHORY_BOTTOM;
- case IDC_TXT_FILTERTEXT:
- return RD_ANCHORX_WIDTH|RD_ANCHORY_BOTTOM;
- case IDC_BTN_FILTERAPPLY:
- case IDC_BTN_FILTERRESET:
- return RD_ANCHORX_RIGHT|RD_ANCHORY_BOTTOM;
+ case IDC_COMBO_JID:
+ GetWindowRect(GetDlgItem(m_hwnd, urc->wId), &rc);
+ urc->rcItem.right += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
+ urc->rcItem.bottom = urc->rcItem.top + rc.bottom - rc.top;
+ return 0;
+
+ case IDC_TXT_NODELABEL:
+ urc->rcItem.left += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
+ urc->rcItem.right += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
+ return 0;
+
+ case IDC_COMBO_NODE:
+ GetWindowRect(GetDlgItem(m_hwnd, urc->wId), &rc);
+ urc->rcItem.left += (urc->dlgNewSize.cx - urc->dlgOriginalSize.cx) / 2;
+ urc->rcItem.right += urc->dlgNewSize.cx - urc->dlgOriginalSize.cx;
+ urc->rcItem.bottom = urc->rcItem.top + rc.bottom - rc.top;
+ return 0;
+
+ case IDC_BUTTON_BROWSE:
+ return RD_ANCHORX_RIGHT|RD_ANCHORY_TOP;
+ case IDC_TREE_DISCO:
+ return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT;
+ case IDC_TXT_FILTER:
+ return RD_ANCHORX_LEFT|RD_ANCHORY_BOTTOM;
+ case IDC_TXT_FILTERTEXT:
+ return RD_ANCHORX_WIDTH|RD_ANCHORY_BOTTOM;
+ case IDC_BTN_FILTERAPPLY:
+ case IDC_BTN_FILTERRESET:
+ return RD_ANCHORX_RIGHT|RD_ANCHORY_BOTTOM;
}
return CSuper::Resizer(urc);
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 15d00a96fa..45f303153b 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -42,7 +42,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
if ((buffer=(char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE)) == NULL) {
Log("Cannot allocate network buffer, thread ended");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
delete ft;
return;
}
@@ -55,7 +55,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
info.s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
if (info.s == NULL) {
Log("Connection failed (%d), thread ended", WSAGetLastError());
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
mir_free(buffer);
delete ft;
return;
@@ -118,7 +118,7 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen)
ft->state = FT_INITIALIZING;
ft->std.currentFileSize = -1;
Log("Change to FT_INITIALIZING");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
}
}
else { // FT_INITIALIZING
@@ -176,7 +176,7 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen)
else {
ft->std.currentFileProgress += writeSize;
ft->std.totalProgress += writeSize;
- JSendBroadcast(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.currentFileSize)
ft->state = FT_DONE;
}
@@ -266,7 +266,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
info.s = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)m_hNetlibUser, (LPARAM)&nlb);
if (info.s == NULL) {
Log("Cannot allocate port to bind for file server thread, thread ended.");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
delete ft;
return;
}
@@ -334,7 +334,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
WaitForSingleObject(hEvent, INFINITE);
}
Log("File sent, advancing to the next file...");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
}
CloseHandle(hEvent);
ft->hFileEvent = NULL;
@@ -349,14 +349,14 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
switch (ft->state) {
case FT_DONE:
Log("Finish successfully");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft, 0);
break;
case FT_DENIED:
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, ft, 0);
break;
default: // FT_ERROR:
Log("Finish with errors");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
break;
}
@@ -446,7 +446,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer,
}
ft->std.currentFileProgress += numRead;
ft->std.totalProgress += numRead;
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
}
_close(fileId);
if (ft->state != FT_ERROR)
@@ -483,7 +483,7 @@ filetransfer::~filetransfer()
ppro->Log("Destroying file transfer session %08p", this);
if ( !bCompleted)
- ppro->JSendBroadcast(std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, this, 0);
+ ppro->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, this, 0);
close();
@@ -520,7 +520,7 @@ void filetransfer::complete()
close();
bCompleted = true;
- ppro->JSendBroadcast(std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this, 0);
+ ppro->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this, 0);
}
int filetransfer::create()
@@ -536,7 +536,7 @@ int filetransfer::create()
CloseHandle(hWaitEvent);
hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (ppro->JSendBroadcast(std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, this, (LPARAM)&std))
+ if (ppro->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, this, (LPARAM)&std))
WaitForSingleObject(hWaitEvent, INFINITE);
if (fileId == -1) {
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index 07abacdf60..b6075c4867 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -50,7 +50,7 @@ void CJabberProto::FtCancel(filetransfer *ft)
if (item->ft == ft) {
Log("Canceling file receiving session while in si negotiation");
ListRemoveByIndex(i);
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
delete ft;
return;
}
@@ -87,7 +87,7 @@ void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft)
if (jid==NULL || ft==NULL || !m_bJabberOnline || (rs=ListGetBestClientResourceNamePtr(jid))==NULL) {
if (ft) {
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
delete ft;
}
return;
@@ -171,7 +171,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo* pInfo)
} } } } } } }
else {
Log("File transfer stream initiation request denied or failed");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR ? ACKRESULT_DENIED : ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR ? ACKRESULT_DENIED : ACKRESULT_FAILED, ft, 0);
delete ft;
}
}
@@ -203,7 +203,7 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft)
}
ft->std.currentFileProgress += numRead;
ft->std.totalProgress += numRead;
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
}
mir_free(buffer);
}
@@ -264,7 +264,7 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
ft->std.currentFileProgress += numRead;
ft->std.totalProgress += numRead;
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
}
mir_free(buffer);
}
@@ -276,18 +276,18 @@ void CJabberProto::FtSendFinal(BOOL success, filetransfer *ft)
{
if ( !success) {
Log("File transfer complete with error");
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ft->state == FT_DENIED ? ACKRESULT_DENIED : ACKRESULT_FAILED, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ft->state == FT_DENIED ? ACKRESULT_DENIED : ACKRESULT_FAILED, ft, 0);
}
else {
if (ft->std.currentFileNumber < ft->std.totalFiles-1) {
ft->std.currentFileNumber++;
replaceStrT(ft->std.tszCurrentFile, ft->std.ptszFiles[ ft->std.currentFileNumber ]);
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
FtInitiate(ft->jid, ft);
return;
}
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft, 0);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft, 0);
}
delete ft;
@@ -532,7 +532,7 @@ int CJabberProto::FtReceive(HANDLE, filetransfer *ft, char* buffer, int datalen)
ft->std.currentFileProgress += writeSize;
ft->std.totalProgress += writeSize;
- JSendBroadcast(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
return (ft->std.currentFileSize == ft->std.currentFileProgress) ? 0 : writeSize;
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 104470416d..85eda703ff 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -267,7 +267,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode)
TCHAR text[128];
mir_sntprintf(text, SIZEOF(text), _T("%s %s."), TranslateT("Authentication failed for"), m_ThreadInfo->username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
} }
@@ -296,7 +296,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode)
m_ThreadInfo->send("</stream:stream>");
mir_sntprintf(text, SIZEOF(text), _T("%s %s."), TranslateT("Authentication failed for"), m_ThreadInfo->username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
} }
@@ -745,13 +745,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
jsr.hdr.email = sttGetText(vCardNode, "EMAIL");
_tcsncpy(jsr.jid, jid, SIZEOF(jsr.jid));
jsr.jid[ SIZEOF(jsr.jid)-1 ] = '\0';
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
else if ( !lstrcmp(type, _T("error")))
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ else ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
@@ -1187,13 +1187,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
}
else {
if ((hContact = HContactFromJID(jid)) != NULL)
- JSendBroadcast(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
WindowNotify(WM_JABBER_REFRESH_VCARD);
}
}
else if ( !lstrcmp(type, _T("error"))) {
if ((hContact = HContactFromJID(jid)) != NULL)
- JSendBroadcast(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
}
}
@@ -1248,13 +1248,13 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode)
else
jsr.hdr.email = _T("");
jsr.hdr.flags = PSR_TCHAR;
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
} } }
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
else if ( !lstrcmp(type, _T("error")))
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
void CJabberProto::OnIqResultExtSearch(HXML iqNode)
@@ -1315,13 +1315,13 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode)
jsr.hdr.email = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
}
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
}
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
else if ( !lstrcmp(type, _T("error")))
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
void CJabberProto::OnIqResultSetPassword(HXML iqNode)
@@ -1373,7 +1373,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode)
if ( !JGetStringT(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
JDeleteSetting(hContact, "AvatarSaved");
- JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
return;
@@ -1537,10 +1537,10 @@ LBL_ErrFormat:
fwrite(body, resultLen, 1, out);
fclose(out);
JSetString(hContact, "AvatarSaved", buffer);
- JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&AI), NULL);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&AI), NULL);
Log("Broadcast new avatar: %s",AI.filename);
}
- else JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&AI), NULL);
+ else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&AI), NULL);
mir_free(body);
}
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp
index 414e5a5d12..ddcf44d60b 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -37,7 +37,7 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData *pThreadData, CJabberMes
TCHAR *szErrText = JabberErrorMsg(pInfo->GetChildNode());
if (id != -1) {
char *errText = mir_t2a(szErrText);
- JSendBroadcast(pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)errText);
+ ProtoBroadcastAck(pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)errText);
mir_free(errText);
} else {
TCHAR buf[512];
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 935662d9f6..1829f58653 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -383,7 +383,7 @@ void CJabberProto::SetServerStatus(int iNewStatus)
// send presence update
SendPresence(m_iStatus, true);
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}
// Process a string, and double all % characters, according to chat.dll's restrictions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 920a5454d6..4de089e843 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -838,8 +838,8 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
_tcsncpy(jsr.jid, jsb->jid, SIZEOF(jsr.jid));
jsr.jid[SIZEOF(jsr.jid)-1] = '\0';
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)jsb->hSearch, (LPARAM)&jsr);
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)jsb->hSearch, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)jsb->hSearch, (LPARAM)&jsr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)jsb->hSearch, 0);
mir_free(jsb);
}
@@ -1138,7 +1138,7 @@ void __cdecl CJabberProto::SendMessageAckThread(void* param)
TFakeAckParams *par = (TFakeAckParams*)param;
Sleep(100);
Log("Broadcast ACK");
- JSendBroadcast(par->hContact, ACKTYPE_MESSAGE,
+ ProtoBroadcastAck(par->hContact, ACKTYPE_MESSAGE,
par->msg ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
(HANDLE)par->msgid, (LPARAM) par->msg);
Log("Returning from thread");
@@ -1327,12 +1327,12 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus)
}
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}
else if (!m_ThreadInfo && !(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
m_iStatus = ID_STATUS_CONNECTING;
ThreadData* thread = new ThreadData(this, JABBER_SESSION_NORMAL);
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
thread->hThread = JForkThreadEx((JThreadFunc)&CJabberProto::ServerThread, thread);
RebuildInfoFrame();
@@ -1340,7 +1340,7 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus)
else if (m_bJabberOnline)
SetServerStatus(iNewStatus);
else
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
return 0;
}
@@ -1382,19 +1382,19 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
_tcscat(str, r[i].statusMessage);
}
- JSendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)str);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)str);
return;
}
if (item->itemResource.statusMessage != NULL) {
- JSendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)item->itemResource.statusMessage);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)item->itemResource.statusMessage);
return;
}
}
else db_free(&dbv);
}
- JSendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0);
}
HANDLE __cdecl CJabberProto::GetAwayMsg(HANDLE hContact)
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 97093aefdf..c07c79dd1e 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -806,7 +806,7 @@ struct CJabberProto : public PROTO_INTERFACE
TCHAR *JGetStringT(HANDLE hContact, char* valueName, TCHAR *buf, int size);
WORD JGetWord(HANDLE hContact, const char* valueName, int parDefltValue);
void JHookEvent(const char*, JEventFunc);
- int JSendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
+ void JLoginFailed(int errorCode);
DWORD JSetByte(HANDLE hContact, const char* valueName, int parValue);
DWORD JSetDword(HANDLE hContact, const char* valueName, DWORD parValue);
DWORD JSetString(HANDLE hContact, const char* valueName, const char* parValue);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 89949345da..a3fb0ec390 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -244,7 +244,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
}
Results.jsr.hdr.cbSize = 0; // sending column names
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM) &Results);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM) &Results);
/* Sending Users Data */
Results.jsr.hdr.cbSize = sizeof(Results.jsr); // sending user data
@@ -275,7 +275,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
Results.jsr.hdr.nick = nick ? buff : NULL;
Results.jsr.hdr.flags = PSR_TCHAR;
}
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM) &Results);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM) &Results);
Results.jsr.hdr.nick=NULL;
}
@@ -304,7 +304,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode)
LIST<void> SearchResults(2);
if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
@@ -378,7 +378,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode)
}
_sntprintf(buff,SIZEOF(buff),TranslateT("Error %s %s\r\nTry to specify more detailed"),code ? code : _T(""),description?description:_T(""));
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
if (searchHandleDlg)
SetDlgItemText(searchHandleDlg,IDC_INSTRUCTIONS,buff);
else
@@ -392,7 +392,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode)
delete ((U_TCHAR_MAP *)SearchResults[i]);
//send success to finish searching
- JSendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
static BOOL CALLBACK DeleteChildWindowsProc(HWND hwnd, LPARAM)
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp
index 0c1a6625e1..559950cace 100644
--- a/protocols/JabberG/src/jabber_std.cpp
+++ b/protocols/JabberG/src/jabber_std.cpp
@@ -140,22 +140,12 @@ WORD CJabberProto::JGetWord(HANDLE hContact, const char* valueName, int parDeflt
return db_get_w(hContact, m_szModuleName, valueName, parDefltValue);
}
-int CJabberProto::JSendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
-{
- // clear saved passowrd on login error. ugly hack, but at least this is centralized
- if (type == ACKTYPE_LOGIN && (lParam == LOGINERR_WRONGPASSWORD || lParam == LOGINERR_BADUSERID))
- *m_savedPassword = 0;
-
- 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);
+void CJabberProto::JLoginFailed(int errorCode)
+{
+ *m_savedPassword = 0;
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, errorCode);
}
+
/*
DWORD CJabberProto::JSetByte(const char* valueName, int parValue)
{
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 287e489816..935f3d4e93 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -306,12 +306,12 @@ LBL_Exit:
if (*rtrimt(info->username) == '\0') {
Log("Thread ended, login name is not configured");
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
+ JLoginFailed(LOGINERR_BADUSERID);
LBL_FatalError:
m_ThreadInfo = NULL;
oldStatus = m_iStatus;
m_iDesiredStatus = m_iStatus = ID_STATUS_OFFLINE;
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
goto LBL_Exit;
}
@@ -320,7 +320,7 @@ LBL_FatalError:
db_free(&dbv);
}
else {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
Log("Thread ended, login server is not configured");
goto LBL_FatalError;
}
@@ -359,7 +359,7 @@ LBL_FatalError:
CloseHandle(param.hEventPasswdDlg);
if (param.dlgResult == IDCANCEL) {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
+ JLoginFailed(LOGINERR_BADUSERID);
Log("Thread ended, password request dialog was canceled");
goto LBL_FatalError;
}
@@ -374,7 +374,7 @@ LBL_FatalError:
else {
TCHAR *passw = JGetStringCrypt(NULL, "LoginPassword");
if (passw == NULL) {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
+ JLoginFailed(LOGINERR_BADUSERID);
Log("Thread ended, password is not configured");
goto LBL_FatalError;
}
@@ -402,7 +402,7 @@ LBL_FatalError:
if ((buffer=(char*)mir_alloc(jabberNetworkBufferSize + 1)) == NULL) { // +1 is for '\0' when debug logging this buffer
Log("Cannot allocate network buffer, thread ended");
if (info->type == JABBER_SESSION_NORMAL) {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
}
else if (info->type == JABBER_SESSION_REGISTER) {
SendMessage(info->reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Error: Not enough memory"));
@@ -426,7 +426,7 @@ LBL_FatalError:
Log("Connection failed (%d)", WSAGetLastError());
if (info->type == JABBER_SESSION_NORMAL) {
if (m_ThreadInfo == info) {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
} }
else if (info->type == JABBER_SESSION_REGISTER)
SendMessage(info->reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Error: Cannot connect to the server"));
@@ -442,7 +442,7 @@ LBL_FatalError:
if ( !CallService(MS_NETLIB_STARTSSL, (WPARAM)info->s, 0)) {
Log("SSL intialization failed");
if (info->type == JABBER_SESSION_NORMAL) {
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
}
else if (info->type == JABBER_SESSION_REGISTER) {
SendMessage(info->reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Error: Cannot connect to the server"));
@@ -590,7 +590,7 @@ recvRest:
// Set status to offline
oldStatus = m_iStatus;
m_iDesiredStatus = m_iStatus = ID_STATUS_OFFLINE;
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
// Set all contacts to offline
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
@@ -609,7 +609,7 @@ recvRest:
else if (info->type == JABBER_SESSION_NORMAL) {
oldStatus = m_iStatus;
m_iDesiredStatus = m_iStatus = ID_STATUS_OFFLINE;
- JSendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}
Log("Thread ended: type=%d server='%s'", info->type, info->server);
@@ -737,7 +737,7 @@ void CJabberProto::PerformAuthentication(ThreadData* info)
TCHAR text[1024];
mir_sntprintf(text, SIZEOF(text), _T("%s %s@%S."), TranslateT("Authentication failed for"), info->username, info->server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
+ JLoginFailed(LOGINERR_WRONGPASSWORD);
info->send("</stream:stream>");
m_ThreadInfo = NULL;
return;
@@ -885,7 +885,7 @@ void CJabberProto::OnProcessError(HXML node, ThreadData* info)
pos += mir_sntprintf(buff+pos, 1024-pos, _T("%s\r\n"), name);
if ( !_tcscmp(name, _T("conflict")))
- JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
else if ( !_tcscmp(name, _T("see-other-host"))) {
skipMsg = true;
}
@@ -1221,7 +1221,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
if (nPacketId == -1)
nPacketId = JabberGetPacketID(node);
if (nPacketId != -1)
- JSendBroadcast(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)nPacketId, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)nPacketId, 0);
}
JabberReadXep203delay(node, msgTime);
@@ -1327,7 +1327,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
id = _ttoi((xmlGetText(idNode))+strlen(JABBER_IQID));
if (id != -1)
- JSendBroadcast(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
if (hContact && xmlGetChild(xNode , "composing") != NULL)
@@ -1686,7 +1686,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
int result = JGetStringT(hContact, "AvatarSaved", &dbv);
if (result || lstrcmp(dbv.ptszVal, xmlGetText(xNode))) {
Log("Avatar was changed");
- JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
} else Log("Not broadcasting avatar changed");
if ( !result) db_free(&dbv);
} else {
@@ -1708,7 +1708,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
int result = JGetStringT(hContact, "AvatarSaved", &dbv);
if (result || lstrcmp(dbv.ptszVal, txt)) {
Log("Avatar was changed. Using vcard-temp:x:update");
- JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
}
else Log("Not broadcasting avatar changed");
if ( !result) db_free(&dbv);
@@ -1723,7 +1723,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
if ( !JGetStringT(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
JDeleteSetting(hContact, "AvatarSaved");
- JSendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
} } }
return;
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index e5f875bb3f..d6895cc6cb 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -1801,10 +1801,10 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
fwrite(res->pData, res->dataLength, 1, out);
fclose(out);
JSetString(AI.hContact, "AvatarSaved", buffer);
- JSendBroadcast(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
+ ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
Log("Broadcast new avatar: %s",AI.filename);
}
- else JSendBroadcast(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
+ else ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
}
}
}
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();
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp
index 999ef0c3a6..552eed7a96 100644
--- a/protocols/Yahoo/src/file_transfer.cpp
+++ b/protocols/Yahoo/src/file_transfer.cpp
@@ -319,7 +319,7 @@ static void dl_file(int id, int fd, int error, const char *filename, unsigned lo
ResetEvent(sf->hWaitEvent);
- if ( sf->ppro->SendBroadcast( sf->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, sf, (LPARAM)&sf->pfts )) {
+ if ( sf->ppro->ProtoBroadcastAck( sf->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, sf, (LPARAM)&sf->pfts )) {
WaitForSingleObject( sf->hWaitEvent, INFINITE );
LOG(("[dl_file] Got action: %ld", sf->action));
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index fd6344131a..9971a8a0f6 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -583,7 +583,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
FREE(sm);
- SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, (LPARAM)( TCHAR* )_A2T(fm));
+ ProtoBroadcastAck( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, (LPARAM)( TCHAR* )_A2T(fm));
}
HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact )
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h
index 0f472c4483..4aa8ddc86f 100644
--- a/protocols/Yahoo/src/proto.h
+++ b/protocols/Yahoo/src/proto.h
@@ -265,8 +265,6 @@ struct CYahooProto : public PROTO_INTERFACE
DWORD Set_Protocol( HANDLE hContact, int protocol );
- int SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam );
-
int ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags);
void ShowError(const TCHAR *title, const TCHAR *buff);
int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL );
diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp
index e36439bc2c..9d9b53b892 100644
--- a/protocols/Yahoo/src/search.cpp
+++ b/protocols/Yahoo/src/search.cpp
@@ -25,7 +25,7 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch)
TCHAR *id = (TCHAR *) snsearch;
if (lstrlen(id) < 4) {
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
}
@@ -39,11 +39,11 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch)
psr.id = (TCHAR*)_tcslwr(id);
psr.reserved[0] = YAHOO_IM_YAHOO;
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
//yahoo_search(m_id, YAHOO_SEARCH_YID, m, YAHOO_GENDER_NONE, YAHOO_AGERANGE_NONE, 0, 1);
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
HANDLE __cdecl CYahooProto::SearchBasic( const TCHAR* nick )
@@ -107,7 +107,7 @@ void CYahooProto::ext_got_search_result(int found, int start, int total, YList *
//void yahoo_search(int id, enum yahoo_search_type t, const char *text, enum yahoo_search_gender g, enum yahoo_search_agerange ar,
// int photo, int yahoo_only)
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
mir_free(psr.id);
mir_free(psr.firstName);
@@ -115,7 +115,7 @@ void CYahooProto::ext_got_search_result(int found, int start, int total, YList *
}
en = y_list_next(en);
}
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
/*
@@ -158,7 +158,7 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND)
GetDlgItemText(hwndDlg, IDC_SEARCH_ID, searchid, 128);
if (lstrlen(searchid) == 0) {
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
}
@@ -181,12 +181,12 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND)
/*
* Show this in results
*/
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM) & psr);
/*
* Done searching.
*/
- SendBroadcast(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
/*
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index a022d3e598..e4e4511cd4 100644
--- a/protocols/Yahoo/src/util.cpp
+++ b/protocols/Yahoo/src/util.cpp
@@ -153,18 +153,6 @@ DWORD CYahooProto::Set_Protocol( HANDLE hContact, int protocol )
return 0;
}
-int CYahooProto::SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
-{
- ACKDATA ack = { 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);
-}
-
int CYahooProto::GetString(const char* name, DBVARIANT* result)
{ return db_get_s(NULL, m_szModuleName, name, result);
}
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp
index e3d6f0405f..2f474c8c37 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -1002,7 +1002,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt)
}
m_unreadMessages = cnt;
- SendBroadcast( NULL, ACKTYPE_EMAIL, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck( NULL, ACKTYPE_EMAIL, ACKRESULT_STATUS, NULL, 0);
}
void CYahooProto::ext_system_message(const char *me, const char *who, const char *msg)