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/JabberG/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/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_disco.cpp | 63 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_file.cpp | 26 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 18 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 34 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_message_handlers.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_misc.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 18 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_search.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_std.cpp | 20 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 34 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 4 |
12 files changed, 109 insertions, 124 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);
}
}
}
|