summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r--protocols/IcqOscarJ/src/capabilities.cpp2
-rw-r--r--protocols/IcqOscarJ/src/chan_01login.cpp12
-rw-r--r--protocols/IcqOscarJ/src/chan_02data.cpp10
-rw-r--r--protocols/IcqOscarJ/src/chan_03error.cpp2
-rw-r--r--protocols/IcqOscarJ/src/chan_04close.cpp14
-rw-r--r--protocols/IcqOscarJ/src/chan_05ping.cpp6
-rw-r--r--protocols/IcqOscarJ/src/fam_01service.cpp76
-rw-r--r--protocols/IcqOscarJ/src/fam_02location.cpp12
-rw-r--r--protocols/IcqOscarJ/src/fam_03buddy.cpp52
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp240
-rw-r--r--protocols/IcqOscarJ/src/fam_09bos.cpp8
-rw-r--r--protocols/IcqOscarJ/src/fam_0alookup.cpp8
-rw-r--r--protocols/IcqOscarJ/src/fam_0bstatus.cpp4
-rw-r--r--protocols/IcqOscarJ/src/fam_13servclist.cpp194
-rw-r--r--protocols/IcqOscarJ/src/fam_15icqserver.cpp100
-rw-r--r--protocols/IcqOscarJ/src/fam_17signon.cpp10
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp185
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.h34
-rw-r--r--protocols/IcqOscarJ/src/icq_clients.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_db.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_infoupdate.cpp26
-rw-r--r--protocols/IcqOscarJ/src/icq_packet.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp32
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h3
-rw-r--r--protocols/IcqOscarJ/src/icq_rates.cpp18
-rw-r--r--protocols/IcqOscarJ/src/icq_server.cpp20
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp118
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_xtraz.cpp30
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp4
-rw-r--r--protocols/IcqOscarJ/src/init.cpp4
-rw-r--r--protocols/IcqOscarJ/src/log.cpp2
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp50
-rw-r--r--protocols/IcqOscarJ/src/stdpackets.cpp8
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp29
36 files changed, 649 insertions, 684 deletions
diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp
index 4c374ed492..e1b8b47a94 100644
--- a/protocols/IcqOscarJ/src/capabilities.cpp
+++ b/protocols/IcqOscarJ/src/capabilities.cpp
@@ -96,7 +96,7 @@ void NetLog_CapabilityChange(CIcqProto *ppro, const char *szChange, DWORD fdwCap
}
}
// Log the change
- ppro->NetLog_Server("Capabilities: %s %s", szChange, szBuffer);
+ ppro->debugLogA("Capabilities: %s %s", szChange, szBuffer);
}
#endif
diff --git a/protocols/IcqOscarJ/src/chan_01login.cpp b/protocols/IcqOscarJ/src/chan_01login.cpp
index 3c4c4febc6..b8444f228e 100644
--- a/protocols/IcqOscarJ/src/chan_01login.cpp
+++ b/protocols/IcqOscarJ/src/chan_01login.cpp
@@ -35,7 +35,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
icq_packet packet;
#ifdef _DEBUG
- NetLog_Server("Received SRV_HELLO from %s", info->isLoginServer ? "login server" : "communication server");
+ debugLogA("Received SRV_HELLO from %s", info->isLoginServer ? "login server" : "communication server");
#endif
// isLoginServer is "1" if we just received SRV_HELLO
@@ -47,7 +47,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
WORD wUinLen;
#ifdef _DEBUG
- NetLog_Server("Sending %s to %s", "CLI_HELLO", "login server");
+ debugLogA("Sending %s to %s", "CLI_HELLO", "login server");
#endif
packet.wLen = 12;
write_flap(&packet, ICQ_LOGIN_CHAN);
@@ -57,7 +57,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
wUinLen = strlennull(strUID(m_dwLocalUIN, szUin));
#ifdef _DEBUG
- NetLog_Server("Sending %s to %s", "ICQ_SIGNON_AUTH_REQUEST", "login server");
+ debugLogA("Sending %s to %s", "ICQ_SIGNON_AUTH_REQUEST", "login server");
#endif
serverPacketInit(&packet, (WORD)(14 + wUinLen));
@@ -69,7 +69,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
{
sendClientAuth((char*)info->szAuthKey, info->wAuthKeyLen, FALSE);
#ifdef _DEBUG
- NetLog_Server("Sent CLI_IDENT to %s", "login server");
+ debugLogA("Sent CLI_IDENT to %s", "login server");
#endif
}
@@ -90,7 +90,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
sendServPacket(&packet);
#ifdef _DEBUG
- NetLog_Server("Sent CLI_IDENT to %s", "communication server");
+ debugLogA("Sent CLI_IDENT to %s", "communication server");
#endif
SAFE_FREE((void**)&info->cookieData);
@@ -99,7 +99,7 @@ void CIcqProto::handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *i
else
{
// We need a cookie to identify us to the communication server
- NetLog_Server("Error: Connected to %s without a cookie!", "communication server");
+ debugLogA("Error: Connected to %s without a cookie!", "communication server");
}
}
}
diff --git a/protocols/IcqOscarJ/src/chan_02data.cpp b/protocols/IcqOscarJ/src/chan_02data.cpp
index d55e0262e9..2c40d0902b 100644
--- a/protocols/IcqOscarJ/src/chan_02data.cpp
+++ b/protocols/IcqOscarJ/src/chan_02data.cpp
@@ -36,15 +36,15 @@ void CIcqProto::handleDataChannel(BYTE *pBuffer, WORD wBufferLength, serverthrea
if (!unpackSnacHeader(&snacHeader, &pBuffer, &wBufferLength) || !snacHeader.bValid)
{
- NetLog_Server("Error: Failed to parse SNAC header");
+ debugLogA("Error: Failed to parse SNAC header");
}
else
{
#ifdef _DEBUG
if (snacHeader.wFlags & 0x8000)
- NetLog_Server(" Received SNAC(x%02X,x%02X), version %u", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wVersion);
+ debugLogA(" Received SNAC(x%02X,x%02X), version %u", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wVersion);
else
- NetLog_Server(" Received SNAC(x%02X,x%02X)", snacHeader.wFamily, snacHeader.wSubtype);
+ debugLogA(" Received SNAC(x%02X,x%02X)", snacHeader.wFamily, snacHeader.wSubtype);
#endif
switch (snacHeader.wFamily) {
@@ -90,7 +90,7 @@ void CIcqProto::handleDataChannel(BYTE *pBuffer, WORD wBufferLength, serverthrea
break;
default:
- NetLog_Server("Ignoring SNAC(x%02X,x%02X) - FAMILYx%02X not implemented", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wFamily);
+ debugLogA("Ignoring SNAC(x%02X,x%02X) - FAMILYx%02X not implemented", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wFamily);
break;
}
@@ -218,5 +218,5 @@ void CIcqProto::LogFamilyError(WORD wFamily, WORD wError)
default: msg = ""; break;
}
- NetLog_Server("SNAC(x%02X,x01) - Error(%u): %s", wFamily, wError, msg);
+ debugLogA("SNAC(x%02X,x01) - Error(%u): %s", wFamily, wError, msg);
}
diff --git a/protocols/IcqOscarJ/src/chan_03error.cpp b/protocols/IcqOscarJ/src/chan_03error.cpp
index 71c6e2ea7c..a4119f2aa9 100644
--- a/protocols/IcqOscarJ/src/chan_03error.cpp
+++ b/protocols/IcqOscarJ/src/chan_03error.cpp
@@ -31,5 +31,5 @@
void CIcqProto::handleErrorChannel(unsigned char* buf, WORD datalen)
{
- NetLog_Server("Ignoring server packet on ERROR channel");
+ debugLogA("Ignoring server packet on ERROR channel");
}
diff --git a/protocols/IcqOscarJ/src/chan_04close.cpp b/protocols/IcqOscarJ/src/chan_04close.cpp
index 8158e2767c..0eb714feae 100644
--- a/protocols/IcqOscarJ/src/chan_04close.cpp
+++ b/protocols/IcqOscarJ/src/chan_04close.cpp
@@ -85,7 +85,7 @@ void CIcqProto::handleLoginReply(BYTE *buf, WORD datalen, serverthread_info *inf
if (!(chain = readIntoTLVChain(&buf, datalen, 0)))
{
- NetLog_Server("Error: Missing chain on close channel");
+ debugLogA("Error: Missing chain on close channel");
NetLib_CloseConnection(&hServerConn, TRUE);
return; // Invalid data
}
@@ -129,7 +129,7 @@ void CIcqProto::handleLoginReply(BYTE *buf, WORD datalen, serverthread_info *inf
return; // Failure
}
- NetLog_Server("Authenticated.");
+ debugLogA("Authenticated.");
info->newServerReady = 1;
return;
@@ -154,9 +154,9 @@ int CIcqProto::connectNewServer(serverthread_info *info)
NetLib_SafeCloseHandle(&info->hPacketRecver);
NetLib_CloseConnection(&hServerConn, TRUE);
- NetLog_Server("Closed connection to login server");
+ debugLogA("Closed connection to login server");
- hServerConn = NetLib_OpenConnection(m_hServerNetlibUser, NULL, &nloc);
+ hServerConn = NetLib_OpenConnection(m_hNetlibUser, NULL, &nloc);
if (hServerConn && info->newServerSSL)
{ /* Start SSL session if requested */
if (!CallService(MS_NETLIB_STARTSSL, (WPARAM)hServerConn, 0))
@@ -169,7 +169,7 @@ int CIcqProto::connectNewServer(serverthread_info *info)
info->hPacketRecver = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER, (WPARAM)hServerConn, 0x2400);
if (!info->hPacketRecver)
{
- NetLog_Server("Error: Failed to create packet receiver.");
+ debugLogA("Error: Failed to create packet receiver.");
}
else // we need to reset receiving structs
{
@@ -180,7 +180,7 @@ int CIcqProto::connectNewServer(serverthread_info *info)
}
else
{ // TODO: We should really do some checks here
- NetLog_Server("Walking in Gateway to %s", info->newServer);
+ debugLogA("Walking in Gateway to %s", info->newServer);
// TODO: This REQUIRES more work (most probably some kind of mid-netlib module)
icq_httpGatewayWalkTo(hServerConn, &nloc);
res = 1;
@@ -198,7 +198,7 @@ int CIcqProto::connectNewServer(serverthread_info *info)
void CIcqProto::handleMigration(serverthread_info *info)
{
// Check the data that was saved when the migration was announced
- NetLog_Server("Migrating to %s", info->newServer);
+ debugLogA("Migrating to %s", info->newServer);
if (!info->newServer || !info->cookieData)
{
icq_LogMessage(LOG_FATAL, LPGEN("You have been disconnected from the ICQ network because the current server shut down."));
diff --git a/protocols/IcqOscarJ/src/chan_05ping.cpp b/protocols/IcqOscarJ/src/chan_05ping.cpp
index e74071dc4b..7bb06d9a43 100644
--- a/protocols/IcqOscarJ/src/chan_05ping.cpp
+++ b/protocols/IcqOscarJ/src/chan_05ping.cpp
@@ -32,7 +32,7 @@
void CIcqProto::handlePingChannel(BYTE *buf, WORD datalen)
{
- NetLog_Server("Warning: Ignoring server packet on PING channel");
+ debugLogA("Warning: Ignoring server packet on PING channel");
}
@@ -42,7 +42,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg)
icq_packet packet;
DWORD dwInterval = getDword("KeepAliveInterval", KEEPALIVE_INTERVAL);
- NetLog_Server("Keep alive thread starting.");
+ debugLogA("Keep alive thread starting.");
info->hKeepAliveEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
@@ -65,7 +65,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg)
break;
}
- NetLog_Server("Keep alive thread ended.");
+ debugLogA("Keep alive thread ended.");
CloseHandle(info->hKeepAliveEvent);
info->hKeepAliveEvent = NULL;
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp
index 3e5c091ea8..1bba5e3149 100644
--- a/protocols/IcqOscarJ/src/fam_01service.cpp
+++ b/protocols/IcqOscarJ/src/fam_01service.cpp
@@ -40,8 +40,8 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
case ICQ_SERVER_READY:
#ifdef _DEBUG
- NetLog_Server("Server is ready and is requesting my Family versions");
- NetLog_Server("Sending my Families");
+ debugLogA("Server is ready and is requesting my Family versions");
+ debugLogA("Sending my Families");
#endif
// This packet is a response to SRV_FAMILIES SNAC(1,3).
@@ -69,8 +69,8 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
/* This is a reply to CLI_FAMILIES and it tells the client which families and their versions that this server understands.
* We send a rate request packet */
#ifdef _DEBUG
- NetLog_Server("Server told me his Family versions");
- NetLog_Server("Requesting Rate Information");
+ debugLogA("Server told me his Family versions");
+ debugLogA("Requesting Rate Information");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_SERVICE_FAMILY, ICQ_CLIENT_REQ_RATE_INFO);
@@ -79,20 +79,20 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
case ICQ_SERVER_RATE_INFO:
#ifdef _DEBUG
- NetLog_Server("Server sent Rate Info");
+ debugLogA("Server sent Rate Info");
#endif
/* init rates management */
m_rates = new rates(this, pBuffer, wBufferLength);
/* ack rate levels */
#ifdef _DEBUG
- NetLog_Server("Sending Rate Info Ack");
+ debugLogA("Sending Rate Info Ack");
#endif
m_rates->initAckPacket(&packet);
sendServPacket(&packet);
/* CLI_REQINFO - This command requests from the server certain information about the client that is stored on the server. */
#ifdef _DEBUG
- NetLog_Server("Sending CLI_REQINFO");
+ debugLogA("Sending CLI_REQINFO");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_SERVICE_FAMILY, ICQ_CLIENT_REQINFO);
@@ -108,7 +108,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// CLI_REQLISTS - we want to use SSI
#ifdef _DEBUG
- NetLog_Server("Requesting roster rights");
+ debugLogA("Requesting roster rights");
#endif
serverPacketInit(&packet, 16);
packFNACHeader(&packet, ICQ_LISTS_FAMILY, ICQ_LISTS_CLI_REQLISTS);
@@ -118,7 +118,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
if (!wRecordCount) // CLI_REQROSTER
{ // we do not have any data - request full list
#ifdef _DEBUG
- NetLog_Server("Requesting full roster");
+ debugLogA("Requesting full roster");
#endif
serverPacketInit(&packet, 10);
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
@@ -136,7 +136,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
else // CLI_CHECKROSTER
{
#ifdef _DEBUG
- NetLog_Server("Requesting roster check");
+ debugLogA("Requesting roster check");
#endif
serverPacketInit(&packet, 16);
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
@@ -166,7 +166,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// CLI_REQLOCATION
#ifdef _DEBUG
- NetLog_Server("Requesting Location rights");
+ debugLogA("Requesting Location rights");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_LOCATION_FAMILY, ICQ_LOCATION_CLI_REQ_RIGHTS);
@@ -174,7 +174,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// CLI_REQBUDDY
#ifdef _DEBUG
- NetLog_Server("Requesting Client-side contactlist rights");
+ debugLogA("Requesting Client-side contactlist rights");
#endif
serverPacketInit(&packet, 16);
packFNACHeader(&packet, ICQ_BUDDY_FAMILY, ICQ_USER_CLI_REQBUDDY);
@@ -187,7 +187,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// CLI_REQICBM
#ifdef _DEBUG
- NetLog_Server("Sending CLI_REQICBM");
+ debugLogA("Sending CLI_REQICBM");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_MSG_FAMILY, ICQ_MSG_CLI_REQICBM);
@@ -195,7 +195,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// CLI_REQBOS
#ifdef _DEBUG
- NetLog_Server("Sending CLI_REQBOS");
+ debugLogA("Sending CLI_REQBOS");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_BOS_FAMILY, ICQ_PRIVACY_REQ_RIGHTS);
@@ -203,7 +203,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
break;
case ICQ_SERVER_PAUSE:
- NetLog_Server("Server is going down in a few seconds... (Flags: %u)", pSnacHeader->wFlags);
+ debugLogA("Server is going down in a few seconds... (Flags: %u)", pSnacHeader->wFlags);
// This is the list of groups that we want to have on the next server
serverPacketInit(&packet, 30);
packFNACHeader(&packet, ICQ_SERVICE_FAMILY, ICQ_CLIENT_PAUSE_ACK);
@@ -219,14 +219,14 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
packWord(&packet,ICQ_STATS_FAMILY);
sendServPacket(&packet);
#ifdef _DEBUG
- NetLog_Server("Sent server pause ack");
+ debugLogA("Sent server pause ack");
#endif
break;
case ICQ_SERVER_MIGRATIONREQ:
{
#ifdef _DEBUG
- NetLog_Server("Server migration requested (Flags: %u)", pSnacHeader->wFlags);
+ debugLogA("Server migration requested (Flags: %u)", pSnacHeader->wFlags);
#endif
pBuffer += 2; // Unknown, seen: 0
wBufferLength -= 2;
@@ -253,7 +253,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
return;
}
- NetLog_Server("Migration has started. New server will be %s", info->newServer);
+ debugLogA("Migration has started. New server will be %s", info->newServer);
m_iDesiredStatus = m_iStatus;
SetCurrentStatus(ID_STATUS_CONNECTING); // revert to connecting state
@@ -269,7 +269,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
oscar_tlv_chain *chain;
#ifdef _DEBUG
- NetLog_Server("Received self info");
+ debugLogA("Received self info");
#endif
unpackByte(&pBuffer, &bUinLen);
pBuffer += bUinLen;
@@ -336,14 +336,14 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
{ // this is only the simplest solution, needs rate management to every section
ProtoBroadcastAck(NULL, ICQACKTYPE_RATEWARNING, ACKRESULT_STATUS, (HANDLE)wClass, wStatus);
if (wStatus == 2)
- NetLog_Server("Rates #%u: Alert", wClass);
+ debugLogA("Rates #%u: Alert", wClass);
else
- NetLog_Server("Rates #%u: Limit", wClass);
+ debugLogA("Rates #%u: Limit", wClass);
}
else if (wStatus == 4)
{
ProtoBroadcastAck(NULL, ICQACKTYPE_RATEWARNING, ACKRESULT_STATUS, (HANDLE)wClass, wStatus);
- NetLog_Server("Rates #%u: Clear", wClass);
+ debugLogA("Rates #%u: Clear", wClass);
}
}
@@ -356,7 +356,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
if (!(pChain = readIntoTLVChain(&pBuffer, wBufferLength, 0)))
{
- NetLog_Server("Received Broken Redirect Service SNAC(1,5).");
+ debugLogA("Received Broken Redirect Service SNAC(1,5).");
break;
}
WORD wFamily = pChain->getWord(0x0D, 1);
@@ -365,7 +365,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
if ((!FindCookie(pSnacHeader->dwRef, NULL, (void**)&pCookieData)) || (pCookieData->wFamily != wFamily))
{
disposeChain(&pChain);
- NetLog_Server("Received unexpected SNAC(1,5), skipping.");
+ debugLogA("Received unexpected SNAC(1,5), skipping.");
break;
}
@@ -379,7 +379,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
if (!pServer || !pCookie)
{
- NetLog_Server("Server returned invalid data, family unavailable.");
+ debugLogA("Server returned invalid data, family unavailable.");
SAFE_FREE(&pServer);
SAFE_FREE(&pCookie);
@@ -399,20 +399,20 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
nloc.szHost = pServer;
nloc.wPort = wPort;
- HANDLE hConnection = NetLib_OpenConnection(m_hServerNetlibUser, wFamily == ICQ_AVATAR_FAMILY ? "Avatar " : NULL, &nloc);
+ HANDLE hConnection = NetLib_OpenConnection(m_hNetlibUser, wFamily == ICQ_AVATAR_FAMILY ? "Avatar " : NULL, &nloc);
if (hConnection == NULL)
{
- NetLog_Server("Unable to connect to ICQ new family server.");
+ debugLogA("Unable to connect to ICQ new family server.");
} // we want the handler to be called even if the connecting failed
else if (bServerSSL)
{ /* Start SSL session if requested */
#ifdef _DEBUG
- NetLog_Server("(%d) Starting SSL negotiation", CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0));
+ debugLogA("(%d) Starting SSL negotiation", CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0));
#endif
if (!CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0))
{
- NetLog_Server("Unable to connect to ICQ new family server, SSL could not be negotiated");
+ debugLogA("Unable to connect to ICQ new family server, SSL could not be negotiated");
NetLib_CloseConnection(&hConnection, FALSE);
}
}
@@ -432,7 +432,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
case ICQ_SERVER_EXTSTATUS: // our session data
{
#ifdef _DEBUG
- NetLog_Server("Received owner session data.");
+ debugLogA("Received owner session data.");
#endif
while (wBufferLength > 4)
{ // loop thru all items
@@ -443,13 +443,13 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
if (itemType == AVATAR_HASH_PHOTO) /// TODO: handle photo item
{ // skip photo item
#ifdef _DEBUG
- NetLog_Server("Photo item recognized");
+ debugLogA("Photo item recognized");
#endif
}
else if ((itemType == AVATAR_HASH_STATIC || itemType == AVATAR_HASH_FLASH) && (itemLen >= 0x10))
{
#ifdef _DEBUG
- NetLog_Server("Avatar item recognized");
+ debugLogA("Avatar item recognized");
#endif
if (m_bAvatarsEnabled && !info->bMyAvatarInited) // signal the server after login
{ // this refreshes avatar state - it used to work automatically, but now it does not
@@ -476,13 +476,13 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
else if (itemType == 0x02)
{
#ifdef _DEBUG
- NetLog_Server("Status message item recognized");
+ debugLogA("Status message item recognized");
#endif
}
else if (itemType == 0x0E)
{
#ifdef _DEBUG
- NetLog_Server("Status mood item recognized");
+ debugLogA("Status mood item recognized");
#endif
}
@@ -517,12 +517,12 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// Stuff we don't care about
case ICQ_SERVER_MOTD:
#ifdef _DEBUG
- NetLog_Server("Server message of the day");
+ debugLogA("Server message of the day");
#endif
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_SERVICE_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_SERVICE_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
@@ -925,7 +925,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info)
sendServPacket(&packet);
- NetLog_Server(" *** Yeehah, login sequence complete");
+ debugLogA(" *** Yeehah, login sequence complete");
// login sequence is complete enter logged-in mode
info->bLoggedIn = 1;
@@ -963,7 +963,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info)
icq_requestnewfamily(ICQ_AVATAR_FAMILY, &CIcqProto::StartAvatarThread);
m_avatarsConnectionPending = TRUE;
- NetLog_Server("Requesting Avatar family entry point.");
+ debugLogA("Requesting Avatar family entry point.");
}
// Set last xstatus
diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp
index 1913681070..e360b9dc8b 100644
--- a/protocols/IcqOscarJ/src/fam_02location.cpp
+++ b/protocols/IcqOscarJ/src/fam_02location.cpp
@@ -37,7 +37,7 @@ void CIcqProto::handleLocationFam(BYTE *pBuffer, WORD wBufferLength, snac_header
switch (pSnacHeader->wSubtype) {
case ICQ_LOCATION_RIGHTS_REPLY: // Reply to CLI_REQLOCATION
- NetLog_Server("Server sent SNAC(x02,x03) - SRV_LOCATION_RIGHTS_REPLY");
+ debugLogA("Server sent SNAC(x02,x03) - SRV_LOCATION_RIGHTS_REPLY");
break;
case ICQ_LOCATION_USR_INFO_REPLY: // AIM user info reply
@@ -71,7 +71,7 @@ void CIcqProto::handleLocationFam(BYTE *pBuffer, WORD wBufferLength, snac_header
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LOCATION_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LOCATION_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -132,20 +132,20 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie
if (hContact == INVALID_HANDLE_VALUE)
{
#ifdef _DEBUG
- NetLog_Server("Ignoring away reply (%s)", strUID(dwUIN, szUID));
+ debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID));
#endif
return;
}
if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData))
{
- NetLog_Server("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID));
+ debugLogA("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID));
return;
}
if (hContact != hCookieContact)
{
- NetLog_Server("Error: Away reply Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
+ debugLogA("Error: Away reply Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
@@ -225,7 +225,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie
status = AwayMsgTypeToStatus(pCookieData->nAckType);
if (status == ID_STATUS_OFFLINE)
{
- NetLog_Server("SNAC(2.6) Ignoring unknown status message from %s", strUID(dwUIN, szUID));
+ debugLogA("SNAC(2.6) Ignoring unknown status message from %s", strUID(dwUIN, szUID));
ReleaseCookie(dwCookie);
return;
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp
index 44c285c446..94f5e1c930 100644
--- a/protocols/IcqOscarJ/src/fam_03buddy.cpp
+++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp
@@ -66,7 +66,7 @@ void CIcqProto::handleBuddyFam(BYTE *pBuffer, WORD wBufferLength, snac_header *p
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_BUDDY_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_BUDDY_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -82,15 +82,15 @@ void CIcqProto::handleReplyBuddy(BYTE *buf, WORD wPackLen)
DWORD wMaxWatchers = pChain->getWord(2, 1);
DWORD wMaxTemporary = pChain->getWord(4, 1);
- NetLog_Server("MaxUINs %u", wMaxUins);
- NetLog_Server("MaxWatchers %u", wMaxWatchers);
- NetLog_Server("MaxTemporary %u", wMaxTemporary);
+ debugLogA("MaxUINs %u", wMaxUins);
+ debugLogA("MaxWatchers %u", wMaxWatchers);
+ debugLogA("MaxTemporary %u", wMaxTemporary);
disposeChain(&pChain);
}
else
{
- NetLog_Server("Error: Malformed BuddyReply");
+ debugLogA("Error: Malformed BuddyReply");
}
}
@@ -200,7 +200,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
if (hContact == INVALID_HANDLE_VALUE)
{
#ifdef _DEBUG
- NetLog_Server("Ignoring user online (%s)", strUID(dwUIN, szUID));
+ debugLogA("Ignoring user online (%s)", strUID(dwUIN, szUID));
#endif
return;
}
@@ -295,8 +295,8 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
}
#ifdef _DEBUG
- NetLog_Server("Flags are %x", wStatusFlags);
- NetLog_Server("Status is %x", wStatus);
+ debugLogA("Flags are %x", wStatusFlags);
+ debugLogA("Status is %x", wStatus);
#endif
// Get IP TLV
@@ -322,10 +322,10 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
#ifdef _DEBUG
if (wIdleTimer)
- NetLog_Server("Idle timer is %u.", wIdleTimer);
- NetLog_Server("Online since %s", time2text(dwOnlineSince));
+ debugLogA("Idle timer is %u.", wIdleTimer);
+ debugLogA("Online since %s", time2text(dwOnlineSince));
if (dwAwaySince)
- NetLog_Server("Status was set on %s", time2text(dwAwaySince));
+ debugLogA("Status was set on %s", time2text(dwAwaySince));
#endif
// Check client capabilities
@@ -396,7 +396,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
}
}
#ifdef _DEBUG
- NetLog_Server("Detected %d capability items.", capLen / BINARY_CAP_SIZE);
+ debugLogA("Detected %d capability items.", capLen / BINARY_CAP_SIZE);
#endif
}
@@ -417,7 +417,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
ClearAllContactCapabilities(hContact);
// no capability
- NetLog_Server("No capability info TLVs");
+ debugLogA("No capability info TLVs");
szClient = detectUserClient(hContact, nIsICQ, wClass, dwOnlineSince, NULL, wVersion, dwFT1, dwFT2, dwFT3, nTCPFlag, dwDirectConnCookie, dwWebPort, NULL, capLen, &bClientId, szStrBuf);
}
@@ -443,9 +443,9 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
#ifdef _DEBUG
if (wOldStatus == ID_STATUS_OFFLINE) {
if (CheckContactCapabilities(hContact, CAPF_SRV_RELAY))
- NetLog_Server("Supports advanced messages");
+ debugLogA("Supports advanced messages");
else
- NetLog_Server("Does NOT support advanced messages");
+ debugLogA("Does NOT support advanced messages");
}
#endif
@@ -456,13 +456,13 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
ClearContactCapabilities(hContact, CAPF_SRV_RELAY);
if (dwUIN && wOldStatus == ID_STATUS_OFFLINE)
- NetLog_Server("Logged in with AIM client");
+ debugLogA("Logged in with AIM client");
}
if (nIsICQ && wVersion < 8) {
ClearContactCapabilities(hContact, CAPF_SRV_RELAY);
if (wOldStatus == ID_STATUS_OFFLINE)
- NetLog_Server("Forcing simple messages due to compability issues");
+ debugLogA("Forcing simple messages due to compability issues");
}
// Process Avatar Hash
@@ -535,16 +535,16 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
if (wOldStatus != IcqStatusToMiranda(wStatus)) {
// And a small log notice... if status was changed
if (nIsICQ)
- NetLog_Server("%u changed status to %S (v%d).", dwUIN, ptszStatus, wVersion);
+ debugLogA("%u changed status to %S (v%d).", dwUIN, ptszStatus, wVersion);
else
- NetLog_Server("%s changed status to %S.", strUID(dwUIN, szUID), ptszStatus);
+ debugLogA("%s changed status to %S.", strUID(dwUIN, szUID), ptszStatus);
}
#ifdef _DEBUG
else {
if (nIsICQ)
- NetLog_Server("%u has status %s (v%d).", dwUIN, ptszStatus, wVersion);
+ debugLogA("%u has status %s (v%d).", dwUIN, ptszStatus, wVersion);
else
- NetLog_Server("%s has status %s.", strUID(dwUIN, szUID), ptszStatus);
+ debugLogA("%s has status %s.", strUID(dwUIN, szUID), ptszStatus);
}
#endif
@@ -558,7 +558,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
ShowPopupMsg(hContact, LPGEN("Spambot Detected"), LPGEN("Contact deleted & further events blocked."), POPTYPE_SPAM);
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- NetLog_Server("Contact %u deleted", dwUIN);
+ debugLogA("Contact %u deleted", dwUIN);
}
}
}
@@ -645,7 +645,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
if (wOldStatus != ID_STATUS_OFFLINE)
{
- NetLog_Server("%s went offline.", strUID(dwUIN, szUID));
+ debugLogA("%s went offline.", strUID(dwUIN, szUID));
setWord(hContact, "Status", ID_STATUS_OFFLINE);
// close Direct Connections to that user
@@ -655,7 +655,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
}
#ifdef _DEBUG
else
- NetLog_Server("%s is offline.", strUID(dwUIN, szUID));
+ debugLogA("%s is offline.", strUID(dwUIN, szUID));
#endif
}
@@ -727,7 +727,7 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar
DBVARIANT dbv = {DBVT_DELETED};
if (strlennull(szStatusNote) || (!getString(hContact, DBSETTING_STATUS_NOTE, &dbv) && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && strlennull(dbv.pszVal)))
- NetLog_Server("%s changed status note to \"%s\"", strUID(dwUin, szUid), szStatusNote ? szStatusNote : "");
+ debugLogA("%s changed status note to \"%s\"", strUID(dwUin, szUid), szStatusNote ? szStatusNote : "");
db_free(&dbv);
@@ -766,5 +766,5 @@ void CIcqProto::handleNotifyRejected(BYTE *buf, WORD wPackLen)
while (wPackLen)
if (unpackUID(&buf, &wPackLen, &dwUIN, &szUID))
- NetLog_Server("%s status notification rejected.", strUID(dwUIN, szUID));
+ debugLogA("%s status notification rejected.", strUID(dwUIN, szUID));
}
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp
index d11a36b83a..996f991394 100644
--- a/protocols/IcqOscarJ/src/fam_04message.cpp
+++ b/protocols/IcqOscarJ/src/fam_04message.cpp
@@ -67,7 +67,7 @@ void CIcqProto::handleMsgFam(BYTE *pBuffer, WORD wBufferLength, snac_header *pSn
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_MSG_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_MSG_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -117,7 +117,7 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef
if (wLen < 11)
{ // just do some basic packet checking
- NetLog_Server("Error: Malformed message thru server");
+ debugLogA("Error: Malformed message thru server");
return;
}
@@ -137,13 +137,13 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef
if (dwUin && IsOnSpammerList(dwUin))
{
- NetLog_Server("Ignored Message from known Spammer");
+ debugLogA("Ignored Message from known Spammer");
return;
}
if (wLen < 4)
{ // just do some basic packet checking
- NetLog_Server("Error: Malformed message thru server");
+ debugLogA("Error: Malformed message thru server");
return;
}
@@ -193,7 +193,7 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef
break;
default:
- NetLog_Server("Unknown format message thru server - Ref %u, Type: %u, UID: %s", dwRef, wMessageFormat, strUID(dwUin, szUID));
+ debugLogA("Unknown format message thru server - Ref %u, Type: %u, UID: %s", dwRef, wMessageFormat, strUID(dwUin, szUID));
break;
}
@@ -220,13 +220,13 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (wLen < 4)
{ // just perform basic structure check
- NetLog_Server("Message (format %u) - Ignoring empty message", 1);
+ debugLogA("Message (format %u) - Ignoring empty message", 1);
return;
}
// Unpack the first TLV(2)
unpackTypedTLV(buf, wLen, 2, &wTLVType, &wTLVLen, &pMsgTLV);
- NetLog_Server("Message (format %u) - UID: %s", 1, strUID(dwUin, szUID));
+ debugLogA("Message (format %u) - UID: %s", 1, strUID(dwUin, szUID));
// It must be TLV(2)
if (wTLVType == 2)
@@ -255,10 +255,10 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
pDataBuf = pCapabilityTLV->pData;
if (wDataLen > 0)
- NetLog_Server("Message (format 1) - Message has %d caps.", wDataLen);
+ debugLogA("Message (format 1) - Message has %d caps.", wDataLen);
}
else
- NetLog_Server("Message (format 1) - No message cap.");
+ debugLogA("Message (format 1) - No message cap.");
{ // Parse the message parts, usually only one 0x0101 TLV containing the message,
// but in some cases there can be more 0x0101 TLVs containing message parts in
@@ -291,7 +291,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
unpackWord(&pMsgBuf, &wCodePage);
wMsgLen = pMessageTLV->wLen - 4;
- NetLog_Server("Message (format 1) - Part %d: Encoding is 0x%X, page is 0x%X", wMsgPart, wEncoding, wCodePage);
+ debugLogA("Message (format 1) - Part %d: Encoding is 0x%X, page is 0x%X", wMsgPart, wEncoding, wCodePage);
switch (wEncoding) {
@@ -385,7 +385,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
BYTE *pBuf = pTimeTLV;
unpackDWord(&pBuf, &dwRecvTime);
- NetLog_Server("Message (format %u) - Offline timestamp is %s", 1, time2text(dwRecvTime));
+ debugLogA("Message (format %u) - Offline timestamp is %s", 1, time2text(dwRecvTime));
}
SAFE_FREE((void**)&pTimeTLV);
}
@@ -395,12 +395,12 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
pre.szMessage = (char *)szMsg;
ProtoChainRecvMsg(hContact, &pre);
- NetLog_Server("Message (format 1) received");
+ debugLogA("Message (format 1) received");
// Save tick value
setDword(hContact, "TickTS", time(NULL) - (dwMsgID1/1000));
}
- else NetLog_Server("Message (format %u) - Ignoring empty message", 1);
+ else debugLogA("Message (format %u) - Ignoring empty message", 1);
SAFE_FREE(&szMsg);
}
@@ -409,10 +409,10 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
disposeChain(&pChain);
}
else
- NetLog_Server("Failed to read TLV chain in message (format 1)");
+ debugLogA("Failed to read TLV chain in message (format 1)");
}
else
- NetLog_Server("Unsupported TLV (%u) in message (format %u)", wTLVType, 1);
+ debugLogA("Unsupported TLV (%u) in message (format %u)", wTLVType, 1);
SAFE_FREE((void**)&pMsgTLV);
}
@@ -427,13 +427,13 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (wLen < 4)
{
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
return;
}
// Unpack the first TLV(5)
unpackTypedTLV(buf, wLen, 5, &wTLVType, &wTLVLen, &pDataBuf);
- NetLog_Server("Message (format %u) - UID: %s", 2, strUID(dwUin, szUID));
+ debugLogA("Message (format %u) - UID: %s", 2, strUID(dwUin, szUID));
pBuf = pDataBuf;
// It must be TLV(5)
@@ -446,7 +446,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (wTLVLen < 26)
{ // just check if all basic data is there
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
SAFE_FREE((void**)&pBuf);
return;
}
@@ -454,7 +454,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
unpackWord(&pDataBuf, &wCommand);
wTLVLen -= 2; // Command 0x0000 - Normal message/file send request
#ifdef _DEBUG // 0x0001 - Abort request
- NetLog_Server("Command is %u", wCommand); // 0x0002 - Acknowledge request
+ debugLogA("Command is %u", wCommand); // 0x0002 - Acknowledge request
#endif
// Some stuff we don't use
@@ -472,14 +472,14 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (wCommand == 1)
{
- NetLog_Server("Cannot handle abort messages yet... :(");
+ debugLogA("Cannot handle abort messages yet... :(");
SAFE_FREE((void**)&pBuf);
return;
}
if (wTLVLen < 4)
{ // just check if at least one tlv is there
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
SAFE_FREE((void**)&pBuf);
return;
}
@@ -496,7 +496,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
chain = readIntoTLVChain(&pDataBuf, wTLVLen, 0);
if (!chain)
{ // sanity check
- NetLog_Server("Message (format %u) - Invalid data", 2);
+ debugLogA("Message (format %u) - Invalid data", 2);
SAFE_FREE((void**)&pBuf);
return;
}
@@ -531,7 +531,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
}
else
{
- NetLog_Server("Warning, no 0x2711 TLV in message (format 2)");
+ debugLogA("Warning, no 0x2711 TLV in message (format 2)");
}
// Clean up
disposeChain(&chain);
@@ -540,26 +540,26 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
{ // Handle reverse DC request
if (wCommand == 1)
{
- NetLog_Server("Cannot handle abort messages yet... :(");
+ debugLogA("Cannot handle abort messages yet... :(");
SAFE_FREE((void**)&pBuf);
return;
}
if (wTLVLen < 4)
{ // just check if at least one tlv is there
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
SAFE_FREE((void**)&pBuf);
return;
}
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
SAFE_FREE((void**)&pBuf);
return;
}
chain = readIntoTLVChain(&pDataBuf, wTLVLen, 0);
if (!chain)
{ // Malformed packet
- NetLog_Server("Error: Malformed data in packet");
+ debugLogA("Error: Malformed data in packet");
SAFE_FREE((void**)&pBuf);
return;
}
@@ -578,7 +578,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
HANDLE hContact = HContactFromUIN(dwUin, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
- NetLog_Server("Error: %s from unknown contact %u", "Reverse Connect Request", dwUin);
+ debugLogA("Error: %s from unknown contact %u", "Reverse Connect Request", dwUin);
}
else
{
@@ -611,17 +611,17 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
OpenDirectConnection(hContact, DIRECTCONN_REVERSE, (void*)pCookie);
}
else
- NetLog_Server("Warning: Unsupported direct protocol version in %s", "Reverse Connect Request");
+ debugLogA("Warning: Unsupported direct protocol version in %s", "Reverse Connect Request");
}
}
else
{
- NetLog_Server("Malformed %s", "Reverse Connect Request");
+ debugLogA("Malformed %s", "Reverse Connect Request");
}
}
else
{
- NetLog_Server("Warning, no 0x2711 TLV in message (format 2)");
+ debugLogA("Warning, no 0x2711 TLV in message (format 2)");
}
// Clean up
disposeChain(&chain);
@@ -636,12 +636,12 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
}
else // here should be detection of extra data streams (Xtraz)
{
- NetLog_Server("Unknown Message Format Capability");
+ debugLogA("Unknown Message Format Capability");
}
}
else
{
- NetLog_Server("Unsupported TLV (%u) in message (format %u)", wTLVType, 2);
+ debugLogA("Unsupported TLV (%u) in message (format %u)", wTLVType, 2);
}
SAFE_FREE((void**)&pBuf);
@@ -654,7 +654,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
if (wLen < 2)
{
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
return;
}
@@ -670,7 +670,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
if (wLen < 31)
{ // just check if we have data to work with
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
return;
}
@@ -705,7 +705,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
if (wLen < 20)
{ // check if there is everything that should be there
- NetLog_Server("Message (format %u) - Ignoring empty message", 2);
+ debugLogA("Message (format %u) - Ignoring empty message", 2);
return;
}
@@ -723,7 +723,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
// Priority
unpackLEWord(&pDataBuf, &wPritority);
wLen -= 2;
- NetLog_Server("Priority: %u", wPritority);
+ debugLogA("Priority: %u", wPritority);
// Message
unpackLEWord(&pDataBuf, &wMsgLen);
@@ -737,7 +737,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
{
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
@@ -759,7 +759,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
}
else
{
- NetLog_Server("Ignored strange file message");
+ debugLogA("Ignored strange file message");
}
break;
@@ -776,7 +776,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
{
if (wLen < wMsgLen)
{ // sanity check
- NetLog_Server("Error: Malformed server Greeting message");
+ debugLogA("Error: Malformed server Greeting message");
return;
}
@@ -789,7 +789,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
{
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
message_ack_params pMsgAck = {0};
@@ -810,7 +810,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
{ // info manager plugin - obsolete
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
@@ -827,7 +827,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
unpackByte(&pDataBuf, &bLevel);
if (bLevel != 0 || wLen < 16)
{
- NetLog_Server("Invalid %s Manager Plugin message from %u", "Info", dwUin);
+ debugLogA("Invalid %s Manager Plugin message from %u", "Info", dwUin);
return;
}
unpackDWord(&pDataBuf, &dwGuid1); // plugin request GUID
@@ -838,16 +838,16 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
if (CompareGUIDs(dwGuid1, dwGuid2, dwGuid3, dwGuid4, PMSG_QUERY_INFO))
{
- NetLog_Server("User %u requests our %s plugin list. NOT SUPPORTED", dwUin, "info");
+ debugLogA("User %u requests our %s plugin list. NOT SUPPORTED", dwUin, "info");
}
else
- NetLog_Server("Unknown %s Manager message from %u", "Info", dwUin);
+ debugLogA("Unknown %s Manager message from %u", "Info", dwUin);
}
else if (CompareGUIDs(dwGuid1, dwGuid2, dwGuid3, dwGuid4, PSIG_STATUS_PLUGIN))
{ // status manager plugin - obsolete
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
@@ -864,7 +864,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
unpackByte(&pDataBuf, &bLevel);
if (bLevel != 0 || wLen < 16)
{
- NetLog_Server("Invalid %s Manager Plugin message from %u", "Status", dwUin);
+ debugLogA("Invalid %s Manager Plugin message from %u", "Status", dwUin);
return;
}
unpackDWord(&pDataBuf, &dwGuid1); // plugin request GUID
@@ -874,15 +874,15 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
wLen -= 16;
if (CompareGUIDs(dwGuid1, dwGuid2, dwGuid3, dwGuid4, PMSG_QUERY_STATUS))
- NetLog_Server("User %u requests our %s plugin list. NOT SUPPORTED", dwUin, "status");
+ debugLogA("User %u requests our %s plugin list. NOT SUPPORTED", dwUin, "status");
else
- NetLog_Server("Unknown %s Manager message from %u", "Status", dwUin);
+ debugLogA("Unknown %s Manager message from %u", "Status", dwUin);
}
else
- NetLog_Server("Unknown signature (%08x-%08x-%08x-%08x) in message (format 2)", dwGuid1, dwGuid2, dwGuid3, dwGuid4);
+ debugLogA("Unknown signature (%08x-%08x-%08x-%08x) in message (format 2)", dwGuid1, dwGuid2, dwGuid3, dwGuid4);
}
else
- NetLog_Server("Unknown wId1 (%u) in message (format 2)", wId);
+ debugLogA("Unknown wId1 (%u) in message (format 2)", wId);
}
@@ -891,7 +891,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
int nTypeId;
WORD wFunction;
- NetLog_Server("Parsing Greeting message through server");
+ debugLogA("Parsing Greeting message through server");
// Message plugin identification
if (!unpackPluginTypeId(&pDataBuf, &wLen, &nTypeId, &wFunction, FALSE)) return;
@@ -915,10 +915,10 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
{
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
- NetLog_Server("This is file ack");
+ debugLogA("This is file ack");
char *szMsg = (char *)_alloca(dwDataLen + 1);
memcpy(szMsg, pDataBuf, dwDataLen);
@@ -932,10 +932,10 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
{
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
- NetLog_Server("This is a file request");
+ debugLogA("This is a file request");
char *szMsg = (char *)_alloca(dwDataLen + 1);
memcpy(szMsg, pDataBuf, dwDataLen);
@@ -949,10 +949,10 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
{ // TODO: this is deprecated
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
- NetLog_Server("This is a chat request");
+ debugLogA("This is a chat request");
char *szMsg = (char *)_alloca(dwDataLen + 1);
memcpy(szMsg, pDataBuf, dwDataLen);
@@ -994,7 +994,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
{
if (!dwUin)
{ // AIM cannot send this, just sanity
- NetLog_Server("Error: Malformed UIN in packet");
+ debugLogA("Error: Malformed UIN in packet");
return;
}
message_ack_params pMsgAck = {0};
@@ -1010,11 +1010,11 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE hCont
}
else
{
- NetLog_Server("Unsupported plugin message type %d", nTypeId);
+ debugLogA("Unsupported plugin message type %d", nTypeId);
}
}
else
- NetLog_Server("Error: Malformed server plugin message");
+ debugLogA("Error: Malformed server plugin message");
}
@@ -1026,13 +1026,13 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
{ // received contacts
if (wLen < 4)
{ // just check if at least one tlv is there
- NetLog_Server("Message (format %u) - Ignoring empty contacts message", 2);
+ debugLogA("Message (format %u) - Ignoring empty contacts message", 2);
return;
}
oscar_tlv_chain *chain = readIntoTLVChain(&buf, wLen, 0);
if (!chain)
{ // sanity check
- NetLog_Server("Message (format %u) - Invalid data", 2);
+ debugLogA("Message (format %u) - Invalid data", 2);
return;
}
@@ -1045,7 +1045,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
if (!tlvUins || tlvUins->wLen < 4)
{
- NetLog_Server("Malformed '%s' message", "contacts");
+ debugLogA("Malformed '%s' message", "contacts");
disposeChain(&chain);
return;
}
@@ -1122,7 +1122,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
}
if (!iContact || !valid)
{
- NetLog_Server("Malformed '%s' message", "contacts");
+ debugLogA("Malformed '%s' message", "contacts");
disposeChain(&chain);
for (int i = 0; i < iContact; i++)
{
@@ -1192,7 +1192,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
if (!valid)
{
- NetLog_Server("Malformed '%s' message", "contacts");
+ debugLogA("Malformed '%s' message", "contacts");
}
else
{
@@ -1219,13 +1219,13 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
SAFE_FREE((void**)&contacts);
}
else
- NetLog_Server("Error: Received unknown contacts message, ignoring.");
+ debugLogA("Error: Received unknown contacts message, ignoring.");
// Clean up
disposeChain(&chain);
}
else if (wCommand == 1)
{
- NetLog_Server("Cannot handle abort messages yet... :(");
+ debugLogA("Cannot handle abort messages yet... :(");
return;
}
else if (wCommand == 2)
@@ -1236,14 +1236,14 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
if (FindMessageCookie(dwID1, dwID2, &dwCookie, &hCookieContact, NULL))
{
if (hCookieContact != hContact)
- NetLog_Server("Warning: Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
+ debugLogA("Warning: Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
ProtoBroadcastAck(hContact, ACKTYPE_CONTACTS, ACKRESULT_SUCCESS, (HANDLE)dwCookie, 0);
ReleaseCookie(dwCookie);
}
else
- NetLog_Server("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
+ debugLogA("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
}
}
@@ -1257,13 +1257,13 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (wLen < 2)
{
- NetLog_Server("Message (format %u) - Ignoring empty message", 4);
+ debugLogA("Message (format %u) - Ignoring empty message", 4);
return;
}
// Unpack the first TLV(5)
unpackTypedTLV(buf, wLen, 5, &wTLVType, &wTLVLen, &pDataBuf);
- NetLog_Server("Message (format %u) - UID: %s", 4, strUID(dwUin, szUID));
+ debugLogA("Message (format %u) - UID: %s", 4, strUID(dwUin, szUID));
// It must be TLV(5)
if (wTLVType == 5)
@@ -1284,7 +1284,7 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
if (bMsgType == 0 && wMsgLen == 1)
{
- NetLog_Server("User %u probably checks his ignore state.", dwUin);
+ debugLogA("User %u probably checks his ignore state.", dwUin);
}
else
{
@@ -1304,7 +1304,7 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
BYTE *pBuf = pTimeTLV;
unpackDWord(&pBuf, &dwRecvTime);
- NetLog_Server("Message (format %u) - Offline timestamp is %s", 4, time2text(dwRecvTime));
+ debugLogA("Message (format %u) - Offline timestamp is %s", 4, time2text(dwRecvTime));
}
SAFE_FREE((void**)&pTimeTLV);
}
@@ -1314,7 +1314,7 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
WORD wLen = wTLVLen - 8;
int typeId;
- NetLog_Server("Parsing Greeting message through server");
+ debugLogA("Parsing Greeting message through server");
pmsg += wMsgLen;
wLen -= wMsgLen;
@@ -1341,7 +1341,7 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
}
else
{
- NetLog_Server("Unsupported plugin message type %d", typeId);
+ debugLogA("Unsupported plugin message type %d", typeId);
}
}
}
@@ -1354,12 +1354,12 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, WORD wLen, DWORD dwUin, char *
}
else
{
- NetLog_Server("Ignoring spoofed TYPE4 message thru server from %d", dwUin);
+ debugLogA("Ignoring spoofed TYPE4 message thru server from %d", dwUin);
}
}
else
{
- NetLog_Server("Unsupported TLV (%u) in message (format %u)", wTLVType, 4);
+ debugLogA("Unsupported TLV (%u) in message (format %u)", wTLVType, 4);
}
SAFE_FREE((void**)&pDataBuf);
@@ -1625,13 +1625,13 @@ void packPluginTypeId(icq_packet *packet, int nTypeID)
void CIcqProto::handleStatusMsgReply(const char *szPrefix, HANDLE hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
{
if (hContact == INVALID_HANDLE_VALUE) {
- NetLog_Server("%sIgnoring status message from unknown contact %u", szPrefix, dwUin);
+ debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin);
return;
}
int status = AwayMsgTypeToStatus(bMsgType);
if (status == ID_STATUS_OFFLINE) {
- NetLog_Server("%sIgnoring unknown status message from %u", szPrefix, dwUin);
+ debugLogA("%sIgnoring unknown status message from %u", szPrefix, dwUin);
return;
}
@@ -1659,7 +1659,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD
if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
{
- NetLog_Server("%sIgnoring unrequested status message from %u", "handleMessageAck: ", dwUin);
+ debugLogA("%sIgnoring unrequested status message from %u", "handleMessageAck: ", dwUin);
ReleaseCookie(wCookie);
return INVALID_HANDLE_VALUE;
@@ -1667,7 +1667,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD
if (hContact != hCookieContact)
{
- NetLog_Server("%sAck Contact does not match Cookie Contact(0x%x != 0x%x)", "handleMessageAck: ", hContact, hCookieContact);
+ debugLogA("%sAck Contact does not match Cookie Contact(0x%x != 0x%x)", "handleMessageAck: ", hContact, hCookieContact);
ReleaseCookie(wCookie);
return INVALID_HANDLE_VALUE;
@@ -1679,7 +1679,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD
else
{
// Should not happen
- NetLog_Server("%sIgnored type %u ack message (this should not happen)", "handleMessageAck: ", type);
+ debugLogA("%sIgnored type %u ack message (this should not happen)", "handleMessageAck: ", type);
}
return INVALID_HANDLE_VALUE;
@@ -1877,7 +1877,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
char* pCurBlob;
if (nMsgFields < 6) {
- NetLog_Server("Malformed '%s' message", "auth req");
+ debugLogA("Malformed '%s' message", "auth req");
break;
}
@@ -1908,7 +1908,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
if (nMsgFields < 4)
{
- NetLog_Server("Malformed '%s' message", "you were added");
+ debugLogA("Malformed '%s' message", "you were added");
break;
}
@@ -2009,7 +2009,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
NetLog_Uni(bThruDC, "Malformed '%s' message", "SMS Mobile");
break;
}
- NetLog_Server("Received SMS Mobile message");
+ debugLogA("Received SMS Mobile message");
ProtoBroadcastAck(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, NULL, (LPARAM)szMsg);
break;
@@ -2018,7 +2018,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
/* it's either extended StatusMsg reply from icq2003b or a IcqWebMessage */
if (dwUin == 1003)
{
- NetLog_Server("Received ICQWebMessage - NOT SUPPORTED");
+ debugLogA("Received ICQWebMessage - NOT SUPPORTED");
}
break;
@@ -2030,7 +2030,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
if (nMsgFields < 6)
{
- NetLog_Server("Malformed '%s' message", "web pager");
+ debugLogA("Malformed '%s' message", "web pager");
break;
}
@@ -2053,7 +2053,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
if (nMsgFields < 6)
{
- NetLog_Server("Malformed '%s' message", "e-mail express");
+ debugLogA("Malformed '%s' message", "e-mail express");
break;
}
@@ -2136,7 +2136,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
else if (dwUin)
ppro->icq_sendAwayMsgReplyServ(dwUin, dwMsgID1, dwMsgID2, wCookie, wVersion, (BYTE)nMsgType, pszMsg);
else
- ppro->NetLog_Server("Error: Malformed UIN in packet");
+ ppro->debugLogA("Error: Malformed UIN in packet");
};
BOOL bExtended;
@@ -2203,7 +2203,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
wLen -= 2;
if (wMessageFormat != 2)
{
- NetLog_Server("SNAC(4.B) Unknown type");
+ debugLogA("SNAC(4.B) Unknown type");
return;
}
@@ -2216,7 +2216,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (!FindMessageCookie(dwMsgID1, dwMsgID2, &dwCookie, &hCookieContact, &pCookieData))
{
- NetLog_Server("SNAC(4.B) Received an ack that I did not ask for from (%u)", dwUin);
+ debugLogA("SNAC(4.B) Received an ack that I did not ask for from (%u)", dwUin);
return;
}
@@ -2228,7 +2228,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (!dwUin)
{ // AIM cannot send this - just sanity
- NetLog_Server("Error: Invalid UID in message response.");
+ debugLogA("Error: Invalid UID in message response.");
return;
}
@@ -2272,14 +2272,14 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
{ // use old reliable method
- NetLog_Server("Warning: Invalid cookie in %s from (%u)", "message response", dwUin);
+ debugLogA("Warning: Invalid cookie in %s from (%u)", "message response", dwUin);
if (pCookieData->bMessageType != MTYPE_AUTOAWAY && bFlags == 3)
{ // most probably a broken ack of some kind (e.g. from R&Q), try to fix that
bMsgType = pCookieData->bMessageType;
bFlags = 0;
- NetLog_Server("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
+ debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
else if (bMsgType != MTYPE_PLUGIN && pCookieData->bMessageType != MTYPE_AUTOAWAY)
@@ -2287,14 +2287,14 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
dwCookie = wCookie;
if (bMsgType != pCookieData->bMessageType)
- NetLog_Server("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
+ debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
bMsgType = pCookieData->bMessageType;
}
else if (pCookieData->bMessageType == MTYPE_AUTOAWAY && bMsgType != MTYPE_PLUGIN)
{
if (bMsgType != pCookieData->nAckType)
- NetLog_Server("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
+ debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
else
@@ -2305,7 +2305,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (hCookieContact != hContact)
{
- NetLog_Server("SNAC(4.B) Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
+ debugLogA("SNAC(4.B) Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
@@ -2322,7 +2322,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (hContact == NULL || hContact == INVALID_HANDLE_VALUE)
{
- NetLog_Server("SNAC(4.B) Message from unknown contact (%u)", dwUin);
+ debugLogA("SNAC(4.B) Message from unknown contact (%u)", dwUin);
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
@@ -2363,13 +2363,13 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (wLength != 0x1B)
{
- NetLog_Server("Invalid Greeting %s", "message response");
+ debugLogA("Invalid Greeting %s", "message response");
ReleaseCookie(dwCookie);
return;
}
- NetLog_Server("Parsing Greeting %s", "message response");
+ debugLogA("Parsing Greeting %s", "message response");
// Message
unpackLEWord(&buf, &wMsgLen);
@@ -2392,7 +2392,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (wLen < 4)
{
- NetLog_Server("Error: Invalid greeting %s", "message response");
+ debugLogA("Error: Invalid greeting %s", "message response");
ReleaseCookie(dwCookie);
return;
@@ -2437,7 +2437,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
case MTYPE_FILEREQ:
{
- NetLog_Server("This is file ack");
+ debugLogA("This is file ack");
char *szMsg = (char *)_alloca(dwDataLen + 1);
@@ -2485,7 +2485,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
return;
default:
- NetLog_Server("Error: Unknown plugin message response, type %d.", typeId);
+ debugLogA("Error: Unknown plugin message response, type %d.", typeId);
return;
}
}
@@ -2522,7 +2522,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
}
- NetLog_Server("Reverse Connect request failed");
+ debugLogA("Reverse Connect request failed");
// Set DC status to failed
setByte(hContact, "DCStatus", 2);
@@ -2532,7 +2532,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
case MTYPE_CHAT:
default:
- NetLog_Server("SNAC(4.B) Unknown message type (%u) in switch", bMsgType);
+ debugLogA("SNAC(4.B) Unknown message type (%u) in switch", bMsgType);
return;
}
@@ -2688,7 +2688,7 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
}
else
{
- NetLog_Server("Error: Message delivery to %u failed: %s", dwUin, pszErrorMessage);
+ debugLogA("Error: Message delivery to %u failed: %s", dwUin, pszErrorMessage);
}
FreeCookie((WORD)dwSequence);
@@ -2715,7 +2715,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque
if (wLen < 13)
{
- NetLog_Server("Ignoring SNAC(4,C) Packet to short");
+ debugLogA("Ignoring SNAC(4,C) Packet to short");
return;
}
@@ -2766,7 +2766,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque
default:
ackType = -1;
- NetLog_Server("Error: Unknown message type %d in ack", pCookieData->bMessageType);
+ debugLogA("Error: Unknown message type %d in ack", pCookieData->bMessageType);
break;
}
if (ackType != -1)
@@ -2778,9 +2778,9 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque
FreeCookie((WORD)dwSequence);
}
else if (pCookieData && (pCookieData->nAckType == ACKTYPE_CLIENT))
- NetLog_Server("Received a server ack, waiting for client ack.");
+ debugLogA("Received a server ack, waiting for client ack.");
else
- NetLog_Server("Ignored a server ack I did not ask for");
+ debugLogA("Ignored a server ack I did not ask for");
}
}
@@ -2866,14 +2866,14 @@ void CIcqProto::handleOffineMessagesReply(BYTE *buf, WORD wLen, WORD wFlags, DWO
if (FindCookie(dwRef, NULL, (void**)&cookie))
{
- NetLog_Server("End of offline msgs, %u received", cookie->nMessages);
+ debugLogA("End of offline msgs, %u received", cookie->nMessages);
if (cookie->nMissed)
{ // NASTY WORKAROUND!!
// The ICQ server has a bug that causes offline messages to be received again and again when some
// missed message notification is present (most probably it is not processed correctly and causes
// the server to fail the purging process); try to purge them using the old offline messages
// protocol. 2008/05/21
- NetLog_Server("Warning: Received %u missed message notifications, trying to fix the server.", cookie->nMissed);
+ debugLogA("Warning: Received %u missed message notifications, trying to fix the server.", cookie->nMissed);
icq_packet packet;
// This will delete the messages stored on server
@@ -2893,7 +2893,7 @@ void CIcqProto::handleOffineMessagesReply(BYTE *buf, WORD wLen, WORD wFlags, DWO
ReleaseCookie(dwRef);
}
else
- NetLog_Server("Error: Received unexpected end of offline msgs.");
+ debugLogA("Error: Received unexpected end of offline msgs.");
}
@@ -2906,13 +2906,13 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR
if (wLen < 14)
{
- NetLog_Server("Ignoring SNAC(4.x11) Packet to short");
+ debugLogA("Ignoring SNAC(4.x11) Packet to short");
return;
}
#ifndef DBG_CAPMTN
{
- NetLog_Server("Ignoring unexpected typing notification");
+ debugLogA("Ignoring unexpected typing notification");
return;
}
#endif
@@ -2944,12 +2944,12 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR
case MTN_FINISHED:
case MTN_TYPED:
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF);
- NetLog_Server("%s has stopped typing (ch %u).", strUID(dwUin, szUid), wChannel);
+ debugLogA("%s has stopped typing (ch %u).", strUID(dwUin, szUid), wChannel);
break;
case MTN_BEGUN:
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)60);
- NetLog_Server("%s is typing a message (ch %u).", strUID(dwUin, szUid), wChannel);
+ debugLogA("%s is typing a message (ch %u).", strUID(dwUin, szUid), wChannel);
break;
case MTN_WINDOW_CLOSED:
@@ -2962,12 +2962,12 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR
ShowPopupMsg(hContact, ICQTranslateUtfStatic(LPGEN("ICQ Note"), szFormat, MAX_PATH), szMsg, LOG_NOTE);
SAFE_FREE((void**)&nick);
- NetLog_Server("%s has closed the message window.", strUID(dwUin, szUid));
+ debugLogA("%s has closed the message window.", strUID(dwUin, szUid));
}
break;
default:
- NetLog_Server("Unknown typing notification from %s, type %u (ch %u)", strUID(dwUin, szUid), wNotification, wChannel);
+ debugLogA("Unknown typing notification from %s, type %u (ch %u)", strUID(dwUin, szUid), wNotification, wChannel);
break;
}
}
diff --git a/protocols/IcqOscarJ/src/fam_09bos.cpp b/protocols/IcqOscarJ/src/fam_09bos.cpp
index daa7589c3e..882ded41aa 100644
--- a/protocols/IcqOscarJ/src/fam_09bos.cpp
+++ b/protocols/IcqOscarJ/src/fam_09bos.cpp
@@ -51,7 +51,7 @@ void CIcqProto::handleBosFam(unsigned char *pBuffer, WORD wBufferLength, snac_he
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_BOS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_BOS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
@@ -74,7 +74,7 @@ void CIcqProto::handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLen
disposeChain(&pChain);
- NetLog_Server("PRIVACY: Max visible %u, max invisible %u, max temporary visible %u items.", wMaxVisibleContacts, wMaxInvisibleContacts, wMaxTemporaryVisibleContacts);
+ debugLogA("PRIVACY: Max visible %u, max invisible %u, max temporary visible %u items.", wMaxVisibleContacts, wMaxInvisibleContacts, wMaxTemporaryVisibleContacts);
// Success
return;
@@ -82,7 +82,7 @@ void CIcqProto::handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLen
}
// Failure
- NetLog_Server("Warning: Malformed SRV_PRIVACY_RIGHTS_REPLY");
+ debugLogA("Warning: Malformed SRV_PRIVACY_RIGHTS_REPLY");
}
void CIcqProto::makeContactTemporaryVisible(HANDLE hContact)
@@ -101,6 +101,6 @@ void CIcqProto::makeContactTemporaryVisible(HANDLE hContact)
setByte(hContact, "TemporaryVisible", 1);
#ifdef _DEBUG
- NetLog_Server("Added contact %s to temporary visible list", strUID(dwUin, szUid));
+ debugLogA("Added contact %s to temporary visible list", strUID(dwUin, szUid));
#endif
}
diff --git a/protocols/IcqOscarJ/src/fam_0alookup.cpp b/protocols/IcqOscarJ/src/fam_0alookup.cpp
index 9e8c3c26f9..3eefca98c8 100644
--- a/protocols/IcqOscarJ/src/fam_0alookup.cpp
+++ b/protocols/IcqOscarJ/src/fam_0alookup.cpp
@@ -50,7 +50,7 @@ void CIcqProto::handleLookupFam(BYTE *pBuffer, WORD wBufferLength, snac_header*
if (FindCookie(pSnacHeader->dwRef, NULL, (void**)&pCookie))
{
if (wError == 0x14)
- NetLog_Server("Lookup: No results");
+ debugLogA("Lookup: No results");
ReleaseLookupCookie(pSnacHeader->dwRef, pCookie);
@@ -62,7 +62,7 @@ void CIcqProto::handleLookupFam(BYTE *pBuffer, WORD wBufferLength, snac_header*
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LOOKUP_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LOOKUP_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -95,11 +95,11 @@ void CIcqProto::handleLookupEmailReply(BYTE* buf, WORD wLen, DWORD dwCookie)
if (!FindCookie(dwCookie, NULL, (void**)&pCookie))
{
- NetLog_Server("Error: Received unexpected lookup reply");
+ debugLogA("Error: Received unexpected lookup reply");
return;
}
- NetLog_Server("SNAC(0x0A,0x3): Lookup reply");
+ debugLogA("SNAC(0x0A,0x3): Lookup reply");
sr.hdr.cbSize = sizeof(sr);
sr.hdr.flags = PSR_TCHAR;
diff --git a/protocols/IcqOscarJ/src/fam_0bstatus.cpp b/protocols/IcqOscarJ/src/fam_0bstatus.cpp
index 7a979007e2..d50683d3f5 100644
--- a/protocols/IcqOscarJ/src/fam_0bstatus.cpp
+++ b/protocols/IcqOscarJ/src/fam_0bstatus.cpp
@@ -38,7 +38,7 @@ void CIcqProto::handleStatusFam(unsigned char *pBuffer, WORD wBufferLength, snac
{
WORD wInterval;
unpackWord(&pBuffer, &wInterval);
- NetLog_Server("Server sent SNAC(x0B,x02) - SRV_SET_MINREPORTINTERVAL (Value: %u hours)", wInterval);
+ debugLogA("Server sent SNAC(x0B,x02) - SRV_SET_MINREPORTINTERVAL (Value: %u hours)", wInterval);
}
break;
@@ -56,7 +56,7 @@ void CIcqProto::handleStatusFam(unsigned char *pBuffer, WORD wBufferLength, snac
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_STATS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_STATS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp
index ee848c5e0f..049d3c1cab 100644
--- a/protocols/IcqOscarJ/src/fam_13servclist.cpp
+++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp
@@ -48,7 +48,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
if (FindCookie(pSnacHeader->dwRef, NULL, (void**)&sc))
{ // look for action cookie
#ifdef _DEBUG
- NetLog_Server("Received expected server list ack, action: %d, result: %d", sc->dwAction, wError);
+ debugLogA("Received expected server list ack, action: %d, result: %d", sc->dwAction, wError);
#endif
FreeCookie(pSnacHeader->dwRef); // release cookie
@@ -57,11 +57,11 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
int i;
#ifdef _DEBUG
- NetLog_Server("Server-List: Grouped action contains %d actions.", sc->dwGroupCount);
+ debugLogA("Server-List: Grouped action contains %d actions.", sc->dwGroupCount);
#endif
pBuffer -= 2; // revoke unpack
if (wBufferLength != 2*sc->dwGroupCount)
- NetLog_Server("Error: Server list ack does not contain expected amount of result codes (%u != %u)", wBufferLength/2, sc->dwGroupCount);
+ debugLogA("Error: Server list ack does not contain expected amount of result codes (%u != %u)", wBufferLength/2, sc->dwGroupCount);
for (i = 0; i < sc->dwGroupCount; i++)
{
@@ -74,7 +74,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
wError = -1;
#ifdef _DEBUG
- NetLog_Server("Action: %d, ack result: %d", sc->pGroupItems[i]->dwAction, wError);
+ debugLogA("Action: %d, ack result: %d", sc->pGroupItems[i]->dwAction, wError);
#endif
// call normal ack handler
handleServerCListAck(sc->pGroupItems[i], wError);
@@ -88,7 +88,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
}
else
{
- NetLog_Server("Received unexpected server list ack %u", wError);
+ debugLogA("Received unexpected server list ack %u", wError);
}
}
break;
@@ -98,7 +98,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
handleServerCListRightsReply(pBuffer, wBufferLength);
#ifdef _DEBUG
- NetLog_Server("Server sent SNAC(x13,x03) - SRV_REPLYLISTS");
+ debugLogA("Server sent SNAC(x13,x03) - SRV_REPLYLISTS");
#endif
}
break;
@@ -144,13 +144,13 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
if (FindCookie(pSnacHeader->dwRef, NULL, (void**)&sc))
{ // we requested servlist check
#ifdef _DEBUG
- NetLog_Server("Server stated roster is ok.");
+ debugLogA("Server stated roster is ok.");
#endif
ReleaseCookie(pSnacHeader->dwRef);
LoadServerIDs();
}
else
- NetLog_Server("Server sent unexpected SNAC(x13,x0F) - SRV_REPLYROSTEROK");
+ debugLogA("Server sent unexpected SNAC(x13,x0F) - SRV_REPLYROSTEROK");
// This will activate the server side list
sendRosterAck(); // this must be here, cause of failures during cookie alloc
@@ -159,11 +159,11 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
}
case ICQ_LISTS_CLI_MODIFYSTART:
- NetLog_Server("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_CLI_MODIFYSTART, "Server is modifying contact list");
+ debugLogA("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_CLI_MODIFYSTART, "Server is modifying contact list");
break;
case ICQ_LISTS_CLI_MODIFYEND:
- NetLog_Server("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_CLI_MODIFYEND, "End of server modification");
+ debugLogA("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_CLI_MODIFYEND, "End of server modification");
break;
case ICQ_LISTS_ADDTOLIST:
@@ -218,7 +218,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
szChange = "Server removed %u item(s) from list";
mir_snprintf(szLogText, MAX_PATH, szChange, nItems);
- NetLog_Server("Server sent SNAC(x13,x%02x) - %s", pSnacHeader->wSubtype, szLogText);
+ debugLogA("Server sent SNAC(x13,x%02x) - %s", pSnacHeader->wSubtype, szLogText);
}
}
break;
@@ -232,7 +232,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
break;
case ICQ_LISTS_AUTHGRANTED:
- NetLog_Server("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_AUTHGRANTED, "User granted us future authorization");
+ debugLogA("Server sent SNAC(x13,x%02x) - %s", ICQ_LISTS_AUTHGRANTED, "User granted us future authorization");
break;
case ICQ_LISTS_YOUWEREADDED:
@@ -250,7 +250,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
if (FindCookie(pSnacHeader->dwRef, NULL, (void**)&sc))
{ // look for action cookie
#ifdef _DEBUG
- NetLog_Server("Received server list error, action: %d, result: %d", sc->dwAction, wError);
+ debugLogA("Received server list error, action: %d, result: %d", sc->dwAction, wError);
#endif
FreeCookie(pSnacHeader->dwRef); // release cookie
@@ -271,7 +271,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LISTS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_LISTS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -342,7 +342,7 @@ void CIcqProto::handleServerCListRightsReply(BYTE *buf, WORD wLen)
if (i + 1 >= SIZEOF(m_wServerListLimits)) break;
}
- NetLog_Server("SSI: Max %d contacts (%d per group), %d groups, %d permit, %d deny, %d ignore items.", m_wServerListLimits[SSI_ITEM_BUDDY], m_wServerListGroupMaxContacts, m_wServerListLimits[SSI_ITEM_GROUP], m_wServerListLimits[SSI_ITEM_PERMIT], m_wServerListLimits[SSI_ITEM_DENY], m_wServerListLimits[SSI_ITEM_IGNORE]);
+ debugLogA("SSI: Max %d contacts (%d per group), %d groups, %d permit, %d deny, %d ignore items.", m_wServerListLimits[SSI_ITEM_BUDDY], m_wServerListGroupMaxContacts, m_wServerListLimits[SSI_ITEM_GROUP], m_wServerListLimits[SSI_ITEM_PERMIT], m_wServerListLimits[SSI_ITEM_DENY], m_wServerListLimits[SSI_ITEM_IGNORE]);
}
disposeChain(&chain);
@@ -358,7 +358,7 @@ DWORD CIcqProto::updateServerGroupData(WORD wGroupId, void *groupData, int group
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
{
- NetLog_Server("Updating of group on server list failed (malloc error)");
+ debugLogA("Updating of group on server list failed (malloc error)");
return 0;
}
ack->dwAction = SSA_GROUP_UPDATE;
@@ -377,7 +377,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
case SSA_VISIBILITY:
{
if (wError)
- NetLog_Server("Server visibility update failed, error %d", wError);
+ debugLogA("Server visibility update failed, error %d", wError);
break;
}
case SSA_CONTACT_UPDATE:
@@ -385,7 +385,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
servlistPendingRemoveContact(sc->hContact, sc->wContactId, sc->wGroupId, wError ? PENDING_RESULT_FAILED : PENDING_RESULT_SUCCESS);
if (wError)
{
- NetLog_Server("Updating of server contact failed, error %d", wError);
+ debugLogA("Updating of server contact failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Updating of server contact failed."));
}
break;
@@ -394,7 +394,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
if (wError)
{
- NetLog_Server("Adding of privacy item to server list failed, error %d", wError);
+ debugLogA("Adding of privacy item to server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Adding of privacy item to server list failed."));
}
break;
@@ -403,7 +403,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
if (wError)
{
- NetLog_Server("Removing of privacy item from server list failed, error %d", wError);
+ debugLogA("Removing of privacy item from server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Removing of privacy item from server list failed."));
}
FreeServerID(sc->wContactId, SSIT_ITEM); // release server id
@@ -417,7 +417,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
DWORD dwCookie;
- NetLog_Server("Contact could not be added without authorization, add with await auth flag.");
+ debugLogA("Contact could not be added without authorization, add with await auth flag.");
setByte(sc->hContact, "Auth", 1); // we need auth
dwCookie = AllocateCookie(CKT_SERVERLIST, ICQ_LISTS_ADDTOLIST, sc->hContact, sc);
@@ -428,7 +428,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
}
FreeServerID(sc->wContactId, SSIT_ITEM);
- NetLog_Server("Adding of contact to server list failed, error %d", wError);
+ debugLogA("Adding of contact to server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Adding of contact to server list failed."));
servlistPendingRemoveContact(sc->hContact, 0, sc->wGroupId, PENDING_RESULT_FAILED);
@@ -452,7 +452,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
}
else
{ // this should never happen
- NetLog_Server("Group update failed.");
+ debugLogA("Group update failed.");
servlistPostPacket(NULL, 0, SSO_END_OPERATION, 100); // end server modifications here
}
}
@@ -463,7 +463,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
if (wError)
{
FreeServerID(sc->wGroupId, SSIT_GROUP);
- NetLog_Server("Adding of group to server list failed, error %d", wError);
+ debugLogA("Adding of group to server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Adding of group to server list failed."));
servlistPendingRemoveGroup(sc->szGroup, 0, PENDING_RESULT_FAILED);
@@ -539,7 +539,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
}
else
{
- NetLog_Server("Removing of contact from server list failed, error %d", wError);
+ debugLogA("Removing of contact from server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Removing of contact from server list failed."));
servlistPendingRemoveContact(sc->hContact, sc->wContactId, sc->wGroupId, PENDING_RESULT_FAILED);
@@ -552,7 +552,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
if (wError)
{
- NetLog_Server("Updating of group on server list failed, error %d", wError);
+ debugLogA("Updating of group on server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Updating of group on server list failed."));
}
SAFE_FREE((void**)&sc->szGroupName);
@@ -563,7 +563,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
SAFE_FREE((void**)&sc->szGroupName);
if (wError)
{
- NetLog_Server("Removing of group from server list failed, error %d", wError);
+ debugLogA("Removing of group from server list failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Removing of group from server list failed."));
servlistPendingRemoveGroup(sc->szGroup, 0, PENDING_RESULT_FAILED);
@@ -613,13 +613,13 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
if (!getByte(sc->hContact, "Auth", 0))
{ // we tried without AWAIT_AUTH, try again with it
- NetLog_Server("Contact could not be added without authorization, add with await auth flag.");
+ debugLogA("Contact could not be added without authorization, add with await auth flag.");
setByte(sc->hContact, "Auth", 1); // we need auth
}
else
{ // we tried with AWAIT_AUTH, try again without
- NetLog_Server("Contact count not be added awaiting authorization, try authorized.");
+ debugLogA("Contact count not be added awaiting authorization, try authorized.");
setByte(sc->hContact, "Auth", 0);
}
@@ -631,7 +631,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
break;
}
FreeServerID(sc->wNewContactId, SSIT_ITEM);
- NetLog_Server("Moving of user to another group on server list failed, error %d", wError);
+ debugLogA("Moving of user to another group on server list failed, error %d", wError);
icq_LogMessage(LOG_ERROR, LPGEN("Moving of user to another group on server list failed."));
servlistPendingRemoveContact(sc->hContact, 0, (WORD)(sc->lParam ? sc->wGroupId : sc->wNewGroupId), PENDING_RESULT_FAILED);
@@ -697,7 +697,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
if (wError)
{
- NetLog_Server("Renaming of server group failed, error %d", wError);
+ debugLogA("Renaming of server group failed, error %d", wError);
icq_LogMessage(LOG_WARNING, LPGEN("Renaming of server group failed."));
servlistPendingRemoveGroup(sc->szGroup, sc->wGroupId, PENDING_RESULT_FAILED);
@@ -723,7 +723,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{
if (wError)
{
- NetLog_Server("Uploading of avatar hash failed.");
+ debugLogA("Uploading of avatar hash failed.");
if (sc->wGroupId) // is avatar added or updated?
{
FreeServerID(sc->wContactId, SSIT_ITEM);
@@ -739,7 +739,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
case SSA_REMOVEAVATAR:
{
if (wError)
- NetLog_Server("Removing of avatar hash failed.");
+ debugLogA("Removing of avatar hash failed.");
else
{
FreeServerID(sc->wContactId, SSIT_ITEM);
@@ -755,7 +755,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
case SSA_IMPORT:
{
if (wError)
- NetLog_Server("Re-starting import sequence failed, error %d", wError);
+ debugLogA("Re-starting import sequence failed, error %d", wError);
else
{
setWord("SrvImportID", 0);
@@ -764,7 +764,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
break;
}
default:
- NetLog_Server("Server ack cookie type (%d) not recognized.", sc->dwAction);
+ debugLogA("Server ack cookie type (%d) not recognized.", sc->dwAction);
}
SAFE_FREE((void**)&sc); // free the memory
@@ -857,32 +857,32 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// server list.
unpackWord(&buf, &wRecordCount);
wLen -= 2;
- NetLog_Server("SSI: number of entries is %u, version is %u", wRecordCount, bySSIVersion);
+ debugLogA("SSI: number of entries is %u, version is %u", wRecordCount, bySSIVersion);
// Loop over all items in the packet
for (wRecord = 0; wRecord < wRecordCount; wRecord++)
{
- NetLog_Server("SSI: parsing record %u", wRecord + 1);
+ debugLogA("SSI: parsing record %u", wRecord + 1);
if (wLen < 10)
{ // minimum: name length (zero), group ID, item ID, empty TLV
- NetLog_Server("Warning: SSI parsing error (%d)", 0);
+ debugLogA("Warning: SSI parsing error (%d)", 0);
break;
}
if (!unpackServerListItem(&buf, &wLen, szRecordName, &wGroupId, &wItemId, &wTlvType, &wTlvLength))
{ // unpack basic structure
- NetLog_Server("Warning: SSI parsing error (%d)", 1);
+ debugLogA("Warning: SSI parsing error (%d)", 1);
break;
}
- NetLog_Server("Name: '%s', GroupID: %u, EntryID: %u, EntryType: %u, TLVlength: %u",
+ debugLogA("Name: '%s', GroupID: %u, EntryID: %u, EntryType: %u, TLVlength: %u",
szRecordName, wGroupId, wItemId, wTlvType, wTlvLength);
if (wLen < wTlvLength)
{
- NetLog_Server("Warning: SSI parsing error (%d)", 2);
+ debugLogA("Warning: SSI parsing error (%d)", 2);
break;
}
@@ -916,7 +916,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (bAdded)
{ // Not already on list: added
- NetLog_Server("SSI added new %s contact '%s'", "ICQ", szRecordName);
+ debugLogA("SSI added new %s contact '%s'", "ICQ", szRecordName);
AddJustAddedContact(hContact);
}
@@ -928,7 +928,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
bAdded = 1; // we want details for new contacts
}
else
- NetLog_Server("SSI ignoring existing contact '%s'", szRecordName);
+ debugLogA("SSI ignoring existing contact '%s'", szRecordName);
// Contact on server is always on list
db_set_b(hContact, "CList", "NotOnList", 0);
}
@@ -998,7 +998,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
memcpy(pszNick, pTLV->pData, wNickLength);
pszNick[wNickLength] = 0; // Terminate string
- NetLog_Server("Nickname is '%s'", pszNick);
+ debugLogA("Nickname is '%s'", pszNick);
bNicked = 1;
@@ -1031,7 +1031,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- NetLog_Server("Invalid nickname");
+ debugLogA("Invalid nickname");
}
}
if (bAdded && !bNicked)
@@ -1053,7 +1053,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
memcpy(pszComment, pTLV->pData, wCommentLength);
pszComment[wCommentLength] = 0; // Terminate string
- NetLog_Server("Comment is '%s'", pszComment);
+ debugLogA("Comment is '%s'", pszComment);
// Write comment to database
if (getByte("LoadServerDetails", DEFAULT_SS_LOAD) || bAdded)
@@ -1080,7 +1080,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- NetLog_Server("Invalid comment");
+ debugLogA("Invalid comment");
}
}
@@ -1088,7 +1088,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (pChain->getTLV(SSI_TLV_AWAITING_AUTH, 1))
{
setByte(hContact, "Auth", 1);
- NetLog_Server("SSI contact need authorization");
+ debugLogA("SSI contact need authorization");
}
else
{
@@ -1100,7 +1100,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setSettingBlob(hContact, DBSETTING_METAINFO_TOKEN, pTLV->pData, pTLV->wLen);
if (pChain->getTLV(SSI_TLV_METAINFO_TIME, 1))
setSettingDouble(hContact, DBSETTING_METAINFO_TIME, pChain->getDouble(SSI_TLV_METAINFO_TIME, 1));
- NetLog_Server("SSI contact has meta info token");
+ debugLogA("SSI contact has meta info token");
}
else
{
@@ -1123,7 +1123,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{ // failed to add or other error
- NetLog_Server("SSI failed to handle %s Item '%s'", "Buddy", szRecordName);
+ debugLogA("SSI failed to handle %s Item '%s'", "Buddy", szRecordName);
}
}
break;
@@ -1146,7 +1146,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setServListGroupName(wGroupId, szRecordName);
- NetLog_Server("Group %s added to known groups.", szRecordName);
+ debugLogA("Group %s added to known groups.", szRecordName);
/* demangle full grouppath, set it to known */
SAFE_FREE(&szActiveSrvGroup);
@@ -1158,12 +1158,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- NetLog_Server("Unhandled type 0x01, wItemID != 0");
+ debugLogA("Unhandled type 0x01, wItemID != 0");
}
}
else
{
- NetLog_Server("Unhandled type 0x01");
+ debugLogA("Unhandled type 0x01");
}
break;
@@ -1181,25 +1181,25 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
{
if (bAdded)
{
- NetLog_Server("SSI added new %s contact '%s'", "Permit", szRecordName);
+ debugLogA("SSI added new %s contact '%s'", "Permit", szRecordName);
// It wasn't previously in the list, we hide it so it only appears in the visible list
setContactHidden(hContact, 1);
// Add it to the list, so it can be added properly if proper contact
AddJustAddedContact(hContact);
}
else
- NetLog_Server("SSI %s contact already exists '%s'", "Permit", szRecordName);
+ debugLogA("SSI %s contact already exists '%s'", "Permit", szRecordName);
// Save permit ID
setWord(hContact, DBSETTING_SERVLIST_PERMIT, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
// Set apparent mode
setWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
- NetLog_Server("Visible-contact (%s)", szRecordName);
+ debugLogA("Visible-contact (%s)", szRecordName);
}
else
{ // failed to add or other error
- NetLog_Server("SSI failed to handle %s Item '%s'", "Permit", szRecordName);
+ debugLogA("SSI failed to handle %s Item '%s'", "Permit", szRecordName);
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
}
@@ -1221,14 +1221,14 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (bAdded)
{
/* not already on list: added */
- NetLog_Server("SSI added new %s contact '%s'", "Deny", szRecordName);
+ debugLogA("SSI added new %s contact '%s'", "Deny", szRecordName);
// It wasn't previously in the list, we hide it so it only appears in the visible list
setContactHidden(hContact, 1);
// Add it to the list, so it can be added properly if proper contact
AddJustAddedContact(hContact);
}
else
- NetLog_Server("SSI %s contact already exists '%s'", "Deny", szRecordName);
+ debugLogA("SSI %s contact already exists '%s'", "Deny", szRecordName);
// Save Deny ID
setWord(hContact, DBSETTING_SERVLIST_DENY, wItemId);
@@ -1236,11 +1236,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// Set apparent mode
setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
- NetLog_Server("Invisible-contact (%s)", szRecordName);
+ debugLogA("Invisible-contact (%s)", szRecordName);
}
else
{ // failed to add or other error
- NetLog_Server("SSI failed to handle %s Item '%s'", "Deny", szRecordName);
+ debugLogA("SSI failed to handle %s Item '%s'", "Deny", szRecordName);
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
}
@@ -1257,7 +1257,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setWord(DBSETTING_SERVLIST_PRIVACY, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
- NetLog_Server("Visibility is %u", bVisibility);
+ debugLogA("Visibility is %u", bVisibility);
}
else
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
@@ -1279,14 +1279,14 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (bAdded)
{
/* not already on list: add */
- NetLog_Server("SSI added new %s contact '%s'", "Ignore", szRecordName);
+ debugLogA("SSI added new %s contact '%s'", "Ignore", szRecordName);
// It wasn't previously in the list, we hide it
setContactHidden(hContact, 1);
// Add it to the list, so it can be added properly if proper contact
AddJustAddedContact(hContact);
}
else
- NetLog_Server("SSI %s contact already exists '%s'", "Ignore", szRecordName);
+ debugLogA("SSI %s contact already exists '%s'", "Ignore", szRecordName);
// Save Ignore ID
setWord(hContact, DBSETTING_SERVLIST_IGNORE, wItemId);
@@ -1296,11 +1296,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
// set ignore all events
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_ALL);
- NetLog_Server("Ignore-contact (%s)", szRecordName);
+ debugLogA("Ignore-contact (%s)", szRecordName);
}
else
{ // failed to add or other error
- NetLog_Server("SSI failed to handle %s Item '%s'", "Ignore", szRecordName);
+ debugLogA("SSI failed to handle %s Item '%s'", "Ignore", szRecordName);
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
}
@@ -1308,7 +1308,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
break;
case SSI_ITEM_UNKNOWN2:
- NetLog_Server("SSI unknown type 0x11");
+ debugLogA("SSI unknown type 0x11");
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
break;
@@ -1322,7 +1322,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setDword("ImportTS", pChain->getDWord(SSI_TLV_TIMESTAMP, 1));
setWord("SrvImportID", wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
- NetLog_Server("SSI %s item recognized", "first import");
+ debugLogA("SSI %s item recognized", "first import");
}
break;
@@ -1337,12 +1337,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (!strcmpnull(szRecordName, "12"))
{ // need to handle Photo Item separately
setWord(DBSETTING_SERVLIST_PHOTO, wItemId);
- NetLog_Server("SSI %s item recognized", "Photo");
+ debugLogA("SSI %s item recognized", "Photo");
}
else
{
setWord(DBSETTING_SERVLIST_AVATAR, wItemId);
- NetLog_Server("SSI %s item recognized", "Avatar");
+ debugLogA("SSI %s item recognized", "Avatar");
}
ReserveServerID(wItemId, SSIT_ITEM, 0);
}
@@ -1364,7 +1364,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
setWord(DBSETTING_SERVLIST_METAINFO, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
- NetLog_Server("SSI %s item recognized", "Meta info");
+ debugLogA("SSI %s item recognized", "Meta info");
}
break;
@@ -1382,7 +1382,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
break;
default:
- NetLog_Server("SSI unhandled item %2x", wTlvType);
+ debugLogA("SSI unhandled item %2x", wTlvType);
if (wItemId)
ReserveServerID(wItemId, SSIT_ITEM, SSIF_UNHANDLED);
@@ -1395,7 +1395,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// Release Memory
SAFE_FREE(&szActiveSrvGroup);
- NetLog_Server("Bytes left: %u", wLen);
+ debugLogA("Bytes left: %u", wLen);
setWord("SrvRecordCount", (WORD)(wRecord + getWord("SrvRecordCount", 0)));
@@ -1415,7 +1415,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* finally we get a time_t of the last update time */
unpackDWord(&buf, &dwLastUpdateTime);
setDword("SrvLastUpdate", dwLastUpdateTime);
- NetLog_Server("Last update of server list was (%u) %s", dwLastUpdateTime, time2text(dwLastUpdateTime));
+ debugLogA("Last update of server list was (%u) %s", dwLastUpdateTime, time2text(dwLastUpdateTime));
sendRosterAck();
handleServUINSettings(wListenPort, info);
@@ -1424,7 +1424,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- NetLog_Server("Last packet missed update time...");
+ debugLogA("Last packet missed update time...");
}
if (getWord("SrvRecordCount", 0) == 0)
{ // we got empty serv-list, create master group
@@ -1444,7 +1444,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- NetLog_Server("Waiting for more packets");
+ debugLogA("Waiting for more packets");
}
}
@@ -1459,7 +1459,7 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId
setWord("SrvImportID", wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
- NetLog_Server("Server added Import timestamp to list");
+ debugLogA("Server added Import timestamp to list");
return;
}
@@ -1513,9 +1513,9 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
if (!pToken || dbv.cpbVal != pToken->wLen || memcmp(dbv.pbVal, pToken->pData, dbv.cpbVal))
{
if (!pToken)
- NetLog_Server("Contact %s, meta info token removed", szRecordName);
+ debugLogA("Contact %s, meta info token removed", szRecordName);
else
- NetLog_Server("Contact %s, meta info token changed", szRecordName);
+ debugLogA("Contact %s, meta info token changed", szRecordName);
// user info was changed, refresh
if (IsMetaInfoChanged(hContact))
@@ -1526,7 +1526,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
}
else if (pToken)
{
- NetLog_Server("Contact %s, meta info token added", szRecordName);
+ debugLogA("Contact %s, meta info token added", szRecordName);
// user info was changed, refresh
if (IsMetaInfoChanged(hContact))
@@ -1563,9 +1563,9 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
if (!pToken || dbv.cpbVal != pToken->wLen || memcmp(dbv.pbVal, pToken->pData, dbv.cpbVal))
{
if (!pToken)
- NetLog_Server("Owner meta info token removed");
+ debugLogA("Owner meta info token removed");
else
- NetLog_Server("Owner meta info token changed");
+ debugLogA("Owner meta info token changed");
}
db_free(&dbv);
@@ -1579,7 +1579,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
}
else if (wItemType == SSI_ITEM_GROUP)
{ // group updated
- NetLog_Server("Server updated our group \"%s\" on list", szRecordName);
+ debugLogA("Server updated our group \"%s\" on list", szRecordName);
}
}
@@ -1622,7 +1622,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen)
if (dwUin && IsOnSpammerList(dwUin))
{
- NetLog_Server("Ignored Message from known Spammer");
+ debugLogA("Ignored Message from known Spammer");
return;
}
@@ -1716,7 +1716,7 @@ void CIcqProto::handleRecvAdded(unsigned char *buf, WORD wLen)
if (dwUin && IsOnSpammerList(dwUin))
{
- NetLog_Server("Ignored Message from known Spammer");
+ debugLogA("Ignored Message from known Spammer");
return;
}
@@ -1778,7 +1778,7 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen)
if (dwUin && IsOnSpammerList(dwUin))
{
- NetLog_Server("Ignored Message from known Spammer");
+ debugLogA("Ignored Message from known Spammer");
return;
}
@@ -1807,18 +1807,18 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen)
{
case 0:
- NetLog_Server("Authorization request %s by %s", "denied", strUID(dwUin, szUid));
+ debugLogA("Authorization request %s by %s", "denied", strUID(dwUin, szUid));
// TODO: Add to system history as soon as new auth system is ready
break;
case 1:
setByte(hContact, "Auth", 0);
- NetLog_Server("Authorization request %s by %s", "granted", strUID(dwUin, szUid));
+ debugLogA("Authorization request %s by %s", "granted", strUID(dwUin, szUid));
// TODO: Add to system history as soon as new auth system is ready
break;
default:
- NetLog_Server("Unknown Authorization request response (%u) from %s", bResponse, strUID(dwUin, szUid));
+ debugLogA("Unknown Authorization request response (%u) from %s", bResponse, strUID(dwUin, szUid));
break;
}
@@ -1860,13 +1860,13 @@ void CIcqProto::updateServVisibilityCode(BYTE bCode)
setWord(DBSETTING_SERVLIST_PRIVACY, wVisibilityID);
wCommand = ICQ_LISTS_ADDTOLIST;
#ifdef _DEBUG
- NetLog_Server("Made new srvVisibilityID, id is %u, code is %u", wVisibilityID, bCode);
+ debugLogA("Made new srvVisibilityID, id is %u, code is %u", wVisibilityID, bCode);
#endif
}
else
{
#ifdef _DEBUG
- NetLog_Server("Reused srvVisibilityID, id is %u, code is %u", wVisibilityID, bCode);
+ debugLogA("Reused srvVisibilityID, id is %u, code is %u", wVisibilityID, bCode);
#endif
wCommand = ICQ_LISTS_UPDATEGROUP;
}
@@ -1874,7 +1874,7 @@ void CIcqProto::updateServVisibilityCode(BYTE bCode)
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
{
- NetLog_Server("Cookie alloc failure.");
+ debugLogA("Cookie alloc failure.");
return; // out of memory, go away
}
ack->dwAction = SSA_VISIBILITY; // update visibility
@@ -1937,7 +1937,7 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
{
- NetLog_Server("Cookie alloc failure.");
+ debugLogA("Cookie alloc failure.");
return; // out of memory, go away
}
ack->dwAction = SSA_REMOVEAVATAR; // update avatar hash
@@ -1963,13 +1963,13 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
wAvatarID = GenerateServerID(SSIT_ITEM, 0);
wCommand = ICQ_LISTS_ADDTOLIST;
#ifdef _DEBUG
- NetLog_Server("Made new srvAvatarID, id is %u", wAvatarID);
+ debugLogA("Made new srvAvatarID, id is %u", wAvatarID);
#endif
}
else
{
#ifdef _DEBUG
- NetLog_Server("Reused srvAvatarID, id is %u", wAvatarID);
+ debugLogA("Reused srvAvatarID, id is %u", wAvatarID);
#endif
wCommand = ICQ_LISTS_UPDATEGROUP;
}
@@ -1977,7 +1977,7 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
{
- NetLog_Server("Cookie alloc failure.");
+ debugLogA("Cookie alloc failure.");
return; // out of memory, go away
}
ack->dwAction = SSA_SETAVATAR; // update avatar hash
@@ -2056,6 +2056,6 @@ void CIcqProto::sendRosterAck(void)
sendServPacket(&packet);
#ifdef _DEBUG
- NetLog_Server("Sent SNAC(x13,x07) - CLI_ROSTERACK");
+ debugLogA("Sent SNAC(x13,x07) - CLI_ROSTERACK");
#endif
}
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
index 3e4a6654ad..327e6cbc35 100644
--- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp
+++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
@@ -42,7 +42,7 @@ void CIcqProto::handleIcqExtensionsFam(BYTE *pBuffer, WORD wBufferLength, snac_h
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_EXTENSIONS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_EXTENSIONS_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -99,25 +99,25 @@ void CIcqProto::handleExtensionError(BYTE *buf, WORD wPackLen)
ReleaseCookie(wCookie); // we do not leak cookie and memory
}
- NetLog_Server("Full info request error 0x%02x received", wErrorCode);
+ debugLogA("Full info request error 0x%02x received", wErrorCode);
}
else if (wSubType == META_SET_PASSWORD_REQ)
{
// failed to change user password, report to UI
ProtoBroadcastAck(NULL, ACKTYPE_SETINFO, ACKRESULT_FAILED, (HANDLE)wCookie, 0);
- NetLog_Server("Meta change password request failed, error 0x%02x", wErrorCode);
+ debugLogA("Meta change password request failed, error 0x%02x", wErrorCode);
}
else
- NetLog_Server("Meta request error 0x%02x received", wErrorCode);
+ debugLogA("Meta request error 0x%02x received", wErrorCode);
}
else
- NetLog_Server("Meta request error 0x%02x received", wErrorCode);
+ debugLogA("Meta request error 0x%02x received", wErrorCode);
break;
default:
- NetLog_Server("Unknown request 0x%02x error 0x%02x received", wData, wErrorCode);
+ debugLogA("Unknown request 0x%02x error 0x%02x received", wData, wErrorCode);
}
disposeChain(&chain);
return;
@@ -138,7 +138,7 @@ void CIcqProto::handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags)
chain = readIntoTLVChain(&buf, wPackLen, 0);
if (chain == NULL)
{
- NetLog_Server("Error: Broken snac 15/3 %d", 1);
+ debugLogA("Error: Broken snac 15/3 %d", 1);
return;
}
@@ -146,7 +146,7 @@ void CIcqProto::handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags)
if (dataTlv == NULL)
{
disposeChain(&chain);
- NetLog_Server("Error: Broken snac 15/3 %d", 2);
+ debugLogA("Error: Broken snac 15/3 %d", 2);
return;
}
BYTE *databuf = dataTlv->pData;
@@ -178,13 +178,13 @@ void CIcqProto::handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags)
break;
default:
- NetLog_Server("Warning: Ignoring Meta response - Unknown type %d", wRequestType);
+ debugLogA("Warning: Ignoring Meta response - Unknown type %d", wRequestType);
break;
}
}
}
else
- NetLog_Server("Error: Broken snac 15/3 %d", 3);
+ debugLogA("Error: Broken snac 15/3 %d", 3);
if (chain)
disposeChain(&chain);
@@ -271,7 +271,7 @@ void CIcqProto::handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD
}
// Parsing failure
- NetLog_Server("Error: Failure parsing META_SMS_DELIVERY_RECEIPT");
+ debugLogA("Error: Failure parsing META_SMS_DELIVERY_RECEIPT");
break;
case META_DIRECTORY_DATA:
@@ -279,14 +279,14 @@ void CIcqProto::handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD
if (bResultCode == 0x0A)
handleDirectoryQueryResponse(databuf, wPacketLen, wCookie, wReplySubtype, wFlags);
else
- NetLog_Server("Error: Directory request failed, code %u", bResultCode);
+ debugLogA("Error: Directory request failed, code %u", bResultCode);
break;
case META_DIRECTORY_UPDATE_ACK:
if (bResultCode == 0x0A)
handleDirectoryUpdateResponse(databuf, wPacketLen, wCookie, wReplySubtype);
else
- NetLog_Server("Error: Directory request failed, code %u", bResultCode);
+ debugLogA("Error: Directory request failed, code %u", bResultCode);
break;
case META_BASIC_USERINFO:
@@ -298,11 +298,11 @@ void CIcqProto::handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD
case META_AFFILATIONS_USERINFO:
case META_SHORT_USERINFO:
case META_HPAGECAT_USERINFO:
- NetLog_Server("Warning: Ignored 15/03 (legacy user info) replysubtype x%x", wReplySubtype);
+ debugLogA("Warning: Ignored 15/03 (legacy user info) replysubtype x%x", wReplySubtype);
break;
default:
- NetLog_Server("Warning: Ignored 15/03 replysubtype x%x", wReplySubtype);
+ debugLogA("Warning: Ignored 15/03 replysubtype x%x", wReplySubtype);
// _ASSERTE(0);
break;
}
@@ -312,7 +312,7 @@ void CIcqProto::handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD
}
// Failure
- NetLog_Server("Warning: Broken 15/03 ExtensionMetaResponse");
+ debugLogA("Warning: Broken 15/03 ExtensionMetaResponse");
}
@@ -350,7 +350,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD
if (!FindCookie(wCookie, NULL, (void**)&pCookie))
{
- NetLog_Server("Warning: Received unexpected search reply");
+ debugLogA("Warning: Received unexpected search reply");
pCookie = NULL;
}
@@ -362,9 +362,9 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD
case SRV_USER_FOUND: // Search: user found reply
if (bLastUser)
- NetLog_Server("SNAC(0x15,0x3): Last search reply");
+ debugLogA("SNAC(0x15,0x3): Last search reply");
else
- NetLog_Server("SNAC(0x15,0x3): Search reply");
+ debugLogA("SNAC(0x15,0x3): Search reply");
if (bResultCode == 0xA)
{
@@ -480,7 +480,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD
databuf += 5;
unpackLEDWord(&databuf, &dwLeft);
if (dwLeft)
- NetLog_Server("Warning: %d search results omitted", dwLeft);
+ debugLogA("Warning: %d search results omitted", dwLeft);
}
ReleaseSearchCookie(wCookie, pCookie);
}
@@ -489,7 +489,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD
else
{
// Failed search
- NetLog_Server("SNAC(0x15,0x3): Search error %u", bResultCode);
+ debugLogA("SNAC(0x15,0x3): Search error %u", bResultCode);
ReleaseSearchCookie(wCookie, pCookie);
@@ -507,7 +507,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD
// For debugging purposes only
if (!bParsingOK)
{
- NetLog_Server("Warning: Parsing error in 15/03 search reply type x%x", wReplySubtype);
+ debugLogA("Warning: Parsing error in 15/03 search reply type x%x", wReplySubtype);
_ASSERTE(!bParsingOK);
}
}
@@ -527,7 +527,7 @@ void CIcqProto::parseUserInfoUpdateAck(unsigned char *databuf, WORD wPacketLen,
break;
default:
- NetLog_Server("Warning: Ignored 15/03 user info update ack type x%x", wReplySubtype);
+ debugLogA("Warning: Ignored 15/03 user info update ack type x%x", wReplySubtype);
break;
}
}
@@ -634,7 +634,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
BYTE requestResult;
#ifdef _DEBUG
- NetLog_Server("Received directory query response");
+ debugLogA("Received directory query response");
#endif
if (wPacketLen >= 2)
unpackLEWord(&databuf, &wBytesRemaining);
@@ -643,7 +643,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
if (!unpackSnacHeader(&requestSnac, &databuf, &wPacketLen) || !requestSnac.bValid)
{
- NetLog_Server("Error: Failed to parse directory response");
+ debugLogA("Error: Failed to parse directory response");
return;
}
@@ -652,7 +652,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
// check request cookie
if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData)
{
- NetLog_Server("Warning: Ignoring unrequested directory reply type (x%x, x%x)", requestSnac.wFamily, requestSnac.wSubtype);
+ debugLogA("Warning: Ignoring unrequested directory reply type (x%x, x%x)", requestSnac.wFamily, requestSnac.wSubtype);
return;
}
/// FIXME: we should really check the snac contents according to cookie data here ??
@@ -664,14 +664,14 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
unpackByte(&databuf, &requestResult);
else
{
- NetLog_Server("Error: Malformed directory response");
+ debugLogA("Error: Malformed directory response");
if (!bMoreDataFollows)
ReleaseCookie(wCookie);
return;
}
if (requestResult != 1 && requestResult != 4)
{
- NetLog_Server("Error: Directory request failed, status %u", requestResult);
+ debugLogA("Error: Directory request failed, status %u", requestResult);
if (!bMoreDataFollows)
{
@@ -688,11 +688,11 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
unpackWord(&databuf, &wLen);
wPacketLen -= 3;
if (wLen)
- NetLog_Server("Warning: Data in error message present!");
+ debugLogA("Warning: Data in error message present!");
if (wPacketLen <= 0x16)
{ // sanity check
- NetLog_Server("Error: Malformed directory response");
+ debugLogA("Error: Malformed directory response");
if (!bMoreDataFollows)
{
@@ -717,11 +717,11 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
wPacketLen -= 6;
if (pCookieData->bRequestType == DIRECTORYREQUEST_SEARCH && !bMoreDataFollows)
- NetLog_Server("Directory Search: %d contacts found (%u pages)", dwItemCount, wPageCount);
+ debugLogA("Directory Search: %d contacts found (%u pages)", dwItemCount, wPageCount);
if (wPacketLen <= 2)
{ // sanity check, block expected
- NetLog_Server("Error: Malformed directory response");
+ debugLogA("Error: Malformed directory response");
if (!bMoreDataFollows)
{
@@ -745,7 +745,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
if (wData == 0 && pCookieData->bRequestType == DIRECTORYREQUEST_SEARCH)
{
- NetLog_Server("Directory Search: No contacts found");
+ debugLogA("Directory Search: No contacts found");
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)wCookie, 0);
ReleaseCookie(wCookie);
return;
@@ -754,7 +754,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
_ASSERTE(wData == 1 && wPacketLen == wLen);
if (wData != 1 || wPacketLen != wLen)
{
- NetLog_Server("Error: Malformed directory response (missing data)");
+ debugLogA("Error: Malformed directory response (missing data)");
if (!bMoreDataFollows)
{
@@ -781,7 +781,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
char *szUid = pDirectoryData->getString(0x32, 1);
if (!szUid)
{
- NetLog_Server("Error: Received unrecognized data from the directory");
+ debugLogA("Error: Received unrecognized data from the directory");
break;
}
@@ -790,7 +790,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
if (hContact != HContactFromUID(dwUin, szUid, NULL))
{
- NetLog_Server("Error: Received data does not match cookie contact, ignoring.");
+ debugLogA("Error: Received data does not match cookie contact, ignoring.");
SAFE_FREE(&szUid);
break;
}
@@ -807,12 +807,12 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR
break;
default:
- NetLog_Server("Error: Unknown cookie type %x for directory response!", pCookieData->bRequestType);
+ debugLogA("Error: Unknown cookie type %x for directory response!", pCookieData->bRequestType);
}
disposeChain(&pDirectoryData);
}
else
- NetLog_Server("Error: Failed parsing directory response");
+ debugLogA("Error: Failed parsing directory response");
// Release Memory
if (!bMoreDataFollows)
@@ -854,7 +854,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
char *szUid = cDetails->getString(0x32, 1);
if (!szUid)
{
- NetLog_Server("Error: Received unrecognized data from the directory");
+ debugLogA("Error: Received unrecognized data from the directory");
return;
}
@@ -864,13 +864,13 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
hContact = HContactFromUID(dwUin, szUid, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
- NetLog_Server("Error: Received details for unknown contact \"%s\"", szUid);
+ debugLogA("Error: Received details for unknown contact \"%s\"", szUid);
SAFE_FREE(&szUid);
return;
}
#ifdef _DEBUG
else
- NetLog_Server("Received user info for %s from directory", szUid);
+ debugLogA("Received user info for %s from directory", szUid);
#endif
SAFE_FREE(&szUid);
}
@@ -880,9 +880,9 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
char *szUid = cDetails->getString(0x32, 1);
if (!hContact)
- NetLog_Server("Received owner user info from directory");
+ debugLogA("Received owner user info from directory");
else
- NetLog_Server("Received user info for %s from directory", szUid);
+ debugLogA("Received user info for %s from directory", szUid);
SAFE_FREE(&szUid);
}
#endif
@@ -1050,7 +1050,7 @@ void CIcqProto::parseDirectorySearchData(oscar_tlv_chain *cDetails, DWORD dwCook
char *szUid = cDetails->getString(0x32, 1); // User ID
#ifdef _DEBUG
- NetLog_Server("Directory Search: Found user %s", szUid);
+ debugLogA("Directory Search: Found user %s", szUid);
#endif
isr.hdr.cbSize = sizeof(ICQSEARCHRESULT);
isr.hdr.flags = PSR_TCHAR;
@@ -1138,7 +1138,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
BYTE requestResult;
#ifdef _DEBUG
- NetLog_Server("Received directory update response");
+ debugLogA("Received directory update response");
#endif
if (wPacketLen >= 2)
unpackLEWord(&databuf, &wBytesRemaining);
@@ -1147,7 +1147,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
if (!unpackSnacHeader(&requestSnac, &databuf, &wPacketLen) || !requestSnac.bValid)
{
- NetLog_Server("Error: Failed to parse directory response");
+ debugLogA("Error: Failed to parse directory response");
return;
}
@@ -1156,7 +1156,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
// check request cookie
if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData)
{
- NetLog_Server("Warning: Ignoring unrequested directory reply type (x%x, x%x)", requestSnac.wFamily, requestSnac.wSubtype);
+ debugLogA("Warning: Ignoring unrequested directory reply type (x%x, x%x)", requestSnac.wFamily, requestSnac.wSubtype);
return;
}
/// FIXME: we should really check the snac contents according to cookie data here ??
@@ -1165,13 +1165,13 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
unpackByte(&databuf, &requestResult);
else
{
- NetLog_Server("Error: Malformed directory response");
+ debugLogA("Error: Malformed directory response");
ReleaseCookie(wCookie);
return;
}
if (requestResult != 1 && requestResult != 4)
{
- NetLog_Server("Error: Directory request failed, status %u", requestResult);
+ debugLogA("Error: Directory request failed, status %u", requestResult);
if (pCookieData->bRequestType == DIRECTORYREQUEST_UPDATEOWNER)
ProtoBroadcastAck(NULL, ACKTYPE_SETINFO, ACKRESULT_FAILED, (HANDLE)wCookie, 0);
@@ -1184,7 +1184,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
unpackWord(&databuf, &wLen);
wPacketLen -= 3;
if (wLen)
- NetLog_Server("Warning: Data in error message present!");
+ debugLogA("Warning: Data in error message present!");
if (pCookieData->bRequestType == DIRECTORYREQUEST_UPDATEOWNER)
ProtoBroadcastAck(NULL, ACKTYPE_SETINFO, ACKRESULT_SUCCESS, (HANDLE)wCookie, 0);
diff --git a/protocols/IcqOscarJ/src/fam_17signon.cpp b/protocols/IcqOscarJ/src/fam_17signon.cpp
index c4c546ca60..2ac1de498d 100644
--- a/protocols/IcqOscarJ/src/fam_17signon.cpp
+++ b/protocols/IcqOscarJ/src/fam_17signon.cpp
@@ -55,7 +55,7 @@ void CIcqProto::handleAuthorizationFam(BYTE *pBuffer, WORD wBufferLength, snac_h
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_AUTHORIZATION_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_AUTHORIZATION_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -135,12 +135,12 @@ void CIcqProto::handleAuthKeyResponse(BYTE *buf, WORD wPacketLen, serverthread_i
BYTE digest[16];
#ifdef _DEBUG
- NetLog_Server("Received %s", "ICQ_SIGNON_AUTH_KEY");
+ debugLogA("Received %s", "ICQ_SIGNON_AUTH_KEY");
#endif
if (wPacketLen < 2)
{
- NetLog_Server("Malformed %s", "ICQ_SIGNON_AUTH_KEY");
+ debugLogA("Malformed %s", "ICQ_SIGNON_AUTH_KEY");
icq_LogMessage(LOG_FATAL, LPGEN("Secure login failed.\nInvalid server response."));
SetCurrentStatus(ID_STATUS_OFFLINE);
return;
@@ -151,7 +151,7 @@ void CIcqProto::handleAuthKeyResponse(BYTE *buf, WORD wPacketLen, serverthread_i
if (!wKeyLen || wKeyLen > wPacketLen || wKeyLen > sizeof(szKey))
{
- NetLog_Server("Invalid length in %s: %u", "ICQ_SIGNON_AUTH_KEY", wKeyLen);
+ debugLogA("Invalid length in %s: %u", "ICQ_SIGNON_AUTH_KEY", wKeyLen);
icq_LogMessage(LOG_FATAL, LPGEN("Secure login failed.\nInvalid key length."));
SetCurrentStatus(ID_STATUS_OFFLINE);
return;
@@ -170,7 +170,7 @@ void CIcqProto::handleAuthKeyResponse(BYTE *buf, WORD wPacketLen, serverthread_i
mir_md5_finish(&state, digest);
#ifdef _DEBUG
- NetLog_Server("Sending ICQ_SIGNON_LOGIN_REQUEST to login server");
+ debugLogA("Sending ICQ_SIGNON_LOGIN_REQUEST to login server");
#endif
sendClientAuth((char*)digest, 0x10, TRUE);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index b50330a1b9..f5eb6ce4e0 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -233,11 +233,11 @@ void CIcqProto::StartAvatarThread(HANDLE hConn, char *cookie, WORD cookieLen) //
if (m_avatarsConnection && m_avatarsConnection->isPending())
{
- NetLog_Server("Avatar, Multiple start thread attempt, ignored.");
+ debugLogA("Avatar, Multiple start thread attempt, ignored.");
SAFE_FREE((void**)&cookie);
return;
}
- NetLog_Server("Avatars: Connection failed");
+ debugLogA("Avatars: Connection failed");
m_avatarsConnectionPending = FALSE;
@@ -270,7 +270,7 @@ void CIcqProto::StartAvatarThread(HANDLE hConn, char *cookie, WORD cookieLen) //
if (m_avatarsConnection && m_avatarsConnection->isPending())
{
- NetLog_Server("Avatar, Multiple start thread attempt, ignored.");
+ debugLogA("Avatar, Multiple start thread attempt, ignored.");
NetLib_CloseConnection(&hConn, FALSE);
@@ -305,11 +305,11 @@ void CIcqProto::StopAvatarThread()
static void NetLog_Hash(CIcqProto *ppro, const char *pszIdent, const BYTE *pHash, int nHashLen)
{
if (nHashLen == 0x14)
- ppro->NetLog_Server("Avatars: %s hash: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", pszIdent, pHash[0], pHash[1], pHash[2], pHash[3], pHash[4], pHash[5], pHash[6], pHash[7], pHash[8], pHash[9], pHash[10], pHash[11], pHash[12], pHash[13], pHash[14], pHash[15], pHash[16], pHash[17], pHash[18], pHash[19]);
+ ppro->debugLogA("Avatars: %s hash: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", pszIdent, pHash[0], pHash[1], pHash[2], pHash[3], pHash[4], pHash[5], pHash[6], pHash[7], pHash[8], pHash[9], pHash[10], pHash[11], pHash[12], pHash[13], pHash[14], pHash[15], pHash[16], pHash[17], pHash[18], pHash[19]);
else if (nHashLen == 0x09)
- ppro->NetLog_Server("Avatars: %s hash: %02X%02X%02X%02X%02X%02X%02X%02X%02X", pszIdent, pHash[0], pHash[1], pHash[2], pHash[3], pHash[4], pHash[5], pHash[6], pHash[7], pHash[8]);
+ ppro->debugLogA("Avatars: %s hash: %02X%02X%02X%02X%02X%02X%02X%02X%02X", pszIdent, pHash[0], pHash[1], pHash[2], pHash[3], pHash[4], pHash[5], pHash[6], pHash[7], pHash[8]);
else
- ppro->NetLog_Server("Avatars: %s hash: Unknown hash format.", pszIdent);
+ ppro->debugLogA("Avatars: %s hash: Unknown hash format.", pszIdent);
}
#endif
@@ -332,7 +332,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
{ // we have no avatar file, download from server
TCHAR szFile[MAX_PATH * 2 + 4];
#ifdef _DEBUG
- NetLog_Server("We have no avatar, requesting from server.");
+ debugLogA("We have no avatar, requesting from server.");
#endif
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
@@ -345,7 +345,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
{ // hash could not be calculated - probably missing file, get avatar from server
TCHAR szFile[MAX_PATH * 2 + 4];
#ifdef _DEBUG
- NetLog_Server("We have no avatar, requesting from server.");
+ debugLogA("We have no avatar, requesting from server.");
#endif
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
@@ -357,7 +357,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
DWORD dwPaFormat = ::ProtoGetAvatarFileFormat(file);
BYTE *pHash = (BYTE*)_alloca(0x14);
- NetLog_Server("Our avatar is different, setting our new hash.");
+ debugLogA("Our avatar is different, setting our new hash.");
pHash[0] = 0;
pHash[1] = dwPaFormat == PA_FORMAT_XML ? AVATAR_HASH_FLASH : AVATAR_HASH_STATIC;
@@ -370,7 +370,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
{ // get avatar from server
TCHAR tszFile[MAX_PATH * 2 + 4];
#ifdef _DEBUG
- NetLog_Server("We have different avatar, requesting new from server.");
+ debugLogA("We have different avatar, requesting new from server.");
#endif
GetAvatarFileName(0, NULL, tszFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, tszFile);
@@ -389,7 +389,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
TCHAR *file = GetOwnAvatarFileName();
if (!file)
{ // we have no file to upload, remove hash from server
- NetLog_Server("We do not have avatar, removing hash.");
+ debugLogA("We do not have avatar, removing hash.");
SetMyAvatar(0, 0);
break;
}
@@ -398,7 +398,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
if (!hash)
{ // the hash could not be calculated, remove from server
- NetLog_Server("We could not obtain hash, removing hash.");
+ debugLogA("We could not obtain hash, removing hash.");
SetMyAvatar(0, 0);
}
else if (!memcmp(hash, pData + 4, 0x10))
@@ -407,7 +407,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
BYTE *ppMap = NULL;
long cbFileSize = 0;
- NetLog_Server("Uploading our avatar data.");
+ debugLogA("Uploading our avatar data.");
if ((hFile = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL )) != INVALID_HANDLE_VALUE)
if ((hMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
@@ -428,7 +428,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
{
BYTE *pHash = (BYTE*)_alloca(0x14);
- NetLog_Server("Our file is different, set our new hash.");
+ debugLogA("Our file is different, set our new hash.");
pHash[0] = 0;
pHash[1] = dwPaFormat == PA_FORMAT_XML ? AVATAR_HASH_FLASH : AVATAR_HASH_STATIC;
@@ -444,7 +444,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
break;
}
default:
- NetLog_Server("Received UNKNOWN Avatar Status.");
+ debugLogA("Received UNKNOWN Avatar Status.");
}
}
}
@@ -532,14 +532,13 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
NetLog_Hash(this, "old", dbv.pbVal, dbv.cpbVal);
#endif
db_free(&dbv);
- NetLog_Server("%s has removed Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has removed Avatar.", strUID(dwUIN, szUID));
delSetting(hContact, "AvatarHash");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
#ifdef _DEBUG
- else
- NetLog_Server("%s has empty Avatar.", strUID(dwUIN, szUID));
+ else debugLogA("%s has empty Avatar.", strUID(dwUIN, szUID));
#endif
return;
}
@@ -556,7 +555,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
if (_taccess(tszAvatar, 0) == 0)
{ // the file is there, link to contactphoto, save hash
- NetLog_Server("%s has published Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
+ debugLogA("%s has published Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
#ifdef _DEBUG
NetLog_Hash(this, "new", pAvatarHash, cbAvatarHash);
#endif
@@ -565,7 +564,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
}
else
{ // the file was lost, request avatar again
- NetLog_Server("%s has published Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has published Avatar.", strUID(dwUIN, szUID));
#ifdef _DEBUG
NetLog_Hash(this, "new", pAvatarHash, cbAvatarHash);
#endif
@@ -574,7 +573,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
}
else
{ // the hash is not the one we want, request avatar
- NetLog_Server("%s has published a new Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has published a new Avatar.", strUID(dwUIN, szUID));
#ifdef _DEBUG
NetLog_Hash(this, "new", pAvatarHash, cbAvatarHash);
#endif
@@ -588,7 +587,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
#ifdef _DEBUG
NetLog_Hash(this, "old", dbv.pbVal, dbv.cpbVal);
#endif
- NetLog_Server("%s has changed Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has changed Avatar.", strUID(dwUIN, szUID));
#ifdef _DEBUG
NetLog_Hash(this, "new", pAvatarHash, cbAvatarHash);
#endif
@@ -607,7 +606,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
#ifdef _DEBUG
NetLog_Hash(this, "current", dbv.pbVal, dbv.cpbVal);
#endif
- NetLog_Server("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
+ debugLogA("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
bJob = 2;
}
else
@@ -618,7 +617,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
#ifdef _DEBUG
NetLog_Hash(this, "current", dbv.pbVal, dbv.cpbVal);
#endif
- NetLog_Server("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
+ debugLogA("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
bJob = 2;
}
#ifdef _DEBUG
@@ -626,7 +625,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
{
NetLog_Hash(this, "current", dbv.pbVal, dbv.cpbVal);
- NetLog_Server("%s has Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
+ debugLogA("%s has Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
}
#endif
}
@@ -636,7 +635,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
#ifdef _DEBUG
NetLog_Hash(this, "current", dbv.pbVal, dbv.cpbVal);
#endif
- NetLog_Server("%s has Avatar. Image was not retrieved yet.", strUID(dwUIN, szUID));
+ debugLogA("%s has Avatar. Image was not retrieved yet.", strUID(dwUIN, szUID));
bJob = 2;
}
}
@@ -683,14 +682,14 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
NetLog_Hash(this, "old", dbv.pbVal, dbv.cpbVal);
#endif
db_free(&dbv);
- NetLog_Server("%s has removed Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has removed Avatar.", strUID(dwUIN, szUID));
delSetting(hContact, "AvatarHash");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
#ifdef _DEBUG
else
- NetLog_Server("%s has no Avatar.", strUID(dwUIN, szUID));
+ debugLogA("%s has no Avatar.", strUID(dwUIN, szUID));
#endif
}
}
@@ -724,7 +723,7 @@ int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, co
continue;
}
m_avatarsMutex->Leave();
- NetLog_Server("Avatars: Requests for %s avatar are blocked.", strUID(dwUin, pszUid));
+ debugLogA("Avatars: Requests for %s avatar are blocked.", strUID(dwUin, pszUid));
return 0;
}
ar = ar->pNext;
@@ -761,7 +760,7 @@ int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, co
continue;
}
m_avatarsMutex->Leave();
- NetLog_Server("Avatars: Ignoring duplicate get %s avatar request.", strUID(dwUin, pszUid));
+ debugLogA("Avatars: Ignoring duplicate get %s avatar request.", strUID(dwUin, pszUid));
// make sure avatar connection is in progress
requestAvatarConnection();
@@ -794,7 +793,7 @@ int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, co
m_avatarsQueue = ar;
m_avatarsMutex->Leave();
- NetLog_Server("Avatars: Request to get %s image added to queue.", strUID(dwUin, pszUid));
+ debugLogA("Avatars: Request to get %s image added to queue.", strUID(dwUin, pszUid));
// make sure avatar connection is in progress
requestAvatarConnection();
@@ -837,7 +836,7 @@ int CIcqProto::SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsig
if (ar->hContact == hContact && ar->type == ART_UPLOAD)
{ // we found it, return error
m_avatarsMutex->Leave();
- NetLog_Server("Avatars: Ignoring duplicate upload avatar request.");
+ debugLogA("Avatars: Ignoring duplicate upload avatar request.");
// make sure avatar connection is in progress
requestAvatarConnection();
@@ -867,7 +866,7 @@ int CIcqProto::SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsig
m_avatarsQueue = ar;
m_avatarsMutex->Leave();
- NetLog_Server("Avatars: Request to upload image added to queue.");
+ debugLogA("Avatars: Request to upload image added to queue.");
// make sure avatar connection is in progress
requestAvatarConnection();
@@ -893,7 +892,7 @@ void CIcqProto::requestAvatarConnection()
void __cdecl CIcqProto::AvatarThread(avatars_server_connection *pInfo)
{
- NetLog_Server("%s thread started.", "Avatar");
+ debugLogA("%s thread started.", "Avatar");
// Execute connection handler
pInfo->connectionThread();
@@ -909,7 +908,7 @@ void __cdecl CIcqProto::AvatarThread(avatars_server_connection *pInfo)
delete pInfo;
}
- NetLog_Server("%s thread ended.", "Avatar");
+ debugLogA("%s thread ended.", "Avatar");
}
@@ -940,19 +939,6 @@ avatars_server_connection::~avatars_server_connection()
}
-int avatars_server_connection::NetLog_Server(const char *fmt,...)
-{
- va_list va;
- char szText[1024 + 9];
-
- strcpy(szText, "Avatars: ");
- va_start(va, fmt);
- mir_vsnprintf(szText + 9, sizeof(szText) - 9, fmt, va);
- va_end(va);
- return CallService(MS_NETLIB_LOG,(WPARAM)ppro->m_hServerNetlibUser,(LPARAM)szText);
-}
-
-
void avatars_server_connection::closeConnection()
{
stopThread = TRUE;
@@ -996,7 +982,7 @@ DWORD avatars_server_connection::sendGetAvatarRequest(HANDLE hContact, DWORD dwU
if (runContact[i] == hContact)
{
ppro->m_avatarsMutex->Leave();
- NetLog_Server("Ignoring duplicate get %s image request.", strUID(dwUin, szUid));
+ ppro->debugLogA("Ignoring duplicate get %s image request.", strUID(dwUin, szUid));
return -1; // Success: request ignored
}
@@ -1014,7 +1000,7 @@ DWORD avatars_server_connection::sendGetAvatarRequest(HANDLE hContact, DWORD dwU
{ // we will be over quota if we send the request now, add to queue instead
bSendNow = FALSE;
#ifdef _DEBUG
- NetLog_Server("Rates: Delay avatar request.");
+ ppro->debugLogA("Rates: Delay avatar request.");
#endif
}
}
@@ -1050,7 +1036,7 @@ DWORD avatars_server_connection::sendGetAvatarRequest(HANDLE hContact, DWORD dwU
if (sendServerPacket(&packet))
{
- NetLog_Server("Request to get %s image sent.", strUID(dwUin, szUid));
+ ppro->debugLogA("Request to get %s image sent.", strUID(dwUin, szUid));
return dwCookie;
}
@@ -1087,7 +1073,7 @@ DWORD avatars_server_connection::sendUploadAvatarRequest(HANDLE hContact, WORD w
if (sendServerPacket(&packet))
{
- NetLog_Server("Upload image packet sent.");
+ ppro->debugLogA("Upload image packet sent.");
return dwCookie;
}
@@ -1100,7 +1086,7 @@ DWORD avatars_server_connection::sendUploadAvatarRequest(HANDLE hContact, WORD w
void avatars_server_connection::checkRequestQueue()
{
#ifdef _DEBUG
- NetLog_Server("Checking request queue...");
+ ppro->debugLogA("Checking request queue...");
#endif
ppro->m_avatarsMutex->Enter();
@@ -1116,7 +1102,7 @@ void avatars_server_connection::checkRequestQueue()
if (m_rates->getNextRateLevel(wGroup) < m_rates->getLimitLevel(wGroup, RML_ALERT))
{ // we are over rate, leave queue and wait
#ifdef _DEBUG
- NetLog_Server("Rates: Leaving avatar queue processing");
+ ppro->debugLogA("Rates: Leaving avatar queue processing");
#endif
break;
}
@@ -1147,7 +1133,7 @@ void avatars_server_connection::checkRequestQueue()
ppro->m_avatarsMutex->Leave();
#ifdef _DEBUG
- NetLog_Server("Picked up the %s request from queue.", strUID(pRequest->dwUin, pRequest->szUid));
+ ppro->debugLogA("Picked up the %s request from queue.", strUID(pRequest->dwUin, pRequest->szUid));
#endif
switch (pRequest->type)
{
@@ -1184,7 +1170,7 @@ void avatars_server_connection::connectionThread()
if (recvResult == 0)
{
- NetLog_Server("Clean closure of server socket");
+ ppro->debugLogA("Clean closure of server socket");
break;
}
@@ -1198,8 +1184,7 @@ void avatars_server_connection::connectionThread()
continue;
}
#ifdef _DEBUG
- else
- NetLog_Server("Thread is Idle.");
+ else ppro->debugLogA("Thread is Idle.");
#endif
if (GetTickCount() > wLastKeepAlive)
{ // limit frequency (HACK: on some systems select() does not work well)
@@ -1216,7 +1201,7 @@ void avatars_server_connection::connectionThread()
else
{ // this is bad, the system does not handle select() properly
#ifdef _DEBUG
- NetLog_Server("Thread is Forcing Idle.");
+ ppro->debugLogA("Thread is Forcing Idle.");
#endif
SleepEx(500, TRUE); // wait some time, can we do anything else ??
if (Miranda_Terminated())
@@ -1230,9 +1215,9 @@ void avatars_server_connection::connectionThread()
continue;
}
if (!stopThread)
- NetLog_Server("Abortive closure of server socket, error: %d", GetLastError());
+ ppro->debugLogA("Abortive closure of server socket, error: %d", GetLastError());
else
- NetLog_Server("Connection closed.");
+ ppro->debugLogA("Connection closed.");
break;
}
@@ -1293,7 +1278,7 @@ int avatars_server_connection::sendServerPacket(icq_packet *pPacket)
// Send error
if (nSendResult == SOCKET_ERROR)
{ // thread stops automatically
- NetLog_Server("Your connection with the ICQ avatar server was abortively closed");
+ ppro->debugLogA("Your connection with the ICQ avatar server was abortively closed");
}
else
{
@@ -1306,7 +1291,7 @@ int avatars_server_connection::sendServerPacket(icq_packet *pPacket)
}
else
{
- NetLog_Server("Error: Failed to send packet (no connection)");
+ ppro->debugLogA("Error: Failed to send packet (no connection)");
}
localSeqMutex->Leave();
@@ -1341,7 +1326,7 @@ int avatars_server_connection::handleServerPackets(BYTE *buf, int buflen)
break;
#ifdef _DEBUG
- NetLog_Server("Server FLAP: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
+ ppro->debugLogA("Server FLAP: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
#endif
switch (channel)
@@ -1355,7 +1340,7 @@ int avatars_server_connection::handleServerPackets(BYTE *buf, int buflen)
break;
default:
- NetLog_Server("Warning: Unhandled Server FLAP Channel: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
+ ppro->debugLogA("Warning: Unhandled Server FLAP Channel: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
break;
}
@@ -1381,16 +1366,13 @@ void avatars_server_connection::handleLoginChannel(BYTE *buf, WORD datalen)
sendServerPacket(&packet);
#ifdef _DEBUG
- NetLog_Server("Sent CLI_IDENT to %s", "avatar server");
+ ppro->debugLogA("Sent CLI_IDENT to %s", "avatar server");
#endif
SAFE_FREE((void**)&pCookie);
wCookieLen = 0;
}
- else
- {
- NetLog_Server("Invalid Server response, Channel 1.");
- }
+ else ppro->debugLogA("Invalid Server response, Channel 1.");
}
@@ -1399,21 +1381,16 @@ void avatars_server_connection::handleDataChannel(BYTE *buf, WORD datalen)
snac_header snacHeader = {0};
if (!unpackSnacHeader(&snacHeader, &buf, &datalen) || !snacHeader.bValid)
- {
- NetLog_Server("Error: Failed to parse SNAC header");
- }
- else
- {
+ ppro->debugLogA("Error: Failed to parse SNAC header");
+ else {
#ifdef _DEBUG
if (snacHeader.wFlags & 0x8000)
- NetLog_Server(" Received SNAC(x%02X,x%02X), version %u", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wVersion);
+ ppro->debugLogA(" Received SNAC(x%02X,x%02X), version %u", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wVersion);
else
- NetLog_Server(" Received SNAC(x%02X,x%02X)", snacHeader.wFamily, snacHeader.wSubtype);
+ ppro->debugLogA(" Received SNAC(x%02X,x%02X)", snacHeader.wFamily, snacHeader.wSubtype);
#endif
- switch (snacHeader.wFamily)
- {
-
+ switch (snacHeader.wFamily) {
case ICQ_SERVICE_FAMILY:
handleServiceFam(buf, datalen, &snacHeader);
break;
@@ -1423,7 +1400,7 @@ void avatars_server_connection::handleDataChannel(BYTE *buf, WORD datalen)
break;
default:
- NetLog_Server("Ignoring SNAC(x%02X,x%02X) - FAMILYx%02X not implemented", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wFamily);
+ ppro->debugLogA("Ignoring SNAC(x%02X,x%02X) - FAMILYx%02X not implemented", snacHeader.wFamily, snacHeader.wSubtype, snacHeader.wFamily);
break;
}
}
@@ -1439,8 +1416,8 @@ void avatars_server_connection::handleServiceFam(BYTE *pBuffer, WORD wBufferLeng
case ICQ_SERVER_READY:
#ifdef _DEBUG
- NetLog_Server("Server is ready and is requesting my Family versions");
- NetLog_Server("Sending my Families");
+ ppro->debugLogA("Server is ready and is requesting my Family versions");
+ ppro->debugLogA("Sending my Families");
#endif
// Miranda mimics the behaviour of Icq5
@@ -1455,8 +1432,8 @@ void avatars_server_connection::handleServiceFam(BYTE *pBuffer, WORD wBufferLeng
/* This is a reply to CLI_FAMILIES and it tells the client which families and their versions that this server understands.
* We send a rate request packet */
#ifdef _DEBUG
- NetLog_Server("Server told me his Family versions");
- NetLog_Server("Requesting Rate Information");
+ ppro->debugLogA("Server told me his Family versions");
+ ppro->debugLogA("Requesting Rate Information");
#endif
serverPacketInit(&packet, 10);
packFNACHeader(&packet, ICQ_SERVICE_FAMILY, ICQ_CLIENT_REQ_RATE_INFO);
@@ -1465,13 +1442,13 @@ void avatars_server_connection::handleServiceFam(BYTE *pBuffer, WORD wBufferLeng
case ICQ_SERVER_RATE_INFO:
#ifdef _DEBUG
- NetLog_Server("Server sent Rate Info");
+ ppro->debugLogA("Server sent Rate Info");
#endif
/* init rates management */
m_rates = new rates(ppro, pBuffer, wBufferLength);
/* ack rate levels */
#ifdef _DEBUG
- NetLog_Server("Sending Rate Info Ack");
+ ppro->debugLogA("Sending Rate Info Ack");
#endif
m_rates->initAckPacket(&packet);
sendServerPacket(&packet);
@@ -1488,11 +1465,11 @@ void avatars_server_connection::handleServiceFam(BYTE *pBuffer, WORD wBufferLeng
isActive = TRUE; // we are ready to process requests
isLoggedIn = TRUE;
- NetLog_Server(" *** Yeehah, login sequence complete");
+ ppro->debugLogA(" *** Yeehah, login sequence complete");
break;
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_SERVICE_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ ppro->debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_SERVICE_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
}
@@ -1539,7 +1516,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
unpackByte(&pBuffer, &len);
if (wBufferLength < ((pCookieData->hashlen)<<1)+4+len)
{
- NetLog_Server("Received invalid avatar reply.");
+ ppro->debugLogA("Received invalid avatar reply.");
ppro->ProtoBroadcastAck(pCookieData->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, 0);
@@ -1560,7 +1537,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
if (datalen > wBufferLength)
{
datalen = wBufferLength;
- NetLog_Server("Avatar reply broken, trying to do my best.");
+ ppro->debugLogA("Avatar reply broken, trying to do my best.");
}
if (datalen > 4)
@@ -1581,7 +1558,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
if (aValid)
{
- NetLog_Server("Received user avatar, storing (%d bytes).", datalen);
+ ppro->debugLogA("Received user avatar, storing (%d bytes).", datalen);
const TCHAR *ptszExt;
int dwPaFormat = ProtoGetBufferFormat(pBuffer, &ptszExt);
@@ -1611,18 +1588,18 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
if (!ppro->getSetting(pCookieData->hContact, "AvatarHash", &dbv))
{
if (ppro->setSettingBlob(pCookieData->hContact, "AvatarSaved", dbv.pbVal, dbv.cpbVal))
- NetLog_Server("Failed to set file hash.");
+ ppro->debugLogA("Failed to set file hash.");
db_free(&dbv);
}
else
{
- NetLog_Server("Warning: DB error (no hash in DB).");
+ ppro->debugLogA("Warning: DB error (no hash in DB).");
// the hash was lost, try to fix that
if (ppro->setSettingBlob(pCookieData->hContact, "AvatarSaved", pCookieData->hash, pCookieData->hashlen) ||
ppro->setSettingBlob(pCookieData->hContact, "AvatarHash", pCookieData->hash, pCookieData->hashlen))
{
- NetLog_Server("Failed to save avatar hash to DB");
+ ppro->debugLogA("Failed to save avatar hash to DB");
}
}
}
@@ -1632,7 +1609,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
}
else
{ // avatar is broken
- NetLog_Server("Error: Avatar data does not match avatar hash, ignoring.");
+ ppro->debugLogA("Error: Avatar data does not match avatar hash, ignoring.");
if (pCookieData->hContact)
{
@@ -1660,7 +1637,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
}
else
{ // the avatar is empty
- NetLog_Server("Received empty avatar, nothing written (error 0x%x).", bResult);
+ ppro->debugLogA("Received empty avatar, nothing written (error 0x%x).", bResult);
ppro->ProtoBroadcastAck(pCookieData->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, 0);
}
@@ -1670,7 +1647,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
}
else
{
- NetLog_Server("Warning: Received unexpected Avatar Reply SNAC(x10,x07).");
+ ppro->debugLogA("Warning: Received unexpected Avatar Reply SNAC(x10,x07).");
}
break;
@@ -1690,17 +1667,17 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
}
else
{
- NetLog_Server("Warning: Received unexpected Upload Avatar Reply SNAC(x10,x03).");
+ ppro->debugLogA("Warning: Received unexpected Upload Avatar Reply SNAC(x10,x03).");
}
}
else if (res)
{
- NetLog_Server("Error uploading avatar to server, #%d", res);
+ ppro->debugLogA("Error uploading avatar to server, #%d", res);
ppro->icq_LogMessage(LOG_WARNING, LPGEN("Error uploading avatar to server, server refused to accept the image."));
}
else
- NetLog_Server("Received invalid upload avatar ack.");
+ ppro->debugLogA("Received invalid upload avatar ack.");
break;
}
@@ -1713,13 +1690,13 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
{
if (pCookieData->dwUin)
{
- NetLog_Server("Error: Avatar request failed");
+ ppro->debugLogA("Error: Avatar request failed");
SAFE_FREE(&pCookieData->szFile);
SAFE_FREE((void**)&pCookieData->hash);
}
else
{
- NetLog_Server("Error: Avatar upload failed");
+ ppro->debugLogA("Error: Avatar upload failed");
}
ppro->ReleaseCookie(pSnacHeader->dwRef);
}
@@ -1733,7 +1710,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
break;
}
default:
- NetLog_Server("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_AVATAR_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
+ ppro->debugLogA("Warning: Ignoring SNAC(x%02x,x%02x) - Unknown SNAC (Flags: %u, Ref: %u)", ICQ_AVATAR_FAMILY, pSnacHeader->wSubtype, pSnacHeader->wFlags, pSnacHeader->dwRef);
break;
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h
index b6193c7717..26d805d397 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.h
+++ b/protocols/IcqOscarJ/src/icq_avatar.h
@@ -49,11 +49,11 @@ protected:
WORD wLocalSequence;
icq_critical_section *localSeqMutex;
- BOOL isLoggedIn;
- BOOL isActive;
+ BOOL isLoggedIn;
+ BOOL isActive;
BOOL stopThread; // horrible, but simple - signal for thread to stop
- char *pCookie; // auth to server
+ char *pCookie; // auth to server
WORD wCookieLen;
int sendServerPacket(icq_packet *pPacket);
@@ -69,25 +69,24 @@ protected:
rates *m_rates;
icq_critical_section *m_ratesMutex;
- int NetLog_Server(const char *fmt,...);
-
HANDLE runContact[4];
DWORD runTime[4];
int runCount;
- void checkRequestQueue();
+ void checkRequestQueue();
+
public:
- avatars_server_connection(CIcqProto *ppro, HANDLE hConnection, char *pCookie, WORD wCookieLen);
- virtual ~avatars_server_connection();
+ avatars_server_connection(CIcqProto *ppro, HANDLE hConnection, char *pCookie, WORD wCookieLen);
+ virtual ~avatars_server_connection();
- void connectionThread();
- void closeConnection();
- void shutdownConnection();
+ void connectionThread();
+ void closeConnection();
+ void shutdownConnection();
- __inline BOOL isPending() { return !isLoggedIn; };
- __inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
+ __inline BOOL isPending() { return !isLoggedIn; };
+ __inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
- DWORD sendGetAvatarRequest(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
- DWORD sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
+ DWORD sendGetAvatarRequest(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
+ DWORD sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
};
__inline static void SAFE_DELETE(avatars_server_connection **p) { SAFE_DELETE((lockable_struct**)p); };
@@ -107,9 +106,10 @@ struct avatars_request : public MZeroedObject
WORD wRef;
DWORD timeOut;
avatars_request *pNext;
+
public:
- avatars_request(int type);
- virtual ~avatars_request();
+ avatars_request(int type);
+ virtual ~avatars_request();
};
__inline static void SAFE_DELETE(avatars_request **p) { SAFE_DELETE((MZeroedObject**)p); };
diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp
index cfdc74da93..c834dd285c 100644
--- a/protocols/IcqOscarJ/src/icq_clients.cpp
+++ b/protocols/IcqOscarJ/src/icq_clients.cpp
@@ -772,7 +772,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC
if (CheckContactCapabilities(hContact, CAPF_RTF)) {
// most probably Qnext - try to make that shit at least receiving our msgs
ClearContactCapabilities(hContact, CAPF_SRV_RELAY);
- NetLog_Server("Forcing simple messages (QNext client).");
+ debugLogA("Forcing simple messages (QNext client).");
szClient = "Qnext";
}
else if (CheckContactCapabilities(hContact, CAPF_TYPING) && MatchCapability(caps, wLen, &captZers) && MatchCapability(caps, wLen, &capFakeHtml)) {
@@ -818,7 +818,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC
if ( !CheckContactCapabilities(hContact, CAPF_RTF) && !CheckContactCapabilities(hContact, CAPF_UTF)) {
// this is bad, but we must do it - try to detect QNext
ClearContactCapabilities(hContact, CAPF_SRV_RELAY);
- NetLog_Server("Forcing simple messages (QNext client).");
+ debugLogA("Forcing simple messages (QNext client).");
szClient = "Qnext";
}
else if (!CheckContactCapabilities(hContact, CAPF_RTF) && CheckContactCapabilities(hContact, CAPF_UTF) && !dwFT1 && !dwFT2 && !dwFT3)
@@ -1003,9 +1003,9 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC
// Log the detection result if it has changed or contact just logged on...
if (!szCurrentClient || strcmpnull(szCurrentClient, szClient)) {
if (bClientDetected)
- NetLog_Server("Client identified as %s", szClient);
+ debugLogA("Client identified as %s", szClient);
else
- NetLog_Server("No client identification, put default ICQ client for protocol.");
+ debugLogA("No client identification, put default ICQ client for protocol.");
}
return szClient;
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp
index 8aa8a97687..ecf76ebfc4 100644
--- a/protocols/IcqOscarJ/src/icq_db.cpp
+++ b/protocols/IcqOscarJ/src/icq_db.cpp
@@ -75,7 +75,7 @@ int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
iRes = 0;
}
else
- NetLog_Server("AOL screennames not accepted");
+ debugLogA("AOL screennames not accepted");
}
db_free(&dbv);
}
diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp
index cf61c3ea3d..58ed0ec592 100644
--- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp
+++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp
@@ -99,7 +99,7 @@ BOOL CIcqProto::icq_QueueUser(HANDLE hContact)
m_infoUpdateList[nFirstFree].queued = time(NULL);
nInfoUserCount++;
#ifdef _DEBUG
- NetLog_Server("Queued user %u, place %u, count %u", dwUin, nFirstFree, nInfoUserCount);
+ debugLogA("Queued user %u, place %u, count %u", dwUin, nFirstFree, nInfoUserCount);
#endif
// Notify worker thread
if (hInfoQueueEvent && bInfoUpdateEnabled)
@@ -132,7 +132,7 @@ void CIcqProto::icq_DequeueUser(DWORD dwUin)
if (m_infoUpdateList[i].dwUin == dwUin)
{
#ifdef _DEBUG
- NetLog_Server("Dequeued user %u", m_infoUpdateList[i].dwUin);
+ debugLogA("Dequeued user %u", m_infoUpdateList[i].dwUin);
#endif
m_infoUpdateList[i].dwUin = 0;
m_infoUpdateList[i].hContact = NULL;
@@ -188,7 +188,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
int i;
DWORD dwWait = WAIT_OBJECT_0;
- NetLog_Server("%s thread starting.", "Info-Update");
+ debugLogA("%s thread starting.", "Info-Update");
bInfoUpdateRunning = TRUE;
@@ -245,7 +245,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
SleepEx(1000, TRUE);
if (!bInfoUpdateRunning)
{ // need to end as fast as possible
- NetLog_Server("%s thread ended.", "Info-Update");
+ debugLogA("%s thread ended.", "Info-Update");
goto LBL_Exit;
}
continue;
@@ -254,19 +254,19 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
if (FindCookie(dwInfoActiveRequest, NULL, NULL))
{ // only send another request, when the previous is completed
#ifdef _DEBUG
- NetLog_Server("Info-Update: Request 0x%x still in progress.", dwInfoActiveRequest);
+ debugLogA("Info-Update: Request 0x%x still in progress.", dwInfoActiveRequest);
#endif
SleepEx(1000, TRUE);
if (!bInfoUpdateRunning)
{ // need to end as fast as possible
- NetLog_Server("%s thread ended.", "Info-Update");
+ debugLogA("%s thread ended.", "Info-Update");
goto LBL_Exit;
}
continue;
}
#ifdef _DEBUG
- NetLog_Server("Info-Update: Users %u in queue.", nInfoUserCount);
+ debugLogA("Info-Update: Users %u in queue.", nInfoUserCount);
#endif
// Either some user is waiting long enough, or all users are ready (waited at least the minimum time)
m_ratesMutex->Enter();
@@ -282,12 +282,12 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
m_ratesMutex->Leave();
#ifdef _DEBUG
- NetLog_Server("Rates: InfoUpdate delayed %dms", nDelay);
+ debugLogA("Rates: InfoUpdate delayed %dms", nDelay);
#endif
SleepEx(nDelay, TRUE); // do not keep things locked during sleep
if (!bInfoUpdateRunning)
{ // need to end as fast as possible
- NetLog_Server("%s thread ended.", "Info-Update");
+ debugLogA("%s thread ended.", "Info-Update");
goto LBL_Exit;
}
m_ratesMutex->Enter();
@@ -339,7 +339,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
else
{
#ifdef _DEBUG
- NetLog_Server("Dequeued absolete user %u", m_infoUpdateList[i].dwUin);
+ debugLogA("Dequeued absolete user %u", m_infoUpdateList[i].dwUin);
#endif
// Dequeue user and find another one
m_infoUpdateList[i].dwUin = 0;
@@ -351,7 +351,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
}
#ifdef _DEBUG
- NetLog_Server("Request info for %u user(s).", nListIndex);
+ debugLogA("Request info for %u user(s).", nListIndex);
#endif
if (!nListIndex)
{ // no users to request info for
@@ -384,7 +384,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* )
}
}
- NetLog_Server("%s thread ended.", "Info-Update");
+ debugLogA("%s thread ended.", "Info-Update");
LBL_Exit:
SAFE_DELETE(&infoUpdateMutex);
@@ -394,7 +394,7 @@ LBL_Exit:
// Clean up before exit
void CIcqProto::icq_InfoUpdateCleanup(void)
{
- NetLog_Server("%s must die.", "Info-Update");
+ debugLogA("%s must die.", "Info-Update");
bInfoUpdateRunning = FALSE;
if (hInfoQueueEvent)
SetEvent(hInfoQueueEvent); // break queue loop
diff --git a/protocols/IcqOscarJ/src/icq_packet.cpp b/protocols/IcqOscarJ/src/icq_packet.cpp
index 0a727cc5aa..c74687cdc3 100644
--- a/protocols/IcqOscarJ/src/icq_packet.cpp
+++ b/protocols/IcqOscarJ/src/icq_packet.cpp
@@ -884,7 +884,7 @@ BOOL CIcqProto::unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *pps
*ppBuf += nUIDLen;
*pwLen -= nUIDLen;
- NetLog_Server("Malformed UIN in packet");
+ debugLogA("Malformed UIN in packet");
return FALSE;
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 42f6c95d75..da558cf76e 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -78,7 +78,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
contactsCache(10, CompareContactsCache),
cheekySearchId(-1)
{
- NetLog_Server( "Setting protocol/module name to '%s'", m_szModuleName );
+ debugLogA( "Setting protocol/module name to '%s'", m_szModuleName );
oftMutex = new icq_critical_section();
@@ -185,7 +185,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
nlu.pfnHttpGatewayBegin = icq_httpGatewayBegin;
nlu.pfnHttpGatewayWrapSend = icq_httpGatewayWrapSend;
nlu.pfnHttpGatewayUnwrapRecv = icq_httpGatewayUnwrapRecv;
- m_hServerNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2PModuleName[MAX_PATH];
mir_snprintf(szP2PModuleName, SIZEOF(szP2PModuleName), "%sP2P", m_szModuleName);
@@ -208,7 +208,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&eventType);
// Protocol instance is ready
- NetLog_Server("%s: Protocol instance '%s' created.", ICQ_PROTOCOL_NAME, m_szModuleName);
+ debugLogA("%s: Protocol instance '%s' created.", ICQ_PROTOCOL_NAME, m_szModuleName);
}
@@ -230,7 +230,7 @@ CIcqProto::~CIcqProto()
// NetLib clean-up
NetLib_SafeCloseHandle(&m_hDirectNetlibUser);
- NetLib_SafeCloseHandle(&m_hServerNetlibUser);
+ NetLib_SafeCloseHandle(&m_hNetlibUser);
// Destroy hookable events
if (m_modeMsgsEvent)
@@ -263,7 +263,7 @@ CIcqProto::~CIcqProto()
SAFE_FREE(&m_modeMsgs.szDnd);
SAFE_FREE(&m_modeMsgs.szFfc);
- NetLog_Server("%s: Protocol instance '%s' destroyed.", ICQ_PROTOCOL_NAME, m_szModuleName);
+ debugLogA("%s: Protocol instance '%s' destroyed.", ICQ_PROTOCOL_NAME, m_szModuleName);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -1127,7 +1127,7 @@ int __cdecl CIcqProto::SendContacts( HANDLE hContact, int flags, int nContacts,
icq_packet mData, mNames;
#ifdef _DEBUG
- NetLog_Server("Sending contacts to %s.", strUID(dwUin, szUid));
+ debugLogA("Sending contacts to %s.", strUID(dwUin, szUid));
#endif
// Do not calculate the exact size of the data packet - only the maximal size (easier)
// Sumarize size of group information
@@ -1257,7 +1257,7 @@ int __cdecl CIcqProto::SendContacts( HANDLE hContact, int flags, int nContacts,
char* pBuffer;
#ifdef _DEBUG
- NetLog_Server("Sending contacts to %d.", dwUin);
+ debugLogA("Sending contacts to %d.", dwUin);
#endif
// Compute count record's length
_itoa(nContacts, szCount, 10);
@@ -1387,7 +1387,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
WORD wClientVersion = getWord(hContact, "Version", 7);
if (wClientVersion < 7)
- NetLog_Server("IcqSendFile() can't send to version %u", wClientVersion);
+ debugLogA("IcqSendFile() can't send to version %u", wClientVersion);
else
{
int i;
@@ -1405,7 +1405,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
ft->pszFiles[i] = (ppszFiles[i]) ? tchar_to_utf8(ppszFiles[i]) : NULL;
if (_tstat(ppszFiles[i], &statbuf))
- NetLog_Server("IcqSendFile() was passed invalid filename(s)");
+ debugLogA("IcqSendFile() was passed invalid filename(s)");
else
ft->dwTotalSize += statbuf.st_size;
}
@@ -1423,7 +1423,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
char *pszFiles;
- NetLog_Server("Init file send");
+ debugLogA("Init file send");
if (ft->dwFileCount == 1)
{
@@ -1448,7 +1448,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
int iRes = icq_sendFileSendDirectv7(ft, pszFiles);
if (iRes) return ft; // Success
}
- NetLog_Server("Sending v%u file transfer request through server", 7);
+ debugLogA("Sending v%u file transfer request through server", 7);
icq_sendFileSendServv7(ft, pszFiles);
}
else
@@ -1458,7 +1458,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
int iRes = icq_sendFileSendDirectv8(ft, pszFiles);
if (iRes) return ft; // Success
}
- NetLog_Server("Sending v%u file transfer request through server", 8);
+ debugLogA("Sending v%u file transfer request through server", 8);
icq_sendFileSendServv8(ft, pszFiles, ACKTYPE_NONE);
}
}
@@ -1530,8 +1530,8 @@ int __cdecl CIcqProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
else
{
#ifdef _DEBUG
- NetLog_Server("Send %smessage - Message cap is %u", puszText ? "unicode " : "", CheckContactCapabilities(hContact, CAPF_SRV_RELAY));
- NetLog_Server("Send %smessage - Contact status is %u", puszText ? "unicode " : "", wRecipientStatus);
+ debugLogA("Send %smessage - Message cap is %u", puszText ? "unicode " : "", CheckContactCapabilities(hContact, CAPF_SRV_RELAY));
+ debugLogA("Send %smessage - Contact status is %u", puszText ? "unicode " : "", wRecipientStatus);
#endif
if (dwUin && m_bDCMsgEnabled && IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 0))
{ // send thru direct
@@ -1872,7 +1872,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
int nNewStatus = MirandaStatusToSupported(iNewStatus);
// check if netlib handles are ready
- if (!m_hServerNetlibUser)
+ if (!m_hNetlibUser)
return 0;
if (m_bTempVisListEnabled && icqOnline()) // remove temporary visible users
@@ -1905,7 +1905,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
SetCurrentStatus(ID_STATUS_OFFLINE);
- NetLog_Server("Logged off.");
+ debugLogA("Logged off.");
}
}
else
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 9d392110cc..a3291a94e7 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -145,7 +145,7 @@ struct CIcqProto : public PROTO<CIcqProto>
int __cdecl OnPreBuildStatusMenu( WPARAM, LPARAM );
//====| Data |========================================================================
- HANDLE m_hServerNetlibUser, m_hDirectNetlibUser;
+ HANDLE m_hDirectNetlibUser;
BYTE m_bGatewayMode;
BYTE m_bSecureLogin;
@@ -875,7 +875,6 @@ struct CIcqProto : public PROTO<CIcqProto>
void __cdecl ProtocolAckThread(icq_ack_args* pArguments);
void SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
- int NetLog_Server(const char *fmt,...);
int NetLog_Direct(const char *fmt,...);
int NetLog_Uni(BOOL bDC, const char *fmt,...);
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp
index e2c5734049..043e0dc173 100644
--- a/protocols/IcqOscarJ/src/icq_rates.cpp
+++ b/protocols/IcqOscarJ/src/icq_rates.cpp
@@ -46,7 +46,7 @@ rates::rates(CIcqProto *ppro, BYTE *pBuffer, WORD wLen)
if (wCount > MAX_RATES_GROUP_COUNT)
{ // just sanity check
- ppro->NetLog_Server("Rates: Error: Data packet contains too many rate groups!");
+ ppro->debugLogA("Rates: Error: Data packet contains too many rate groups!");
wCount = MAX_RATES_GROUP_COUNT;
}
@@ -97,7 +97,7 @@ rates::rates(CIcqProto *ppro, BYTE *pBuffer, WORD wLen)
pGroup->pPairs[n] = wItem;
}
#ifdef _DEBUG
- ppro->NetLog_Server("Rates: %d# %d pairs.", i+1, wNum);
+ ppro->debugLogA("Rates: %d# %d pairs.", i+1, wNum);
#endif
wLen -= wNum*4;
}
@@ -210,7 +210,7 @@ void rates::updateLevel(WORD wGroup, int nLevel)
pGroup->rCurrentLevel = nLevel;
pGroup->tCurrentLevel = GetTickCount();
#ifdef _DEBUG
- ppro->NetLog_Server("Rates: New level %d for #%d", nLevel, wGroup);
+ ppro->debugLogA("Rates: New level %d for #%d", nLevel, wGroup);
#endif
}
}
@@ -304,7 +304,7 @@ rates_queue_item* rates_queue_item::copyItem(rates_queue_item *pDest)
void rates_queue_item::execute()
{
#ifdef _DEBUG
- ppro->NetLog_Server("Rates: Error executing abstract event.");
+ ppro->debugLogA("Rates: Error executing abstract event.");
#endif
}
@@ -357,7 +357,7 @@ void __cdecl CIcqProto::rateDelayThread(rate_delay_args *pArgs)
void rates_queue::initDelay(int nDelay, IcqRateFunc delaycode)
{
#ifdef _DEBUG
- ppro->NetLog_Server("Rates: Delay %dms", nDelay);
+ ppro->debugLogA("Rates: Delay %dms", nDelay);
#endif
rate_delay_args *pArgs = (rate_delay_args*)SAFE_MALLOC(sizeof(rate_delay_args)); // This will be freed in the new thread
@@ -374,7 +374,7 @@ void rates_queue::cleanup()
icq_lock l(listsMutex);
if (pendingListSize)
- ppro->NetLog_Server("Rates: Purging %d %s(s).", pendingListSize, szDescr);
+ ppro->debugLogA("Rates: Purging %d %s(s).", pendingListSize, szDescr);
for (int i=0; i < pendingListSize; i++)
delete pendingList[i];
@@ -423,11 +423,11 @@ void rates_queue::processQueue()
if (ppro->icqOnline())
{
- ppro->NetLog_Server("Rates: Resuming %s.", szDescr);
+ ppro->debugLogA("Rates: Resuming %s.", szDescr);
item->execute();
}
else
- ppro->NetLog_Server("Rates: Discarding %s.", szDescr);
+ ppro->debugLogA("Rates: Discarding %s.", szDescr);
if (bSetupTimer)
{
@@ -450,7 +450,7 @@ void rates_queue::putItem(rates_queue_item *pItem, int nMinDelay)
if (!ppro->icqOnline())
return;
- ppro->NetLog_Server("Rates: Delaying %s.", szDescr);
+ ppro->debugLogA("Rates: Delaying %s.", szDescr);
listsMutex->Enter();
if (pendingListSize)
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp
index 53a5420944..5084742a9c 100644
--- a/protocols/IcqOscarJ/src/icq_server.cpp
+++ b/protocols/IcqOscarJ/src/icq_server.cpp
@@ -50,14 +50,14 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
ResetSettingsOnConnect();
// Connect to the login server
- NetLog_Server("Authenticating to server");
+ debugLogA("Authenticating to server");
{
NETLIBOPENCONNECTION nloc = infoParam->nloc;
nloc.timeout = 6;
if (m_bGatewayMode)
nloc.flags |= NLOCF_HTTPGATEWAY;
- hServerConn = NetLib_OpenConnection(m_hServerNetlibUser, NULL, &nloc);
+ hServerConn = NetLib_OpenConnection(m_hNetlibUser, NULL, &nloc);
SAFE_FREE((void**)&nloc.szHost);
SAFE_FREE((void**)&infoParam);
@@ -131,13 +131,13 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
if (recvResult == 0)
{
- NetLog_Server("Clean closure of server socket");
+ debugLogA("Clean closure of server socket");
break;
}
if (recvResult == SOCKET_ERROR)
{
- NetLog_Server("Abortive closure of server socket, error: %d", GetLastError());
+ debugLogA("Abortive closure of server socket, error: %d", GetLastError());
break;
}
@@ -149,7 +149,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
m_bConnectionLost = FALSE;
SetCurrentStatus(ID_STATUS_OFFLINE);
- NetLog_Server("Logged off.");
+ debugLogA("Logged off.");
break;
}
@@ -228,7 +228,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
FlushServerIDs(); // clear server IDs list
- NetLog_Server("%s thread ended.", "Server");
+ debugLogA("%s thread ended.", "Server");
}
@@ -237,7 +237,7 @@ void CIcqProto::icq_serverDisconnect(BOOL bBlock)
if ( !hServerConn)
return;
- NetLog_Server("Server shutdown requested");
+ debugLogA("Server shutdown requested");
Netlib_Shutdown(hServerConn);
if (serverThreadHandle) {
@@ -279,7 +279,7 @@ int CIcqProto::handleServerPackets(BYTE *buf, int len, serverthread_info *info)
#ifdef _DEBUG
- NetLog_Server("Server FLAP: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
+ debugLogA("Server FLAP: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
#endif
switch (channel) {
@@ -304,7 +304,7 @@ int CIcqProto::handleServerPackets(BYTE *buf, int len, serverthread_info *info)
break;
default:
- NetLog_Server("Warning: Unhandled Server FLAP Channel: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
+ debugLogA("Warning: Unhandled Server FLAP Channel: Channel %u, Seq %u, Length %u bytes", channel, sequence, datalen);
break;
}
@@ -364,7 +364,7 @@ void CIcqProto::sendServPacket(icq_packet *pPacket)
else
{
connectionHandleMutex->Leave();
- NetLog_Server("Error: Failed to send packet (no connection)");
+ debugLogA("Error: Failed to send packet (no connection)");
}
SAFE_FREE((void**)&pPacket->pData);
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index ab0ae4387d..44e6ef480e 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -42,7 +42,7 @@ void CIcqProto::servlistBeginOperation(int operationCount, int bImport)
// update count of active operations
servlistEditCount += operationCount;
#ifdef _DEBUG
- NetLog_Server("Server-List: Begin operation processed (%d operations active)", servlistEditCount);
+ debugLogA("Server-List: Begin operation processed (%d operations active)", servlistEditCount);
#endif
}
}
@@ -53,7 +53,7 @@ void CIcqProto::servlistEndOperation(int operationCount)
{
if (operationCount > servlistEditCount)
{ // sanity check
- NetLog_Server("Error: Server-List End operation is not paired!");
+ debugLogA("Error: Server-List End operation is not paired!");
operationCount = servlistEditCount;
}
// update count of active operations
@@ -62,7 +62,7 @@ void CIcqProto::servlistEndOperation(int operationCount)
if (!servlistEditCount)
icq_sendServerEndOperation();
#ifdef _DEBUG
- NetLog_Server("Server-List: End operation processed (%d operations active)", servlistEditCount);
+ debugLogA("Server-List: End operation processed (%d operations active)", servlistEditCount);
#endif
}
}
@@ -72,7 +72,7 @@ void __cdecl CIcqProto::servlistQueueThread(void *param)
int* queueState = ( int* )param;
#ifdef _DEBUG
- NetLog_Server("Server-List: Starting Update board.");
+ debugLogA("Server-List: Starting Update board.");
#endif
SleepEx(50, FALSE);
@@ -118,7 +118,7 @@ void __cdecl CIcqProto::servlistQueueThread(void *param)
continue;
}
#ifdef _DEBUG
- NetLog_Server("Server-List: %d items in queue.", servlistQueueCount);
+ debugLogA("Server-List: %d items in queue.", servlistQueueCount);
#endif
// take the oldest item (keep the board FIFO)
pItem = servlistQueueList[0]; // take first (queue contains at least one item here)
@@ -139,7 +139,7 @@ void __cdecl CIcqProto::servlistQueueThread(void *param)
servlistQueueMutex->Leave();
if (nDelay < 10) nDelay = 10;
#ifdef _DEBUG
- NetLog_Server("Server-List: Delaying %dms [Rates]", nDelay);
+ debugLogA("Server-List: Delaying %dms [Rates]", nDelay);
#endif
SleepEx(nDelay, FALSE);
// check if the rate is now ok
@@ -271,7 +271,7 @@ void __cdecl CIcqProto::servlistQueueThread(void *param)
servlistQueueThreadHandle = NULL;
servlistQueueMutex->Leave();
#ifdef _DEBUG
- NetLog_Server("Server-List: Update Board ending.");
+ debugLogA("Server-List: Update Board ending.");
#endif
}
@@ -301,7 +301,7 @@ void CIcqProto::servlistQueueAddGroupItem(servlistgroupitem* pGroupItem, int dwT
if (!pItem) continue;
#ifdef _DEBUG
- NetLog_Server("Server-List: Adding packet to item #%d with operation %x.", i, servlistQueueList[i]->pItems[0]->dwOperation);
+ debugLogA("Server-List: Adding packet to item #%d with operation %x.", i, servlistQueueList[i]->pItems[0]->dwOperation);
#endif
break;
}
@@ -320,7 +320,7 @@ void CIcqProto::servlistQueueAddGroupItem(servlistgroupitem* pGroupItem, int dwT
// really add to queue
servlistQueueList[servlistQueueCount++] = pItem;
#ifdef _DEBUG
- NetLog_Server("Server-List: Adding new item to queue.");
+ debugLogA("Server-List: Adding new item to queue.");
#endif
}
else if (pItem->dwTimeout > dwTimeout)
@@ -516,9 +516,9 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HANDLE hCon
{ // move the remaining operations
#ifdef _DEBUG
if (pItem->nType == ITEM_PENDING_CONTACT)
- NetLog_Server("Server-List: Resuming contact %x operation.", pItem->hContact);
+ debugLogA("Server-List: Resuming contact %x operation.", pItem->hContact);
else
- NetLog_Server("Server-List: Resuming group \"%s\" operation.", pItem->szGroup);
+ debugLogA("Server-List: Resuming group \"%s\" operation.", pItem->szGroup);
#endif
pNewItem->nType = pItem->nType;
@@ -539,7 +539,7 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HANDLE hCon
}
#ifdef _DEBUG
else
- NetLog_Server("Server-List Error: Trying to remove non-existing pending %s.", nType == ITEM_PENDING_CONTACT ? "contact" : "group");
+ debugLogA("Server-List Error: Trying to remove non-existing pending %s.", nType == ITEM_PENDING_CONTACT ? "contact" : "group");
#endif
return pItem;
@@ -568,7 +568,7 @@ void CIcqProto::servlistPendingAddContactOperation(HANDLE hContact, LPARAM param
}
else
{
- NetLog_Server("Server-List Error: Trying to add pending operation to a non existing contact.");
+ debugLogA("Server-List Error: Trying to add pending operation to a non existing contact.");
}
}
@@ -594,7 +594,7 @@ void CIcqProto::servlistPendingAddGroupOperation(const char *pszGroup, LPARAM pa
}
else
{
- NetLog_Server("Server-List Error: Trying to add pending operation to a non existing group.");
+ debugLogA("Server-List Error: Trying to add pending operation to a non existing group.");
}
}
@@ -612,7 +612,7 @@ int CIcqProto::servlistPendingAddContact(HANDLE hContact, WORD wContactID, WORD
if (pItem)
{
#ifdef _DEBUG
- NetLog_Server("Server-List: Pending contact %x already in list; adding as operation.", hContact);
+ debugLogA("Server-List: Pending contact %x already in list; adding as operation.", hContact);
#endif
servlistPendingAddContactOperation(hContact, param, callback, SPOF_AUTO_CREATE_ITEM);
@@ -625,7 +625,7 @@ int CIcqProto::servlistPendingAddContact(HANDLE hContact, WORD wContactID, WORD
}
#ifdef _DEBUG
- NetLog_Server("Server-List: Starting contact %x operation.", hContact);
+ debugLogA("Server-List: Starting contact %x operation.", hContact);
#endif
pItem = (servlistpendingitem *)SAFE_MALLOC(sizeof(servlistpendingitem));
@@ -663,7 +663,7 @@ int CIcqProto::servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPAR
if (pItem)
{
#ifdef _DEBUG
- NetLog_Server("Server-List: Pending group \"%s\" already in list; adding as operation.", pszGroup);
+ debugLogA("Server-List: Pending group \"%s\" already in list; adding as operation.", pszGroup);
#endif
servlistPendingAddGroupOperation(pszGroup, param, callback, SPOF_AUTO_CREATE_ITEM);
@@ -676,7 +676,7 @@ int CIcqProto::servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPAR
}
#ifdef _DEBUG
- NetLog_Server("Server-List: Starting group \"%s\" operation.", pszGroup);
+ debugLogA("Server-List: Starting group \"%s\" operation.", pszGroup);
#endif
pItem = (servlistpendingitem *)SAFE_MALLOC(sizeof(servlistpendingitem));
@@ -703,7 +703,7 @@ int CIcqProto::servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPAR
void CIcqProto::servlistPendingRemoveContact(HANDLE hContact, WORD wContactID, WORD wGroupID, int nResult)
{
#ifdef _DEBUG
- NetLog_Server("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact);
+ debugLogA("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact);
#endif
servlistpendingitem *pItem = servlistPendingRemoveItem(ITEM_PENDING_CONTACT, hContact, NULL);
@@ -733,14 +733,14 @@ void CIcqProto::servlistPendingRemoveContact(HANDLE hContact, WORD wContactID, W
SAFE_FREE((void**)&pItem);
}
else
- NetLog_Server("Server-List Error: Trying to remove a non existing pending contact.");
+ debugLogA("Server-List Error: Trying to remove a non existing pending contact.");
}
void CIcqProto::servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult)
{
#ifdef _DEBUG
- NetLog_Server("Server-List: %s group \"%s\" operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", pszGroup);
+ debugLogA("Server-List: %s group \"%s\" operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", pszGroup);
#endif
servlistpendingitem *pItem = servlistPendingRemoveItem(ITEM_PENDING_GROUP, NULL, pszGroup);
@@ -771,7 +771,7 @@ void CIcqProto::servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID,
SAFE_FREE((void**)&pItem);
}
else
- NetLog_Server("Server-List Error: Trying to remove a non existing pending group.");
+ debugLogA("Server-List Error: Trying to remove a non existing pending group.");
}
@@ -954,7 +954,7 @@ static int GroupReserveIdsEnumProc(const char *szSetting,LPARAM lParam)
}
param->ppro->ReserveServerID((WORD)strtoul(szSetting, NULL, 0x10), SSIT_GROUP, 0);
#ifdef _DEBUG
- param->ppro->NetLog_Server("Loaded group %u:'%s'", strtoul(szSetting, NULL, 0x10), val);
+ param->ppro->debugLogA("Loaded group %u:'%s'", strtoul(szSetting, NULL, 0x10), val);
#endif
}
return 0;
@@ -1045,7 +1045,7 @@ void CIcqProto::LoadServerIDs()
db_free(&dbv);
}
- NetLog_Server("Loaded SSI: %d contacts, %d groups, %d permit, %d deny, %d ignore, %d unknown items.", nContacts, nGroups, nPermits, nDenys, nIgnores, nUnhandled);
+ debugLogA("Loaded SSI: %d contacts, %d groups, %d permit, %d deny, %d ignore, %d unknown items.", nContacts, nGroups, nPermits, nDenys, nIgnores, nUnhandled);
}
@@ -1180,7 +1180,7 @@ DWORD CIcqProto::icq_sendServerContact(HANDLE hContact, DWORD dwCookie, WORD wAc
// Prepare UID
if (getContactUid(hContact, &dwUin, &szUid))
{
- NetLog_Server("Buddy upload failed (UID missing).");
+ debugLogA("Buddy upload failed (UID missing).");
return 0;
}
@@ -1285,7 +1285,7 @@ DWORD CIcqProto::icq_sendServerGroup(DWORD dwCookie, WORD wAction, WORD wGroupId
if (strlennull(szName) == 0 && wGroupId != 0)
{
- NetLog_Server("Group upload failed (GroupName missing).");
+ debugLogA("Group upload failed (GroupName missing).");
return 0; // without name we could not change the group
}
@@ -1496,7 +1496,7 @@ char *CIcqProto::getServListGroupName(WORD wGroupID)
if (!wGroupID)
{
- NetLog_Server("Warning: Cannot get group name (Group ID missing)!");
+ debugLogA("Warning: Cannot get group name (Group ID missing)!");
return NULL;
}
@@ -1505,7 +1505,7 @@ char *CIcqProto::getServListGroupName(WORD wGroupID)
if (!CheckServerID(wGroupID, 0))
{ // check if valid id, if not give empty and remove
- NetLog_Server("Removing group %u from cache...", wGroupID);
+ debugLogA("Removing group %u from cache...", wGroupID);
db_unset(NULL, szModule, szGroup);
return NULL;
}
@@ -1521,7 +1521,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName)
if (!wGroupID)
{
- NetLog_Server("Warning: Cannot set group name (Group ID missing)!");
+ debugLogA("Warning: Cannot set group name (Group ID missing)!");
return;
}
@@ -1550,7 +1550,7 @@ WORD CIcqProto::getServListGroupLinkID(const char *szPath)
if (wGroupId && !CheckServerID(wGroupId, 0))
{ // known, check if still valid, if not remove
- NetLog_Server("Removing group \"%s\" from cache...", szPath);
+ debugLogA("Removing group \"%s\" from cache...", szPath);
db_unset(NULL, szModule, szPath);
wGroupId = 0;
}
@@ -1872,7 +1872,7 @@ int CIcqProto::servlistCreateGroup_gotParentGroup(const char *szGroup, WORD wGro
if (ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action)))
{ // we have cookie good, go on
#ifdef _DEBUG
- NetLog_Server("Server-List: Creating sub-group \"%s\", parent group \"%s\".", szSubGroupItem, szGroup);
+ debugLogA("Server-List: Creating sub-group \"%s\", parent group \"%s\".", szSubGroupItem, szGroup);
#endif
ReserveServerID(wSubGroupID, SSIT_GROUP, 0);
@@ -1920,7 +1920,7 @@ int CIcqProto::servlistCreateGroup_Ready(const char *szGroup, WORD groupID, LPAR
if (ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action)))
{ // we have cookie good, go on
#ifdef _DEBUG
- NetLog_Server("Server-List: Creating root group \"%s\".", szGroup);
+ debugLogA("Server-List: Creating root group \"%s\".", szGroup);
#endif
ack->wGroupId = GenerateServerID(SSIT_GROUP, 0);
ack->szGroup = null_strdup(szGroup); // we need that name
@@ -2007,7 +2007,7 @@ int CIcqProto::servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, L
if (wItemID) /// TODO: redundant ???
{ // Only add the contact if it doesnt already have an ID
servlistPendingRemoveContact(ack->hContact, wItemID, wGroupID, PENDING_RESULT_SUCCESS);
- NetLog_Server("Failed to add contact to server side list (%s)", "already there");
+ debugLogA("Failed to add contact to server side list (%s)", "already there");
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
}
@@ -2043,7 +2043,7 @@ int CIcqProto::servlistAddContact_Ready(HANDLE hContact, WORD wContactID, WORD w
if (wItemID)
{ // Only add the contact if it doesn't already have an ID
servlistPendingRemoveContact(ack->hContact, wItemID, getWord(hContact, DBSETTING_SERVLIST_GROUP, 0), PENDING_RESULT_SUCCESS);
- NetLog_Server("Failed to add contact to server side list (%s)", "already there");
+ debugLogA("Failed to add contact to server side list (%s)", "already there");
SAFE_FREE((void**)&ack->szGroup);
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
@@ -2066,13 +2066,13 @@ void CIcqProto::servlistAddContact(HANDLE hContact, const char *pszGroup)
// Get UID
if (getContactUid(hContact, &dwUin, &szUid))
{ // Could not do anything without uid
- NetLog_Server("Failed to add contact to server side list (%s)", "no UID");
+ debugLogA("Failed to add contact to server side list (%s)", "no UID");
return;
}
if (!(ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action))))
{ // Could not do anything without cookie
- NetLog_Server("Failed to add contact to server side list (%s)", "malloc failed");
+ debugLogA("Failed to add contact to server side list (%s)", "malloc failed");
return;
}
else
@@ -2104,7 +2104,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD
{ // Could not find a usable group ID
servlistPendingRemoveContact(hContact, contactID, groupID, PENDING_RESULT_FAILED);
- NetLog_Server("Failed to remove contact from server side list (%s)", "no group ID");
+ debugLogA("Failed to remove contact from server side list (%s)", "no group ID");
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
}
@@ -2114,7 +2114,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD
{ // Could not find usable item ID
servlistPendingRemoveContact(hContact, contactID, wGroupID, PENDING_RESULT_FAILED);
- NetLog_Server("Failed to remove contact from server side list (%s)", "no item ID");
+ debugLogA("Failed to remove contact from server side list (%s)", "no item ID");
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
}
@@ -2143,13 +2143,13 @@ void CIcqProto::servlistRemoveContact(HANDLE hContact)
if (getContactUid(hContact, &dwUin, &szUid))
{
// Could not do anything without uid
- NetLog_Server("Failed to remove contact from server side list (%s)", "no UID");
+ debugLogA("Failed to remove contact from server side list (%s)", "no UID");
return;
}
if (!(ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action))))
{ // Could not do anything without cookie
- NetLog_Server("Failed to remove contact from server side list (%s)", "malloc failed");
+ debugLogA("Failed to remove contact from server side list (%s)", "malloc failed");
return;
}
else
@@ -2186,7 +2186,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew
if (!wItemID)
{ // We have no ID, so try to simply add the contact to serv-list
- NetLog_Server("Unable to move contact (no ItemID) -> trying to add");
+ debugLogA("Unable to move contact (no ItemID) -> trying to add");
// we know the GroupID, so directly call add
return servlistAddContact_gotGroup(szGroup, wNewGroupID, lParam, nResult);
}
@@ -2194,7 +2194,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew
if (wGroupID == wNewGroupID)
{ // Only move the contact if it had different GroupID
servlistPendingRemoveContact(ack->hContact, wItemID, wNewGroupID, PENDING_RESULT_SUCCESS);
- NetLog_Server("Contact not moved to group on server side list (same Group)");
+ debugLogA("Contact not moved to group on server side list (same Group)");
return CALLBACK_RESULT_CONTINUE;
}
@@ -2237,7 +2237,7 @@ int CIcqProto::servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD g
{ // Only move the contact if it had an GroupID
servlistPendingRemoveContact(ack->hContact, contactID, groupID, PENDING_RESULT_FAILED);
- NetLog_Server("Failed to move contact to group on server side list (%s)", "no Group");
+ debugLogA("Failed to move contact to group on server side list (%s)", "no Group");
SAFE_FREE(&ack->szGroup);
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
@@ -2261,13 +2261,13 @@ void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
// Get UID
if (getContactUid(hContact, &dwUin, &szUid))
{ // Could not do anything without uin
- NetLog_Server("Failed to move contact to group on server side list (%s)", "no UID");
+ debugLogA("Failed to move contact to group on server side list (%s)", "no UID");
return;
}
if ((pszNewGroup != NULL) && (pszNewGroup[0]!='\0') && !getCListGroupExists(pszNewGroup))
{ // the contact moved to non existing group, do not do anything: MetaContact hack
- NetLog_Server("Contact not moved - probably hiding by MetaContacts.");
+ debugLogA("Contact not moved - probably hiding by MetaContacts.");
return;
}
@@ -2281,7 +2281,7 @@ void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
if (!ack)
{ // Could not do anything without cookie
- NetLog_Server("Failed to add contact to server side list (%s)", "malloc failed");
+ debugLogA("Failed to add contact to server side list (%s)", "malloc failed");
return;
}
else
@@ -2312,7 +2312,7 @@ int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD
{
servlistPendingRemoveContact(hContact, contactID, groupID, PENDING_RESULT_FAILED);
// Could not find a usable group ID
- NetLog_Server("Failed to update contact's details on server side list (%s)", "no group ID");
+ debugLogA("Failed to update contact's details on server side list (%s)", "no group ID");
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
}
@@ -2322,7 +2322,7 @@ int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD
{
servlistPendingRemoveContact(hContact, contactID, wGroupID, PENDING_RESULT_FAILED);
// Could not find usable item ID
- NetLog_Server("Failed to update contact's details on server side list (%s)", "no item ID");
+ debugLogA("Failed to update contact's details on server side list (%s)", "no item ID");
SAFE_FREE((void**)&ack);
return CALLBACK_RESULT_CONTINUE;
}
@@ -2353,7 +2353,7 @@ void CIcqProto::servlistUpdateContact(HANDLE hContact)
if (getContactUid(hContact, &dwUin, &szUid))
{
// Could not set nickname on server without uid
- NetLog_Server("Failed to update contact's details on server side list (%s)", "no UID");
+ debugLogA("Failed to update contact's details on server side list (%s)", "no UID");
return;
}
cookie_servlist_action *ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
@@ -2361,7 +2361,7 @@ void CIcqProto::servlistUpdateContact(HANDLE hContact)
if (!ack)
{
// Could not allocate cookie - use old fake
- NetLog_Server("Failed to update contact's details on server side list (%s)", "malloc failed");
+ debugLogA("Failed to update contact's details on server side list (%s)", "malloc failed");
return;
}
else
@@ -2467,7 +2467,7 @@ void CIcqProto::servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGro
cookie_servlist_action* ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
{ // cookie failed
- NetLog_Server("Error: Failed to allocate cookie");
+ debugLogA("Error: Failed to allocate cookie");
SAFE_FREE(&szNewGroupName);
return;
@@ -2536,7 +2536,7 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId)
if (!ack)
{ // cookie failed
- NetLog_Server("Error: Failed to allocate cookie");
+ debugLogA("Error: Failed to allocate cookie");
return;
}
@@ -2580,7 +2580,7 @@ void CIcqProto::resetServContactAuthState(HANDLE hContact, DWORD dwUin)
}
}
else
- NetLog_Server("Error: Failed to allocate cookie");
+ debugLogA("Error: Failed to allocate cookie");
}
}
@@ -2600,9 +2600,9 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
#ifdef _DEBUG
if (cws->value.type == DBVT_DELETED)
- NetLog_Server("DB-Events: Module \"%s\", setting \"%s\" deleted.", cws->szModule, cws->szSetting);
+ debugLogA("DB-Events: Module \"%s\", setting \"%s\" deleted.", cws->szModule, cws->szSetting);
else
- NetLog_Server("DB-Events: Module \"%s\", setting \"%s\" changed, data type %x.", cws->szModule, cws->szSetting, cws->value.type);
+ debugLogA("DB-Events: Module \"%s\", setting \"%s\" changed, data type %x.", cws->szModule, cws->szSetting, cws->value.type);
#endif
if (!strcmpnull(cws->szModule, "CList"))
@@ -2639,7 +2639,7 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
- NetLog_Server("DB-Events: Contact %x deleted.", wParam);
+ debugLogA("DB-Events: Contact %x deleted.", wParam);
#endif
DeleteFromContactsCache((HANDLE)wParam);
@@ -2720,7 +2720,7 @@ int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
WORD wGroupId = getServListGroupLinkID(szOldName);
#ifdef _DEBUG
- NetLog_Server("CList-Events: Group %x:\"%s\" deleted.", wGroupId, szOldName);
+ debugLogA("CList-Events: Group %x:\"%s\" deleted.", wGroupId, szOldName);
#endif
if (wGroupId)
{ // the group is known, remove from server
@@ -2736,7 +2736,7 @@ int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
WORD wGroupId = getServListGroupLinkID(szOldName);
#ifdef _DEBUG
- NetLog_Server("CList-Events: Group %x:\"%s\" changed to \"%s\".", wGroupId, szOldName, szNewName);
+ debugLogA("CList-Events: Group %x:\"%s\" changed to \"%s\".", wGroupId, szOldName, szNewName);
#endif
if (wGroupId)
{ // group is known, rename on server
@@ -2753,7 +2753,7 @@ int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
char *szNewName = grpchg->pszNewName ? tchar_to_utf8(grpchg->pszNewName) : NULL;
#ifdef _DEBUG
- NetLog_Server("CList-Events: Contact %x moved to group \"%s\".", hContact, szNewName);
+ debugLogA("CList-Events: Contact %x moved to group \"%s\".", hContact, szNewName);
#endif
servlistMoveContact(hContact, szNewName);
SAFE_FREE(&szNewName);
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp
index 477ef69600..ba8cbc30ff 100644
--- a/protocols/IcqOscarJ/src/icq_uploadui.cpp
+++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp
@@ -628,7 +628,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
DeleteLastUploadLogLine(hwndDlg);
AppendToUploadLog(hwndDlg, "%s%s", szLastLogLine, ICQTranslateUtfStatic(LPGEN("FAILED"), str, MAX_PATH));
AppendToUploadLog(hwndDlg, ICQTranslateUtfStatic(LPGEN("No upload group available"), str, MAX_PATH));
- ppro->NetLog_Server("Upload failed, no group");
+ ppro->debugLogA("Upload failed, no group");
currentState = STATE_READY;
}
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 255cfb161c..e64b777695 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -430,7 +430,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
delSetting(hContact, DBSETTING_XSTATUS_MSG);
- NetLog_Server("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ debugLogA("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
bChanged = TRUE;
}
@@ -463,7 +463,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
delSetting(hContact, DBSETTING_XSTATUS_MSG);
- NetLog_Server("%s changed custom status to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ debugLogA("%s changed custom status to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
bChanged = TRUE;
}
@@ -481,7 +481,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
}
if (nCustomStatusID != 0 && nMoodID != 0 && nCustomStatusID != nMoodID)
- NetLog_Server("Warning: Diverse custom statuses detected, using mood status.");
+ debugLogA("Warning: Diverse custom statuses detected, using mood status.");
if ((nCustomStatusID == 0 && (caps || !m_bXStatusEnabled)) && (nMoodID == 0 && (moods || !m_bMoodsEnabled))) {
if (getByte(hContact, DBSETTING_XSTATUS_ID, -1) != -1)
diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp
index 7b3115213d..115fe87984 100644
--- a/protocols/IcqOscarJ/src/icq_xtraz.cpp
+++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp
@@ -57,8 +57,8 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w
szWork = strstrnull(szQuery, "<PluginID>");
szEnd = strstrnull(szQuery, "</PluginID>");
#ifdef _DEBUG
- NetLog_Server("Query: %s", szQuery);
- NetLog_Server("Notify: %s", szNotify);
+ debugLogA("Query: %s", szQuery);
+ debugLogA("Notify: %s", szNotify);
#endif
if (szWork && szEnd)
{ // this is our plugin
@@ -154,27 +154,27 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w
handleRateItem(&rr, RQT_RESPONSE, 0, !bThruDC);
}
else if (dwXId)
- NetLog_Server("Privacy: Ignoring XStatus request");
+ debugLogA("Privacy: Ignoring XStatus request");
else
- NetLog_Server("Error: We are not in XStatus, skipping");
+ debugLogA("Error: We are not in XStatus, skipping");
}
else
- NetLog_Server("Error: Invalid sender information");
+ debugLogA("Error: Invalid sender information");
}
else
- NetLog_Server("Error: Missing sender information");
+ debugLogA("Error: Missing sender information");
}
else
- NetLog_Server("Error: Unknown plugin \"%s\" in Xtraz message", szWork);
+ debugLogA("Error: Unknown plugin \"%s\" in Xtraz message", szWork);
}
else
- NetLog_Server("Error: Missing PluginID in Xtraz message");
+ debugLogA("Error: Missing PluginID in Xtraz message");
SAFE_FREE(&szNotify);
SAFE_FREE(&szQuery);
}
else
- NetLog_Server("Error: Invalid Xtraz Notify message");
+ debugLogA("Error: Invalid Xtraz Notify message");
}
@@ -184,7 +184,7 @@ void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HANDLE hContact, WORD wCo
int nResLen;
#ifdef _DEBUG
- NetLog_Server("Received Xtraz Notify Response");
+ debugLogA("Received Xtraz Notify Response");
#endif
szRes = strstrnull(szMsg, "<RES>");
@@ -200,7 +200,7 @@ void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HANDLE hContact, WORD wCo
szMem = szRes = DemangleXml(szRes, nResLen);
#ifdef _DEBUG
- NetLog_Server("Response: %s", szRes);
+ debugLogA("Response: %s", szRes);
#endif
ProtoBroadcastAck(hContact, ICQACKTYPE_XTRAZNOTIFY_RESPONSE, ACKRESULT_SUCCESS, (HANDLE)wCookie, (LPARAM)szRes);
@@ -228,7 +228,7 @@ NextVal:
*szEnd = '\0';
if (atoi(szNode) != getContactXStatus(hContact))
{ // this is strange - but go on
- NetLog_Server("Warning: XStatusIds do not match!");
+ debugLogA("Warning: XStatusIds do not match!");
}
*szEnd = ' ';
}
@@ -277,16 +277,16 @@ NextVal:
goto NextVal;
}
// no next val, we were unable to handle packet, write error
- NetLog_Server("Error: Unknown serverId \"%s\" in Xtraz response", szNode);
+ debugLogA("Error: Unknown serverId \"%s\" in Xtraz response", szNode);
}
}
else
- NetLog_Server("Error: Missing serverId in Xtraz response");
+ debugLogA("Error: Missing serverId in Xtraz response");
SAFE_FREE(&szMem);
}
else
- NetLog_Server("Error: Invalid Xtraz Notify response");
+ debugLogA("Error: Invalid Xtraz Notify response");
}
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index 66ca0b1a9e..04c39e7e11 100644
--- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp
+++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
@@ -563,7 +563,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM wParam, LPARAM lParam)
// if not in our storage, copy
if (lstrcmp(tszFile, tszMyFile) && !CopyFile(tszFile, tszMyFile, FALSE))
{
- NetLog_Server("Failed to copy our avatar to local storage.");
+ debugLogA("Failed to copy our avatar to local storage.");
return iRet;
}
@@ -581,7 +581,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM wParam, LPARAM lParam)
if (setSettingBlob(NULL, "AvatarHash", ihash, 0x14))
{
- NetLog_Server("Failed to save avatar hash.");
+ debugLogA("Failed to save avatar hash.");
}
TCHAR tmp[MAX_PATH];
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index b10a20e456..525652c1d1 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -151,9 +151,9 @@ void CIcqProto::UpdateGlobalSettings()
}
}
- if (m_hServerNetlibUser) {
+ if (m_hNetlibUser) {
NETLIBUSERSETTINGS nlus = { sizeof(NETLIBUSERSETTINGS) };
- if ( !m_bSecureConnection && CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)m_hServerNetlibUser, (LPARAM)&nlus)) {
+ if ( !m_bSecureConnection && CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)m_hNetlibUser, (LPARAM)&nlus)) {
if (nlus.useProxy && nlus.proxyType == PROXYTYPE_HTTP)
m_bGatewayMode = 1;
else
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp
index 1c7aef736f..2314019072 100644
--- a/protocols/IcqOscarJ/src/log.cpp
+++ b/protocols/IcqOscarJ/src/log.cpp
@@ -67,7 +67,7 @@ void __cdecl CIcqProto::icq_LogMessageThread(void* arg)
void CIcqProto::icq_LogMessage(int level, const char *szMsg)
{
- NetLog_Server("%s", szMsg);
+ debugLogA("%s", szMsg);
int displayLevel = getByte("ShowLogLevel", LOG_WARNING);
if (level >= displayLevel)
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index 69e7dfc4c8..67cea9db88 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -394,7 +394,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
char *pszDescription = NULL;
WORD wFilenameLength;
- NetLog_Server("This is a file request");
+ debugLogA("This is a file request");
// This TLV chain may contain the following TLVs:
// TLV(A): Acktype 0x0001 - file request / abort request
@@ -492,7 +492,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
// sanity check
if (!tlv || tlv->wLen < 8)
{
- NetLog_Server("Error: Malformed file request");
+ debugLogA("Error: Malformed file request");
// release structures
SafeReleaseFileTransfer((void**)&ft);
SAFE_FREE(&pszDescription);
@@ -614,7 +614,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
}
}
else
- NetLog_Server("Error: Invalid request, no such transfer");
+ debugLogA("Error: Invalid request, no such transfer");
}
else if (wAckType == 3)
{ // Transfering thru proxy, join tunnel
@@ -642,7 +642,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
}
}
else
- NetLog_Server("Error: Invalid request, no such transfer");
+ debugLogA("Error: Invalid request, no such transfer");
}
else if (wAckType == 4)
{
@@ -662,18 +662,18 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
OpenOscarConnection(hContact, ft, OCT_PROXY_RECV);
}
else
- NetLog_Server("Error: Invalid request, IP missing.");
+ debugLogA("Error: Invalid request, IP missing.");
}
else
- NetLog_Server("Error: Invalid request, no such transfer");
+ debugLogA("Error: Invalid request, no such transfer");
}
else
- NetLog_Server("Error: Uknown Stage %d request", wAckType);
+ debugLogA("Error: Uknown Stage %d request", wAckType);
disposeChain(&chain);
}
else
- NetLog_Server("Error: Missing TLV chain in OFT request");
+ debugLogA("Error: Missing TLV chain in OFT request");
}
else if (wCommand == 1)
{ // transfer cancelled/aborted
@@ -681,7 +681,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
if (ft)
{
- NetLog_Server("OFT: File transfer cancelled by %s", strUID(dwUin, szUID));
+ debugLogA("OFT: File transfer cancelled by %s", strUID(dwUin, szUID));
ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)ft, 0);
// Notify user, that the FT was cancelled // TODO: new ACKRESULT_?
@@ -690,7 +690,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
SafeReleaseFileTransfer((void**)&ft);
}
else
- NetLog_Server("Error: Invalid request, no such transfer");
+ debugLogA("Error: Invalid request, no such transfer");
}
else if (wCommand == 2)
{ // transfer accepted - connection established
@@ -714,14 +714,14 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz
ft->flags |= OFTF_INITIALIZED; // accept was received
}
else
- NetLog_Server("Warning: Received invalid rendezvous accept");
+ debugLogA("Warning: Received invalid rendezvous accept");
}
else
- NetLog_Server("Error: Invalid request, no such transfer");
+ debugLogA("Error: Invalid request, no such transfer");
}
else
{
- NetLog_Server("Error: Unknown wCommand=0x%x in OFT request", wCommand);
+ debugLogA("Error: Unknown wCommand=0x%x in OFT request", wCommand);
}
}
@@ -745,7 +745,7 @@ void CIcqProto::handleRecvServResponseOFT(BYTE *buf, WORD wLen, DWORD dwUin, cha
{
case 1:
{ // FT denied (icq5)
- NetLog_Server("OFT: File transfer denied by %s", strUID(dwUin, szUID));
+ debugLogA("OFT: File transfer denied by %s", strUID(dwUin, szUID));
ProtoBroadcastAck(oft->hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)oft, 0);
// Release transfer
@@ -785,7 +785,7 @@ void CIcqProto::handleRecvServResponseOFT(BYTE *buf, WORD wLen, DWORD dwUin, cha
default:
{
- NetLog_Server("OFT: Uknown request response code 0x%x", wStatus);
+ debugLogA("OFT: Uknown request response code 0x%x", wStatus);
ProtoBroadcastAck(oft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)oft, 0);
// Release transfer
@@ -846,7 +846,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con
char ** filesUtf;
// Initialize filetransfer struct
- NetLog_Server("Init file send");
+ debugLogA("Init file send");
ft = CreateOscarTransfer();
ft->hContact = hContact;
@@ -865,7 +865,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con
for (i = 0; i < filesCount; i++)
{
if (_tstati64(files[i], &statbuf))
- NetLog_Server("IcqSendFile() was passed invalid filename \"%s\"", files[i]);
+ debugLogA("IcqSendFile() was passed invalid filename \"%s\"", files[i]);
else
{
if (!(statbuf.st_mode&_S_IFDIR))
@@ -909,7 +909,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con
return 0; // Failure
}
- NetLog_Server("OFT: Found %d files.", ft->wFilesCount);
+ debugLogA("OFT: Found %d files.", ft->wFilesCount);
ft->szDescription = tchar_to_utf8(pszDesc);
ft->flags = OFTF_SENDING;
@@ -1259,7 +1259,7 @@ int CIcqProto::CreateOscarProxyConnection(oscar_connection *oc)
if (m_bGatewayMode)
nloc.flags |= NLOCF_HTTPGATEWAY;
- oc->hConnection = NetLib_OpenConnection(m_hServerNetlibUser, "Proxy ", &nloc);
+ oc->hConnection = NetLib_OpenConnection(m_hNetlibUser, "Proxy ", &nloc);
if (!oc->hConnection)
{ // proxy connection failed
return 0;
@@ -1433,7 +1433,7 @@ void __cdecl CIcqProto::oft_connectionThread( oscarthreadstartinfo *otsi )
nloc.wPort = RandRange(1024, 65535);
if (m_bGatewayMode)
nloc.flags |= NLOCF_HTTPGATEWAY;
- oc.hConnection = NetLib_OpenConnection(m_hServerNetlibUser, "Proxy ", &nloc);
+ oc.hConnection = NetLib_OpenConnection(m_hNetlibUser, "Proxy ", &nloc);
if (!oc.hConnection)
{ // proxy connection failed, we are out of possibilities
ProtoBroadcastAck(oc.ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, oc.ft, 0);
@@ -1715,7 +1715,7 @@ int CIcqProto::oft_handleProxyData(oscar_connection *oc, BYTE *buf, int len)
// Notify peer
oft_sendFileResponse(oc->dwUin, oc->szUid, oc->ft, 0x06);
- NetLog_Server("Proxy Error: %s (0x%x)", szError, wError);
+ debugLogA("Proxy Error: %s (0x%x)", szError, wError);
// Notify UI
ProtoBroadcastAck(oc->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, oc->ft, 0);
// Release structure
@@ -1743,7 +1743,7 @@ int CIcqProto::oft_handleProxyData(oscar_connection *oc, BYTE *buf, int len)
}
else
{
- NetLog_Server("Proxy Tunnel ready, notify peer.");
+ debugLogA("Proxy Tunnel ready, notify peer.");
oft_sendFileRedirect(oc->dwUin, oc->szUid, ft, dwIP, wCode, TRUE);
}
}
@@ -1761,7 +1761,7 @@ int CIcqProto::oft_handleProxyData(oscar_connection *oc, BYTE *buf, int len)
ft->flags |= OFTF_INITIALIZED;
}
- NetLog_Server("Proxy Tunnel established");
+ debugLogA("Proxy Tunnel established");
if ((ft->flags & OFTF_INITIALIZED) && (ft->flags & OFTF_SENDING) && !(ft->flags & OFTF_FILE_REQUEST_SENT))
{
@@ -1772,7 +1772,7 @@ int CIcqProto::oft_handleProxyData(oscar_connection *oc, BYTE *buf, int len)
break;
default:
- NetLog_Server("Unknown proxy command 0x%x", wCommand);
+ debugLogA("Unknown proxy command 0x%x", wCommand);
}
buf += datalen;
@@ -1935,7 +1935,7 @@ void CIcqProto::handleOFT2FramePacket(oscar_connection *oc, WORD datatype, BYTE
{ // the 32bits does not match, use them as full size
ft->qwTotalSize = dwSize;
- NetLog_Server("Warning: Invalid total size.");
+ debugLogA("Warning: Invalid total size.");
}
}
else
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp
index 35bae4ca14..4de31b3e9a 100644
--- a/protocols/IcqOscarJ/src/stdpackets.cpp
+++ b/protocols/IcqOscarJ/src/stdpackets.cpp
@@ -982,12 +982,12 @@ void CIcqProto::icq_sendFileAcceptServ(DWORD dwUin, filetransfer *ft, int nAckTy
if (ft->nVersion >= 8)
{
icq_sendFileAcceptServv8(dwUin, ft->pMessage.dwMsgID1, ft->pMessage.dwMsgID2, ft->dwCookie, ft->szFilename, szDesc, ft->dwTotalSize, wListenPort, TRUE, nAckType);
- NetLog_Server("Sent file accept v%u through server, port %u", 8, wListenPort);
+ debugLogA("Sent file accept v%u through server, port %u", 8, wListenPort);
}
else
{
icq_sendFileAcceptServv7(dwUin, ft->pMessage.dwMsgID1, ft->pMessage.dwMsgID2, ft->dwCookie, ft->szFilename, szDesc, ft->dwTotalSize, wListenPort, TRUE, nAckType);
- NetLog_Server("Sent file accept v%u through server, port %u", 7, wListenPort);
+ debugLogA("Sent file accept v%u through server, port %u", 7, wListenPort);
}
}
@@ -997,12 +997,12 @@ void CIcqProto::icq_sendFileDenyServ(DWORD dwUin, filetransfer *ft, const char *
if (ft->nVersion >= 8)
{
icq_sendFileAcceptServv8(dwUin, ft->pMessage.dwMsgID1, ft->pMessage.dwMsgID2, ft->dwCookie, ft->szFilename, szReason, ft->dwTotalSize, wListenPort, FALSE, nAckType);
- NetLog_Server("Sent file deny v%u through server", 8);
+ debugLogA("Sent file deny v%u through server", 8);
}
else
{
icq_sendFileAcceptServv7(dwUin, ft->pMessage.dwMsgID1, ft->pMessage.dwMsgID2, ft->dwCookie, ft->szFilename, szReason, ft->dwTotalSize, wListenPort, FALSE, nAckType);
- NetLog_Server("Sent file deny v%u through server", 7);
+ debugLogA("Sent file deny v%u through server", 7);
}
}
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 7b6e87cf40..1e073e55b0 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -354,7 +354,7 @@ void CIcqProto::AddToContactsCache(HANDLE hContact, DWORD dwUin, const char *szU
return;
#ifdef _DEBUG
- NetLog_Server("Adding contact to cache: %u%s%s", dwUin, dwUin ? "" : " - ", dwUin ? "" : szUid);
+ debugLogA("Adding contact to cache: %u%s%s", dwUin, dwUin ? "" : " - ", dwUin ? "" : szUid);
#endif
icq_contacts_cache *cache_item = (icq_contacts_cache*)SAFE_MALLOC(sizeof(icq_contacts_cache));
@@ -432,7 +432,7 @@ void CIcqProto::DeleteFromContactsCache(HANDLE hContact)
if (cache_item->hContact == hContact)
{
#ifdef _DEBUG
- NetLog_Server("Removing contact from cache: %u%s%s, position: %u", cache_item->dwUin, cache_item->dwUin ? "" : " - ", cache_item->dwUin ? "" : cache_item->szUid, i);
+ debugLogA("Removing contact from cache: %u%s%s, position: %u", cache_item->dwUin, cache_item->dwUin ? "" : " - ", cache_item->dwUin ? "" : cache_item->szUid, i);
#endif
contactsCache.remove(i);
// Release memory
@@ -486,7 +486,7 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact)
{
- NetLog_Server("Failed to create ICQ contact %u", dwUin);
+ debugLogA("Failed to create ICQ contact %u", dwUin);
return INVALID_HANDLE_VALUE;
}
@@ -494,7 +494,7 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
{
// For some reason we failed to register the protocol to this contact
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- NetLog_Server("Failed to register ICQ contact %u", dwUin);
+ debugLogA("Failed to register ICQ contact %u", dwUin);
return INVALID_HANDLE_VALUE;
}
@@ -1033,9 +1033,9 @@ void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments)
Sleep(150);
if (pArguments->nAckResult == ACKRESULT_SUCCESS)
- NetLog_Server("Sent fake message ack");
+ debugLogA("Sent fake message ack");
else if (pArguments->nAckResult == ACKRESULT_FAILED)
- NetLog_Server("Message delivery failed");
+ debugLogA("Message delivery failed");
ProtoBroadcastAck(pArguments->hContact, pArguments->nAckType, pArguments->nAckResult, pArguments->hSequence, pArguments->pszMessage);
@@ -1141,7 +1141,7 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
m_ratesMutex->Leave();
cookieMutex->Leave();
#ifdef _DEBUG
- NetLog_Server("Rates: SetStatusNote delayed %dms", nDelay);
+ debugLogA("Rates: SetStatusNote delayed %dms", nDelay);
#endif
SleepEx(nDelay, TRUE); // do not keep things locked during sleep
cookieMutex->Enter();
@@ -1175,7 +1175,7 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
m_ratesMutex->Leave();
cookieMutex->Leave();
#ifdef _DEBUG
- NetLog_Server("Rates: SetStatusNote delayed %dms", nDelay);
+ debugLogA("Rates: SetStatusNote delayed %dms", nDelay);
#endif
SleepEx(nDelay, TRUE); // do not keep things locked during sleep
cookieMutex->Enter();
@@ -1724,17 +1724,6 @@ void NetLib_SafeCloseHandle(HANDLE *hConnection)
}
-int CIcqProto::NetLog_Server(const char *fmt,...)
-{
- va_list va;
- char szText[1024];
-
- va_start(va,fmt);
- mir_vsnprintf(szText,sizeof(szText),fmt,va);
- va_end(va);
- return CallService(MS_NETLIB_LOG,(WPARAM)m_hServerNetlibUser,(LPARAM)szText);
-}
-
int CIcqProto::NetLog_Direct(const char *fmt,...)
{
va_list va;
@@ -1759,7 +1748,7 @@ int CIcqProto::NetLog_Uni(BOOL bDC, const char *fmt,...)
if (bDC)
hNetlib = m_hDirectNetlibUser;
else
- hNetlib = m_hServerNetlibUser;
+ hNetlib = m_hNetlibUser;
return CallService(MS_NETLIB_LOG,(WPARAM)hNetlib,(LPARAM)szText);
}