diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
commit | 773421e8ba17637d994088c393d406226b516a30 (patch) | |
tree | 130c0bf529e30f493ae4f2abbe1230d31fecdeed /protocols/Yahoo | |
parent | 3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff) |
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers
git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r-- | protocols/Yahoo/src/avatar.cpp | 34 | ||||
-rw-r--r-- | protocols/Yahoo/src/file_transfer.cpp | 34 | ||||
-rw-r--r-- | protocols/Yahoo/src/http_gateway.cpp | 14 | ||||
-rw-r--r-- | protocols/Yahoo/src/ignore.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/im.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/proto.cpp | 60 | ||||
-rw-r--r-- | protocols/Yahoo/src/proto.h | 7 | ||||
-rw-r--r-- | protocols/Yahoo/src/server.cpp | 16 | ||||
-rw-r--r-- | protocols/Yahoo/src/services.cpp | 24 | ||||
-rw-r--r-- | protocols/Yahoo/src/util.cpp | 29 | ||||
-rw-r--r-- | protocols/Yahoo/src/yahoo.cpp | 44 | ||||
-rw-r--r-- | protocols/Yahoo/src/yahoo.h | 12 |
12 files changed, 129 insertions, 153 deletions
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 2e3c71cacf..47318c1b3e 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -107,7 +107,7 @@ void __cdecl CYahooProto::send_avt_thread(void *psf) {
struct yahoo_file_info *sf = ( yahoo_file_info* )psf;
if (sf == NULL) {
- DebugLog("[yahoo_send_avt_thread] SF IS NULL!!!");
+ debugLogA("[yahoo_send_avt_thread] SF IS NULL!!!");
return;
}
@@ -139,7 +139,7 @@ void CYahooProto::SendAvatar(const TCHAR *szFile) WideCharToMultiByte(CP_ACP, 0, tszFilename, -1, szFilename, MAX_PATH, 0, 0);
sf->filename = strdup(szFilename);
- DebugLog("[Uploading avatar] filename: %s size: %ld", sf->filename, sf->filesize);
+ debugLogA("[Uploading avatar] filename: %s size: %ld", sf->filename, sf->filesize);
ForkThread(&CYahooProto::send_avt_thread, sf);
}
@@ -159,12 +159,12 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) TCHAR buf[4096];
if (avt == NULL) {
- DebugLog("AVT IS NULL!!!");
+ debugLogA("AVT IS NULL!!!");
return;
}
if (!m_bLoggedIn) {
- DebugLog("We are not logged in!!!");
+ debugLogA("We are not logged in!!!");
return;
}
@@ -358,7 +358,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p if (getDword(hContact, "PictCK", 0) != cksum || _taccess( z, 0) != 0) {
- DebugLog("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d",
+ debugLogA("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d",
getDword(hContact, "PictCK", 0), cksum);
struct avatar_info *avt = ( avatar_info* )malloc(sizeof(struct avatar_info));
@@ -630,24 +630,24 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam) int avtType;
if (!getString(AI->hContact, YAHOO_LOGINID, &dbv)) {
- DebugLog("[YAHOO_GETAVATARINFO] For: %s", dbv.pszVal);
+ debugLogA("[YAHOO_GETAVATARINFO] For: %s", dbv.pszVal);
db_free(&dbv);
}else {
- DebugLog("[YAHOO_GETAVATARINFO]");
+ debugLogA("[YAHOO_GETAVATARINFO]");
}
if (!getByte("ShowAvatars", 1 ) || !m_bLoggedIn) {
- DebugLog("[YAHOO_GETAVATARINFO] %s", m_bLoggedIn ? "We are not using/showing avatars!" : "We are not logged in. Can't load avatars now!");
+ debugLogA("[YAHOO_GETAVATARINFO] %s", m_bLoggedIn ? "We are not using/showing avatars!" : "We are not logged in. Can't load avatars now!");
return GAIR_NOAVATAR;
}
avtType = getByte(AI->hContact, "AvatarType", 0);
- DebugLog("[YAHOO_GETAVATARINFO] Avatar Type: %d", avtType);
+ debugLogA("[YAHOO_GETAVATARINFO] Avatar Type: %d", avtType);
if ( avtType != 2) {
if (avtType != 0)
- DebugLog("[YAHOO_GETAVATARINFO] Not handling this type yet!");
+ debugLogA("[YAHOO_GETAVATARINFO] Not handling this type yet!");
return GAIR_NOAVATAR;
}
@@ -657,7 +657,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam) GetAvatarFileName(AI->hContact, AI->filename, SIZEOF(AI->filename), getByte(AI->hContact, "AvatarType", 0));
AI->format = PA_FORMAT_PNG;
- DebugLog("[YAHOO_GETAVATARINFO] filename: %s", AI->filename);
+ debugLogA("[YAHOO_GETAVATARINFO] filename: %s", AI->filename);
if (_taccess( AI->filename, 0) == 0)
return GAIR_SUCCESS;
@@ -666,25 +666,25 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam) /* need to request it again? */
if (getDword(AI->hContact, "PictLoading", 0) != 0 &&
(time(NULL) - getDword(AI->hContact, "PictLastCheck", 0) < 500)) {
- DebugLog("[YAHOO_GETAVATARINFO] Waiting for avatar to load!");
+ debugLogA("[YAHOO_GETAVATARINFO] Waiting for avatar to load!");
return GAIR_WAITFOR;
} else if ( m_bLoggedIn ) {
DBVARIANT dbv;
if (!getString(AI->hContact, YAHOO_LOGINID, &dbv)) {
- DebugLog("[YAHOO_GETAVATARINFO] Requesting avatar!");
+ debugLogA("[YAHOO_GETAVATARINFO] Requesting avatar!");
request_avatar(dbv.pszVal);
db_free(&dbv);
return GAIR_WAITFOR;
} else {
- DebugLog("[YAHOO_GETAVATARINFO] Can't retrieve user id?!");
+ debugLogA("[YAHOO_GETAVATARINFO] Can't retrieve user id?!");
}
}
}
- DebugLog("[YAHOO_GETAVATARINFO] NO AVATAR???");
+ debugLogA("[YAHOO_GETAVATARINFO] NO AVATAR???");
return GAIR_NOAVATAR;
}
@@ -751,7 +751,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) TCHAR *buffer = ( TCHAR* )wParam;
int size = (int)lParam;
- DebugLog("[YahooGetMyAvatar]");
+ debugLogA("[YahooGetMyAvatar]");
if (buffer == NULL || size <= 0)
return -1;
@@ -792,7 +792,7 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) GetAvatarFileName(NULL, tszMyFile, MAX_PATH, 2);
if (tszFile == NULL) {
- DebugLog("[Deleting Avatar Info]");
+ debugLogA("[Deleting Avatar Info]");
/* remove ALL our Avatar Info Keys */
delSetting("AvatarFile");
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index b629e39a7b..a3ac8bc57b 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -463,7 +463,7 @@ void __cdecl CYahooProto::recv_filethread(void *psf) ProtoBroadcastAck(sf->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, sf, 0);
- DebugLog("[yahoo_recv_filethread] who: %s, msg: %s, filename: %s ", sf->who, sf->msg, fi->filename);
+ debugLogA("[yahoo_recv_filethread] who: %s, msg: %s, filename: %s ", sf->who, sf->msg, fi->filename);
yahoo_get_url_handle(m_id, sf->url, &dl_file, sf);
@@ -471,7 +471,7 @@ void __cdecl CYahooProto::recv_filethread(void *psf) if (sf->pfts.currentFileNumber >= sf->pfts.totalFiles)
free_ft(sf);
else
- DebugLog("[yahoo_recv_filethread] More files coming?");
+ debugLogA("[yahoo_recv_filethread] More files coming?");
}
void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, long expires, const char *msg, const char *fname, unsigned long fesize, const char *ft_token, int y7)
@@ -512,7 +512,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, y_filetransfer *ft = new_ft(this, m_id, hContact, who, msg, url, ft_token, y7, files, 0 /* downloading */);
if (ft == NULL) {
- DebugLog("SF IS NULL!!!");
+ debugLogA("SF IS NULL!!!");
return;
}
@@ -547,7 +547,7 @@ void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_ ft = new_ft(this, m_id, hContact, who, NULL, NULL, ft_token, y7, files, 0 /* downloading */);
if (ft == NULL) {
- DebugLog("SF IS NULL!!!");
+ debugLogA("SF IS NULL!!!");
return;
}
@@ -690,7 +690,7 @@ void __cdecl CYahooProto::send_filethread(void *psf) if (sf->pfts.currentFileNumber >= sf->pfts.totalFiles) {
free_ft(sf);
} else {
- DebugLog("[yahoo_send_filethread] More files coming?");
+ debugLogA("[yahoo_send_filethread] More files coming?");
}
}
@@ -742,7 +742,7 @@ HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescri db_free(&dbv);
if (sf == NULL) {
- DebugLog("SF IS NULL!!!");
+ debugLogA("SF IS NULL!!!");
return 0;
}
@@ -768,7 +768,7 @@ HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, co y_filetransfer *ft = (y_filetransfer *)hTransfer;
size_t len;
- DebugLog("[YahooFileAllow]");
+ debugLogA("[YahooFileAllow]");
//LOG(LOG_INFO, "[%s] Requesting file from %s", ft->cookie, ft->user);
ft->pfts.tszWorkingDir = _tcsdup( szPath );
@@ -778,7 +778,7 @@ HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, co ft->pfts.tszWorkingDir[len] = 0;
if (ft->y7) {
- DebugLog("[YahooFileAllow] Trying to relay Y7 transfer.");
+ debugLogA("[YahooFileAllow] Trying to relay Y7 transfer.");
//void yahoo_ft7dc_accept(int id, const char *buddy, const char *ft_token);
yahoo_ft7dc_accept(ft->id, ft->who, ft->ftoken);
@@ -794,7 +794,7 @@ HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, co int __cdecl CYahooProto::FileCancel( HANDLE /*hContact*/, HANDLE hTransfer )
{
- DebugLog("[YahooFileCancel]");
+ debugLogA("[YahooFileCancel]");
y_filetransfer* ft = (y_filetransfer*)hTransfer;
@@ -820,15 +820,15 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const /* deny file receive request.. just ignore it! */
y_filetransfer *ft = (y_filetransfer *)hTransfer;
- DebugLog("[YahooFileDeny]");
+ debugLogA("[YahooFileDeny]");
if ( !m_bLoggedIn || ft == NULL) {
- DebugLog("[YahooFileDeny] Not logged-in or some other error!");
+ debugLogA("[YahooFileDeny] Not logged-in or some other error!");
return 1;
}
if (ft->y7) {
- DebugLog("[YahooFileDeny] Y7 Transfer detected.");
+ debugLogA("[YahooFileDeny] Y7 Transfer detected.");
//void yahoo_ft7dc_accept(int id, const char *buddy, const char *ft_token);
yahoo_ft7dc_deny(ft->id, ft->who, ft->ftoken);
return 0;
@@ -837,7 +837,7 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const if (ft->ftoken != NULL) {
struct yahoo_file_info *fi = (struct yahoo_file_info *)ft->files->data;
- DebugLog("[YahooFileDeny] DC Detected: Denying File Transfer!");
+ debugLogA("[YahooFileDeny] DC Detected: Denying File Transfer!");
yahoo_ftdc_deny(m_id, ft->who, fi->filename, ft->ftoken, 2);
}
return 0;
@@ -850,19 +850,19 @@ int __cdecl CYahooProto::FileResume( HANDLE hTransfer, int* action, const PROTOC {
y_filetransfer *ft = (y_filetransfer *)hTransfer;
- DebugLog("[YahooFileResume] Action: %d", *action);
+ debugLogA("[YahooFileResume] Action: %d", *action);
if ( !m_bLoggedIn || ft == NULL) {
- DebugLog("[YahooFileResume] Not loggedin or some other error!");
+ debugLogA("[YahooFileResume] Not loggedin or some other error!");
return 1;
}
ft->action = *action;
- DebugLog("[YahooFileResume] Action: %d", *action);
+ debugLogA("[YahooFileResume] Action: %d", *action);
if ( *action == FILERESUME_RENAME ) {
- DebugLog("[YahooFileResume] Renamed file!");
+ debugLogA("[YahooFileResume] Renamed file!");
FREE(ft->pfts.tszCurrentFile);
ft->pfts.tszCurrentFile = _tcsdup( *szFilename );
diff --git a/protocols/Yahoo/src/http_gateway.cpp b/protocols/Yahoo/src/http_gateway.cpp index ab096a3261..bbdc47c861 100644 --- a/protocols/Yahoo/src/http_gateway.cpp +++ b/protocols/Yahoo/src/http_gateway.cpp @@ -19,7 +19,7 @@ int YAHOO_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPRE {
NETLIBHTTPPROXYINFO nlhpi;
- DebugLog("YAHOO_httpGatewayInit!!!");
+ debugLogA("YAHOO_httpGatewayInit!!!");
ZeroMemory(&nlhpi, sizeof(nlhpi));
nlhpi.cbSize = sizeof(nlhpi);
@@ -30,7 +30,7 @@ int YAHOO_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPRE int YAHOO_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend)
{
- DebugLog("YAHOO_httpGatewayWrapSend!!! Len: %d", len);
+ debugLogA("YAHOO_httpGatewayWrapSend!!! Len: %d", len);
if (len == 0 && m_id > 0) { // we need to send something!!!
int n;
@@ -38,12 +38,12 @@ int YAHOO_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags, MIRAN int ret = 0;
if (z != NULL) {
- DebugLog("YAHOO_httpGatewayWrapSend!!! Got Len: %d", n);
+ debugLogA("YAHOO_httpGatewayWrapSend!!! Got Len: %d", n);
NETLIBBUFFER tBuf = { ( char* )z, n, flags };
ret = pfnNetlibSend((LPARAM)hConn, (WPARAM) &tBuf );
FREE(z);
} else {
- DebugLog("YAHOO_httpGatewayWrapSend!!! GOT NULL???");
+ debugLogA("YAHOO_httpGatewayWrapSend!!! GOT NULL???");
}
return ret;
@@ -56,15 +56,15 @@ int YAHOO_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags, MIRAN PBYTE YAHOO_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *(*NetlibRealloc)(void *, size_t))
{
- DebugLog("YAHOO_httpGatewayUnwrapRecv!!! Len: %d", len);
+ debugLogA("YAHOO_httpGatewayUnwrapRecv!!! Len: %d", len);
- DebugLog("Got headers: %d", nlhr->headersCount);
+ debugLogA("Got headers: %d", nlhr->headersCount);
/* we need to get the first 4 bytes! */
if (len < 4)
return NULL;
ylad->rpkts = buf[0] + buf[1] *256;
- DebugLog("Got packets: %d", ylad->rpkts);
+ debugLogA("Got packets: %d", ylad->rpkts);
if (len == 4) {
*outBufLen = 0;
diff --git a/protocols/Yahoo/src/ignore.cpp b/protocols/Yahoo/src/ignore.cpp index 3a0a6f2cdb..4c7cb47225 100644 --- a/protocols/Yahoo/src/ignore.cpp +++ b/protocols/Yahoo/src/ignore.cpp @@ -56,11 +56,11 @@ void CYahooProto::ext_got_ignore(YList * igns) while (l != NULL) {
struct yahoo_buddy *b = (struct yahoo_buddy *) l->data;
- YAHOO_DEBUGLOG("[ext_yahoo_got_ignore] Buddy: %s", b->id );
+ debugLogA("[ext_yahoo_got_ignore] Buddy: %s", b->id );
l = l->next;
}
- YAHOO_DEBUGLOG("[ext_yahoo_got_ignore] End Of Ignore List");
+ debugLogA("[ext_yahoo_got_ignore] End Of Ignore List");
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 08ab726172..63ef43875b 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -213,7 +213,7 @@ int __cdecl CYahooProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre ) // NUDGES
if ( !lstrcmpA(pre->szMessage, "<ding>") && ServiceExists("NUDGE/Send")) {
- DebugLog("[YahooRecvMessage] Doing Nudge Service!");
+ debugLogA("[YahooRecvMessage] Doing Nudge Service!");
NotifyEventHooks(hYahooNudge, (WPARAM)hContact, pre->timestamp);
return 0;
}
@@ -229,7 +229,7 @@ INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE) wParam;
- DebugLog("[YAHOO_SENDNUDGE]");
+ debugLogA("[YAHOO_SENDNUDGE]");
if (!m_bLoggedIn) {/* don't send nudge if we not connected! */
ForkThread( &CYahooProto::im_sendackfail, hContact );
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 22dfba71f1..37e234cd89 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -46,7 +46,7 @@ CYahooProto::~CYahooProto() if (m_bLoggedIn)
logout();
- DebugLog("Logged out");
+ debugLogA("Logged out");
DestroyHookableEvent(hYahooNudge);
@@ -103,15 +103,15 @@ int CYahooProto::OnModulesLoadedEx( WPARAM, LPARAM ) HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )
{
- DebugLog("[YahooAddToList] Flags: %d", flags);
+ debugLogA("[YahooAddToList] Flags: %d", flags);
if (!m_bLoggedIn) {
- DebugLog("[YahooAddToList] WARNING: WE ARE OFFLINE!");
+ debugLogA("[YahooAddToList] WARNING: WE ARE OFFLINE!");
return 0;
}
if (psr == NULL || psr->cbSize != sizeof( PROTOSEARCHRESULT )) {
- DebugLog("[YahooAddToList] Empty data passed?");
+ debugLogA("[YahooAddToList] Empty data passed?");
return 0;
}
@@ -119,19 +119,19 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) HANDLE hContact = getbuddyH(id);
if (hContact != NULL) {
if (db_get_b(hContact, "CList", "NotOnList", 0)) {
- DebugLog("[YahooAddToList] Temporary Buddy:%s already on our buddy list", id);
+ debugLogA("[YahooAddToList] Temporary Buddy:%s already on our buddy list", id);
//return 0;
} else {
- DebugLog("[YahooAddToList] Buddy:%s already on our buddy list", id);
+ debugLogA("[YahooAddToList] Buddy:%s already on our buddy list", id);
mir_free(id);
return 0;
}
} else if (flags & PALF_TEMPORARY) { /* not on our list */
- DebugLog("[YahooAddToList] Adding Temporary Buddy:%s ", id);
+ debugLogA("[YahooAddToList] Adding Temporary Buddy:%s ", id);
}
int protocol = psr->reserved[0];
- DebugLog("Adding buddy:%s", id);
+ debugLogA("Adding buddy:%s", id);
hContact = add_buddy(id, id, protocol, flags);
mir_free(id);
return hContact;
@@ -139,38 +139,38 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent )
{
- DebugLog("[YahooAddToListByEvent]");
+ debugLogA("[YahooAddToListByEvent]");
if (!m_bLoggedIn)
return 0;
DBEVENTINFO dbei = { sizeof( dbei ) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1 ) {
- DebugLog("[YahooAddToListByEvent] ERROR: Can't get blob size.");
+ debugLogA("[YahooAddToListByEvent] ERROR: Can't get blob size.");
return 0;
}
- DebugLog("[YahooAddToListByEvent] Got blob size: %lu", dbei.cbBlob);
+ debugLogA("[YahooAddToListByEvent] Got blob size: %lu", dbei.cbBlob);
dbei.pBlob = ( PBYTE )_alloca( dbei.cbBlob );
if (db_event_get(hDbEvent, &dbei)) {
- DebugLog("[YahooAddToListByEvent] ERROR: Can't get event.");
+ debugLogA("[YahooAddToListByEvent] ERROR: Can't get event.");
return 0;
}
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) {
- DebugLog("[YahooAddToListByEvent] ERROR: Not an authorization request.");
+ debugLogA("[YahooAddToListByEvent] ERROR: Not an authorization request.");
return 0;
}
if ( strcmp(dbei.szModule, m_szModuleName)) {
- DebugLog("[YahooAddToListByEvent] ERROR: Not Yahoo protocol.");
+ debugLogA("[YahooAddToListByEvent] ERROR: Not Yahoo protocol.");
return 0;
}
HANDLE hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL)
- DebugLog("Temp Buddy found at: %p ", hContact);
+ debugLogA("Temp Buddy found at: %p ", hContact);
else
- DebugLog("hContact NULL???");
+ debugLogA("hContact NULL???");
return hContact;
}
@@ -180,9 +180,9 @@ HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDL int CYahooProto::Authorize( HANDLE hdbe )
{
- DebugLog("[YahooAuthAllow]");
+ debugLogA("[YahooAuthAllow]");
if ( !m_bLoggedIn ) {
- DebugLog("[YahooAuthAllow] Not Logged In!");
+ debugLogA("[YahooAuthAllow] Not Logged In!");
return 1;
}
@@ -206,7 +206,7 @@ int CYahooProto::Authorize( HANDLE hdbe ) ptrA who( getStringA(hContact, YAHOO_LOGINID));
if (who) {
ptrA myid( getStringA(hContact, "MyIdentity"));
- DebugLog("Accepting buddy:%s", who);
+ debugLogA("Accepting buddy:%s", who);
accept(myid, who, getWord(hContact, "yprotoid", 0));
}
}
@@ -219,29 +219,29 @@ int CYahooProto::Authorize( HANDLE hdbe ) int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
{
- DebugLog("[YahooAuthDeny]");
+ debugLogA("[YahooAuthDeny]");
if ( !m_bLoggedIn )
return 1;
DBEVENTINFO dbei = { sizeof( dbei ) };
if (( dbei.cbBlob = db_event_getBlobSize(hdbe)) == -1 ) {
- DebugLog("[YahooAuthDeny] ERROR: Can't get blob size");
+ debugLogA("[YahooAuthDeny] ERROR: Can't get blob size");
return 1;
}
dbei.pBlob = ( PBYTE )alloca( dbei.cbBlob );
if (db_event_get(hdbe, &dbei)) {
- DebugLog("YahooAuthDeny - Can't get db event!");
+ debugLogA("YahooAuthDeny - Can't get db event!");
return 1;
}
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) {
- DebugLog("YahooAuthDeny - not Authorization event");
+ debugLogA("YahooAuthDeny - not Authorization event");
return 1;
}
if (strcmp( dbei.szModule, m_szModuleName)) {
- DebugLog("YahooAuthDeny - wrong module?");
+ debugLogA("YahooAuthDeny - wrong module?");
return 1;
}
@@ -253,7 +253,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) ptrA myid( getStringA(hContact, "MyIdentity"));
ptrA u_reason( mir_utf8encodeT(reason));
- DebugLog("Rejecting buddy:%s msg: %s", who, u_reason);
+ debugLogA("Rejecting buddy:%s msg: %s", who, u_reason);
reject(myid, who, getWord(hContact, "yprotoid", 0), u_reason);
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
}
@@ -266,7 +266,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
{
- DebugLog("[YahooRecvAuth] ");
+ debugLogA("[YahooRecvAuth] ");
db_unset(hContact,"CList","Hidden");
Proto_AuthRecv(m_szModuleName, pre);
@@ -278,7 +278,7 @@ int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre) int __cdecl CYahooProto::AuthRequest( HANDLE hContact, const TCHAR* msg )
{
- DebugLog("[YahooSendAuthRequest]");
+ debugLogA("[YahooSendAuthRequest]");
if (hContact && m_bLoggedIn) {
AddBuddy(hContact, "miranda", msg);
@@ -581,7 +581,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact) HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact )
{
- DebugLog("[YahooGetAwayMessage] ");
+ debugLogA("[YahooGetAwayMessage] ");
if (hContact && m_bLoggedIn) {
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
@@ -609,11 +609,11 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg ) {
char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL;
- DebugLog("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c);
+ debugLogA("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c);
if (!m_bLoggedIn) {
if (m_iStatus == ID_STATUS_OFFLINE) {
- DebugLog("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
+ debugLogA("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
mir_free(c);
return 1;
} else {
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 4124737890..7bff1a73dd 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -233,12 +233,6 @@ struct CYahooProto : public PROTO<CYahooProto> int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL );
bool IsMyContact(HANDLE hContact);
- #ifdef __GNUC__
- int DebugLog( const char *fmt, ... ) __attribute__ ((format(printf,2,3)));
- #else
- int DebugLog( const char *fmt, ... );
- #endif
-
//====| yahoo.cpp |===================================================================
HANDLE add_buddy( const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags );
const char *find_buddy( const char *yahoo_id);
@@ -293,7 +287,6 @@ private: long lLastSend;
HANDLE hYahooNudge;
- HANDLE m_hNetlibUser;
HGENMENU mainMenuRoot;
HGENMENU hShowProfileMenuItem;
diff --git a/protocols/Yahoo/src/server.cpp b/protocols/Yahoo/src/server.cpp index 329b797789..aaaac11341 100644 --- a/protocols/Yahoo/src/server.cpp +++ b/protocols/Yahoo/src/server.cpp @@ -54,7 +54,7 @@ void __cdecl CYahooProto::server_main(void *empty) NETLIBSELECTEX nls = {0};
int recvResult, ridx = 0, widx = 0, i;
- DebugLog("Server Thread Starting status: %d", status);
+ debugLogA("Server Thread Starting status: %d", status);
do_yahoo_debug=YAHOO_LOG_DEBUG;
yahoo_set_log_level(( yahoo_log_level )do_yahoo_debug);
@@ -100,13 +100,13 @@ void __cdecl CYahooProto::server_main(void *empty) }
}
- //DebugLog("[Yahoo_Server] ridx:%d widx:%d", ridx, widx);
+ //debugLogA("[Yahoo_Server] ridx:%d widx:%d", ridx, widx);
nls.hReadConns[ridx] = NULL;
nls.hWriteConns[widx] = NULL;
if (m_connections == NULL) {
- DebugLog("Last connection closed.");
+ debugLogA("Last connection closed.");
break;
}
recvResult = CallService(MS_NETLIB_SELECTEX, (WPARAM) 0, (LPARAM)&nls);
@@ -114,7 +114,7 @@ void __cdecl CYahooProto::server_main(void *empty) /* do the timer check */
if (m_id > 0) {
#ifdef HTTP_GATEWAY
- //DebugLog("HTTPGateway: %d", iHTTPGateway);
+ //debugLogA("HTTPGateway: %d", iHTTPGateway);
if (!iHTTPGateway) {
#endif
t = time(NULL);
@@ -135,7 +135,7 @@ void __cdecl CYahooProto::server_main(void *empty) #ifdef HTTP_GATEWAY
} else {
- DebugLog("[SERVER] Got packets: %d", ylad->rpkts);
+ debugLogA("[SERVER] Got packets: %d", ylad->rpkts);
if ( m_bLoggedIn && ( (ylad->rpkts > 0 && (time(NULL) - lLastSend) >=3) ||
( (time(NULL) - lLastSend) >= 13)) ) {
@@ -190,11 +190,11 @@ void __cdecl CYahooProto::server_main(void *empty) /* Check for Miranda Exit Status */
if (Miranda_Terminated()) {
- DebugLog("Miranda Exiting... stopping the loop.");
+ debugLogA("Miranda Exiting... stopping the loop.");
break;
}
}
- DebugLog("Exited loop");
+ debugLogA("Exited loop");
/* cleanup the data stuff and close our connection handles */
while(m_connections) {
@@ -217,5 +217,5 @@ void __cdecl CYahooProto::server_main(void *empty) BroadcastStatus(ID_STATUS_OFFLINE);
logoff_buddies();
- DebugLog("Server thread ending");
+ debugLogA("Server thread ending");
}
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 397f655ad2..0df9cbbf41 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -71,7 +71,7 @@ void CYahooProto::BroadcastStatus(int s) m_iStatus = ID_STATUS_ONLINE;
}
- DebugLog("[yahoo_util_broadcaststatus] Old Status: %S (%d), New Status: %S (%d)",
+ debugLogA("[yahoo_util_broadcaststatus] Old Status: %S (%d), New Status: %S (%d)",
pcli->pfnGetStatusModeDescription(oldStatus, 0), oldStatus,
pcli->pfnGetStatusModeDescription(m_iStatus, 0), m_iStatus);
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, (LPARAM)m_iStatus);
@@ -85,26 +85,26 @@ int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam ) DBVARIANT dbv;
HANDLE hContact = (HANDLE) wParam;
- DebugLog("[YahooContactDeleted]");
+ debugLogA("[YahooContactDeleted]");
if ( !m_bLoggedIn ) {//should never happen for Yahoo contacts
- DebugLog("[YahooContactDeleted] We are not Logged On!!!");
+ debugLogA("[YahooContactDeleted] We are not Logged On!!!");
return 0;
}
// he is not a permanent contact!
if (db_get_b(hContact, "CList", "NotOnList", 0) != 0) {
- DebugLog("[YahooContactDeleted] Not a permanent buddy!!!");
+ debugLogA("[YahooContactDeleted] Not a permanent buddy!!!");
return 0;
}
if (!getString(hContact, YAHOO_LOGINID, &dbv)) {
- DebugLog("[YahooContactDeleted] Removing %s", dbv.pszVal);
+ debugLogA("[YahooContactDeleted] Removing %s", dbv.pszVal);
remove_buddy(dbv.pszVal, getWord(hContact, "yprotoid", 0));
db_free(&dbv);
} else {
- DebugLog("[YahooContactDeleted] Can't retrieve contact Yahoo ID");
+ debugLogA("[YahooContactDeleted] Can't retrieve contact Yahoo ID");
}
return 0;
}
@@ -219,7 +219,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) {
char tUrl[ 4096 ];
- DebugLog("[YahooOpenURL] url: %s Auto Login: %d", url, autoLogin);
+ debugLogA("[YahooOpenURL] url: %s Auto Login: %d", url, autoLogin);
if (autoLogin && getByte("MailAutoLogin", 0) && m_bLoggedIn && m_id > 0) {
char *y, *t, *u;
@@ -238,7 +238,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) mir_snprintf(tUrl, sizeof(tUrl), url);
}
- DebugLog("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
+ debugLogA("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)tUrl);
}
@@ -337,7 +337,7 @@ int __cdecl CYahooProto::OnIdleEvent(WPARAM wParam, LPARAM lParam) {
BOOL bIdle = (lParam & IDF_ISIDLE);
- DebugLog("[YAHOO_IDLE_EVENT] Idle: %s", bIdle ?"Yes":"No");
+ debugLogA("[YAHOO_IDLE_EVENT] Idle: %s", bIdle ?"Yes":"No");
if ( lParam & IDF_PRIVACY )
return 0; /* we support Privacy settings */
@@ -345,11 +345,11 @@ int __cdecl CYahooProto::OnIdleEvent(WPARAM wParam, LPARAM lParam) if (m_bLoggedIn) {
/* set me to idle or back */
if (m_iStatus == ID_STATUS_INVISIBLE)
- DebugLog("[YAHOO_IDLE_EVENT] WARNING: INVISIBLE! Don't change my status!");
+ debugLogA("[YAHOO_IDLE_EVENT] WARNING: INVISIBLE! Don't change my status!");
else
set_status(m_iStatus,m_startMsg,(bIdle) ? 2 : (m_iStatus == ID_STATUS_ONLINE) ? 0 : 1);
} else {
- DebugLog("[YAHOO_IDLE_EVENT] WARNING: NOT LOGGED IN???");
+ debugLogA("[YAHOO_IDLE_EVENT] WARNING: NOT LOGGED IN???");
}
return 0;
@@ -499,7 +499,7 @@ int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) {
const HANDLE hContact = (HANDLE)wParam;
if (!IsMyContact(hContact)) {
- DebugLog("[OnPrebuildContactMenu] Not a Yahoo Contact!!!");
+ debugLogA("[OnPrebuildContactMenu] Not a Yahoo Contact!!!");
return 0;
}
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index 668a6cfe06..044c31ba84 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -22,24 +22,9 @@ #include "resource.h"
-int CYahooProto::DebugLog( const char *fmt, ... )
-{
- char str[ 4096 ];
- va_list vararg;
- va_start( vararg, fmt );
-
- int tBytes = mir_vsnprintf(str, sizeof(str), fmt, vararg);
- if ( tBytes > 0)
- str[ tBytes ] = 0;
-
- va_end( vararg );
-
- return CallService(MS_NETLIB_LOG, (WPARAM)m_hNetlibUser, (LPARAM)str);
-}
-
extern HANDLE g_hNetlibUser;
-int DebugLog( const char *fmt, ... )
+int debugLogA( const char *fmt, ... )
{
char str[ 4096 ];
va_list vararg;
@@ -89,7 +74,7 @@ static LRESULT CALLBACK PopupWindowProc( HWND hWnd, UINT message, WPARAM wParam, {
switch(message) {
case WM_COMMAND:
- DebugLog("[PopupWindowProc] WM_COMMAND");
+ debugLogA("[PopupWindowProc] WM_COMMAND");
if ( HIWORD(wParam) == STN_CLICKED) {
char *szURL = (char*)PUGetPluginData(hWnd);
if (szURL != NULL)
@@ -101,12 +86,12 @@ static LRESULT CALLBACK PopupWindowProc( HWND hWnd, UINT message, WPARAM wParam, break;
case WM_CONTEXTMENU:
- DebugLog("[PopupWindowProc] WM_CONTEXTMENU");
+ debugLogA("[PopupWindowProc] WM_CONTEXTMENU");
PUDeletePopup(hWnd);
return TRUE;
case UM_FREEPLUGINDATA:
- DebugLog("[PopupWindowProc] UM_FREEPLUGINDATA");
+ debugLogA("[PopupWindowProc] UM_FREEPLUGINDATA");
{
char *szURL = (char *)PUGetPluginData(hWnd);
if (szURL != NULL)
@@ -135,7 +120,7 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char * }
else ppd.lchIcon = LoadIconEx("yahoo");
- DebugLog("[MS_POPUP_ADDPOPUP] Generating a popup for [%S] %S", nickname, msg);
+ debugLogA("[MS_POPUP_ADDPOPUP] Generating a popup for [%S] %S", nickname, msg);
PUAddPopupT(&ppd);
return 1;
@@ -174,7 +159,7 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*) lParam;
if ( !strcmp(cws->szSetting, "ApparentMode")) {
- DebugLog("DB Setting changed. YAHOO user's visible setting changed.");
+ debugLogA("DB Setting changed. YAHOO user's visible setting changed.");
DBVARIANT dbv;
if (!getString((HANDLE)wParam, YAHOO_LOGINID, &dbv)) {
@@ -205,7 +190,7 @@ void CYahooProto::YAHOO_utils_logversion() char str[256];
mir_snprintf(str, sizeof(str), "Yahoo v%d.%d.%d.%d", (pluginInfo.version >> 24) & 0xFF, (pluginInfo.version >> 16) & 0xFF,
(pluginInfo.version >> 8) & 0xFF, pluginInfo.version & 0xFF);
- DebugLog(str);
+ debugLogA(str);
}
void SetButtonCheck(HWND hwndDlg, int CtrlID, BOOL bCheck)
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index d7e797fa79..60f5815421 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -272,7 +272,7 @@ void CYahooProto::AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg) SetStringUtf(hContact, "YGroup", group);
- DebugLog("Adding Permanently %s to list. Auth: %s", who, u_msg ? u_msg : "<None>");
+ debugLogA("Adding Permanently %s to list. Auth: %s", who, u_msg ? u_msg : "<None>");
yahoo_add_buddy(m_id, ident, fname, lname, who, protocol, group, u_msg);
free(fname);
@@ -361,7 +361,7 @@ const char* CYahooProto::find_buddy( const char *yahoo_id) /* Other handlers */
void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, const char *msg, int away, int idle, int mobile, int utf8)
{
- YAHOO_DEBUGLOG("[ext_status_changed] %s (prot: %d) with msg %s utf8: %d, stat: %s (%d), away: %d, idle: %d seconds",
+ debugLogA("[ext_status_changed] %s (prot: %d) with msg %s utf8: %d, stat: %s (%d), away: %d, idle: %d seconds",
who,
protocol,
msg,
@@ -373,7 +373,7 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co HANDLE hContact = getbuddyH(who);
if (hContact == NULL) {
- YAHOO_DEBUGLOG("Buddy Not Found. Adding...");
+ debugLogA("Buddy Not Found. Adding...");
hContact = add_buddy(who, who, protocol, 0);
}
@@ -387,7 +387,7 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co setWord(hContact, "Mobile", mobile);
if (msg) {
- YAHOO_DEBUGLOG("[ext_status_changed] %s custom message '%s'", who, msg);
+ debugLogA("[ext_status_changed] %s custom message '%s'", who, msg);
if (utf8)
db_set_utf( hContact, "CList", "StatusMsg", msg);
@@ -407,7 +407,7 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co if ( (away == 2) || (stat == YAHOO_STATUS_IDLE) || (idle > 0)) {
/* TODO: set Idle=-1, because of key 138=1 and don't set idlets then */
if (stat > 0) {
- YAHOO_DEBUGLOG("[ext_status_changed] %s idle for %d:%02d:%02d", who, idle/3600, (idle/60)%60, idle%60);
+ debugLogA("[ext_status_changed] %s idle for %d:%02d:%02d", who, idle/3600, (idle/60)%60, idle%60);
time(&idlets);
idlets -= idle;
@@ -417,18 +417,18 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co setDword(hContact, "IdleTS", idlets);
}
- YAHOO_DEBUGLOG("[ext_status_changed] exiting");
+ debugLogA("[ext_status_changed] exiting");
}
void CYahooProto::ext_status_logon(const char *who, int protocol, int stat, const char *msg, int away, int idle, int mobile, int cksum, int buddy_icon, long client_version, int utf8)
{
- YAHOO_DEBUGLOG("[ext_status_logon] %s (prot: %d) with msg %s utf8: %d, (stat: %d, away: %d, idle: %d seconds, checksum: %d buddy_icon: %d client_version: %ld)", who, protocol, msg, utf8, stat, away, idle, cksum, buddy_icon, client_version);
+ debugLogA("[ext_status_logon] %s (prot: %d) with msg %s utf8: %d, (stat: %d, away: %d, idle: %d seconds, checksum: %d buddy_icon: %d client_version: %ld)", who, protocol, msg, utf8, stat, away, idle, cksum, buddy_icon, client_version);
ext_status_changed(who, protocol, stat, msg, away, idle, mobile, utf8);
HANDLE hContact = getbuddyH(who);
if (hContact == NULL) {
- YAHOO_DEBUGLOG("[ext_status_logon] Can't find handle for %s??? PANIC!!!", who);
+ debugLogA("[ext_status_logon] Can't find handle for %s??? PANIC!!!", who);
return;
}
@@ -528,7 +528,7 @@ void CYahooProto::ext_status_logon(const char *who, int protocol, int stat, cons /* Last thing check the checksum and request new one if we need to */
if (buddy_icon == -1) {
- YAHOO_DEBUGLOG("[ext_status_logon] No avatar information in this packet? Not touching stuff!");
+ debugLogA("[ext_status_logon] No avatar information in this packet? Not touching stuff!");
} else {
// we got some avatartype info
setByte(hContact, "AvatarType", buddy_icon);
@@ -551,7 +551,7 @@ void CYahooProto::ext_status_logon(const char *who, int protocol, int stat, cons reset_avatar(hContact);
}
- YAHOO_DEBUGLOG("[ext_status_logon] exiting");
+ debugLogA("[ext_status_logon] exiting");
}
void CYahooProto::ext_got_audible(const char *me, const char *who, const char *aud, const char *msg, const char *aud_hash)
@@ -610,7 +610,7 @@ void CYahooProto::ext_got_stealth(char *stealthlist) for(s = stealth; s && *s; s++) {
if (lstrcmpiA(*s, dbv.pszVal) == 0) {
- YAHOO_DEBUGLOG("GOT id = %s", dbv.pszVal);
+ debugLogA("GOT id = %s", dbv.pszVal);
found = 1;
break;
}
@@ -618,7 +618,7 @@ void CYahooProto::ext_got_stealth(char *stealthlist) /* Check the stealth list */
if (found) { /* we have him on our Stealth List */
- YAHOO_DEBUGLOG("Setting STEALTH for id = %s", dbv.pszVal);
+ debugLogA("Setting STEALTH for id = %s", dbv.pszVal);
/* need to set the ApparentMode thingy */
if (ID_STATUS_OFFLINE != getWord(hContact, "ApparentMode", 0))
getWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
@@ -643,7 +643,7 @@ void CYahooProto::ext_got_buddies(YList * buds) return;
}
- YAHOO_DEBUGLOG(("[ext_got_buddies] Walking buddy list..."));
+ debugLogA(("[ext_got_buddies] Walking buddy list..."));
for (; buds; buds = buds->next) {
HANDLE hContact;
@@ -653,7 +653,7 @@ void CYahooProto::ext_got_buddies(YList * buds) continue;
}
- YAHOO_DEBUGLOG("[ext_got_buddies] id = %s, protocol = %d, group = %s, auth = %d", bud->id, bud->protocol, bud->group, bud->auth);
+ debugLogA("[ext_got_buddies] id = %s, protocol = %d, group = %s, auth = %d", bud->id, bud->protocol, bud->group, bud->auth);
hContact = getbuddyH(bud->id);
if (hContact == NULL)
@@ -666,7 +666,7 @@ void CYahooProto::ext_got_buddies(YList * buds) SetStringUtf(hContact, "YGroup", bud->group);
if (bud->stealth) { /* we have him on our Stealth List */
- YAHOO_DEBUGLOG("Setting STEALTH for id = %s", bud->id);
+ debugLogA("Setting STEALTH for id = %s", bud->id);
/* need to set the ApparentMode thingy */
if (ID_STATUS_OFFLINE != getWord(hContact, "ApparentMode", 0))
setWord(hContact, "ApparentMode", (WORD) ID_STATUS_OFFLINE);
@@ -679,11 +679,11 @@ void CYahooProto::ext_got_buddies(YList * buds) }
//if (bud->auth)
- // YAHOO_DEBUGLOG("Auth request waiting for: %s", bud->id );
+ // debugLogA("Auth request waiting for: %s", bud->id );
setByte(hContact, "YAuth", bud->auth);
if (bud->real_name) {
- YAHOO_DEBUGLOG("id = %s name = %s", bud->id, bud->real_name);
+ debugLogA("id = %s name = %s", bud->id, bud->real_name);
SetStringUtf( hContact, "Nick", bud->real_name);
}
@@ -712,7 +712,7 @@ void CYahooProto::ext_got_buddies(YList * buds) }
}
- YAHOO_DEBUGLOG(("[ext_got_buddies] buddy list Finished."));
+ debugLogA(("[ext_got_buddies] buddy list Finished."));
}
void CYahooProto::ext_rejected(const char *who, const char *msg)
@@ -1151,7 +1151,7 @@ void CYahooProto::ext_login_response(int succ, const char *url) delSetting(YAHOO_PWTOKEN);
- YAHOO_DEBUGLOG("ERROR: %s", buff);
+ debugLogA("ERROR: %s", buff);
/*
* Show Error Message
@@ -1195,11 +1195,11 @@ void CYahooProto::ext_error(const char *err, int fatal, int num) break;
case E_CONNECTION:
mir_sntprintf(buff, SIZEOF(buff), TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
- YAHOO_DEBUGLOG("Error: %S", buff);
+ debugLogA("Error: %S", buff);
return;
}
- YAHOO_DEBUGLOG("Error: %S", buff);
+ debugLogA("Error: %S", buff);
/*
* Show Error Message
@@ -1837,7 +1837,7 @@ void register_callbacks() yc.ext_yahoo_got_search_result = ext_yahoo_got_search_result;
yc.ext_yahoo_system_message = ext_yahoo_system_message;
yc.ext_yahoo_error = ext_yahoo_error;
- yc.ext_yahoo_log = YAHOO_DEBUGLOG;
+ yc.ext_yahoo_log = debugLogA;
yc.ext_yahoo_add_handler = ext_yahoo_add_handler;
yc.ext_yahoo_remove_handler = ext_yahoo_remove_handler;
//yc.ext_yahoo_connect = ext_yahoo_connect; not needed in fact
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h index de2e1fbfbf..c99d1e13be 100644 --- a/protocols/Yahoo/src/yahoo.h +++ b/protocols/Yahoo/src/yahoo.h @@ -68,13 +68,11 @@ extern "C" #define YAHOO_DEFAULT_JAPAN_LOGIN_SERVER "cs.yahoo.co.jp"
#define YAHOO_CUSTOM_STATUS 99
-#define YAHOO_DEBUGLOG DebugLog
-
extern int do_yahoo_debug;
-#define LOG(x) if (do_yahoo_debug) { YAHOO_DEBUGLOG("%s:%d: ", __FILE__, __LINE__); \
- YAHOO_DEBUGLOG x; \
- YAHOO_DEBUGLOG(" ");}
+#define LOG(x) if (do_yahoo_debug) { debugLogA("%s:%d: ", __FILE__, __LINE__); \
+ debugLogA x; \
+ debugLogA(" ");}
#define YAHOO_SET_CUST_STAT "/SetCustomStatCommand"
#define YAHOO_EDIT_MY_PROFILE "/YahooEditMyProfileCommand"
@@ -120,9 +118,9 @@ yahoo_status miranda_to_yahoo(int myyahooStatus); void register_callbacks();
#ifdef __GNUC__
- int DebugLog( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
+ int debugLogA( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
#else
- int DebugLog( const char *fmt, ... );
+ int debugLogA( const char *fmt, ... );
#endif
void SetButtonCheck(HWND hwndDlg, int CtrlID, BOOL bCheck);
|