From ddba4ede6b451d0cfcd0d32b5180fbd0689966bf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 08:04:30 +0000 Subject: - HANDLE hContact => HCONTACT - GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/avatar.cpp | 17 ++-- protocols/Yahoo/src/chat.cpp | 34 +++---- protocols/Yahoo/src/file_transfer.cpp | 33 +++---- protocols/Yahoo/src/file_transfer.h | 2 +- protocols/Yahoo/src/im.cpp | 51 +++++----- protocols/Yahoo/src/links.cpp | 2 +- protocols/Yahoo/src/main.cpp | 2 +- protocols/Yahoo/src/proto.cpp | 181 ++++++++++++++++++---------------- protocols/Yahoo/src/proto.h | 110 ++++++++++----------- protocols/Yahoo/src/services.cpp | 24 ++--- protocols/Yahoo/src/user_info.cpp | 4 +- protocols/Yahoo/src/util.cpp | 12 +-- protocols/Yahoo/src/yahoo.cpp | 34 +++---- 13 files changed, 254 insertions(+), 252 deletions(-) (limited to 'protocols/Yahoo') diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 47318c1b3e..4eb38181ac 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -155,7 +155,6 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) PROTO_AVATAR_INFORMATIONT AI; struct avatar_info *avt = ( avatar_info* )pavt; int error = 0; - HANDLE hContact = 0; TCHAR buf[4096]; if (avt == NULL) { @@ -172,7 +171,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) LOG(("yahoo_recv_avatarthread who:%s url:%s checksum: %d", avt->who, avt->pic_url, avt->cksum)); - hContact = getbuddyH(avt->who); + HCONTACT hContact = getbuddyH(avt->who); if (!hContact) { LOG(("ERROR: Can't find buddy: %s", avt->who)); @@ -259,7 +258,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) void CYahooProto::ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type) { - HANDLE hContact = 0; + HCONTACT hContact = 0; LOG(("[ext_yahoo_got_picture] for %s with url %s (checksum: %d) type: %d", who, pic_url, cksum, type)); @@ -451,7 +450,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p void CYahooProto::ext_got_picture_checksum(const char *me, const char *who, int cksum) { - HANDLE hContact = 0; + HCONTACT hContact = 0; LOG(("ext_yahoo_got_picture_checksum for %s checksum: %d", who, cksum)); @@ -489,7 +488,7 @@ void CYahooProto::ext_got_picture_checksum(const char *me, const char *who, int void CYahooProto::ext_got_picture_update(const char *me, const char *who, int buddy_icon) { - HANDLE hContact = 0; + HCONTACT hContact = 0; LOG(("ext_got_picture_update for %s buddy_icon: %d", who, buddy_icon)); @@ -507,7 +506,7 @@ void CYahooProto::ext_got_picture_update(const char *me, const char *who, int bu void CYahooProto::ext_got_picture_status(const char *me, const char *who, int buddy_icon) { - HANDLE hContact = 0; + HCONTACT hContact = 0; LOG(("ext_yahoo_got_picture_status for %s buddy_icon: %d", who, buddy_icon)); @@ -573,7 +572,7 @@ void CYahooProto::ext_got_avatar_share(int buddy_icon) setByte("ShareAvatar", buddy_icon ); } -void CYahooProto::reset_avatar(HANDLE hContact) +void CYahooProto::reset_avatar(HCONTACT hContact) { LOG(("[YAHOO_RESET_AVATAR]")); @@ -587,7 +586,7 @@ void CYahooProto::request_avatar(const char* who) return; } - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (!hContact) return; @@ -607,7 +606,7 @@ void CYahooProto::request_avatar(const char* who) else LOG(("Avatar Not Available for: %s Last Check: %ld Current: %ld (Flood Check in Effect)", who, last_chk, cur_time)); } -void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int type) +void CYahooProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName); diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp index 0b22d5e23f..75dbf851ea 100644 --- a/protocols/Yahoo/src/chat.cpp +++ b/protocols/Yahoo/src/chat.cpp @@ -244,7 +244,7 @@ void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TC TCHAR* idt = mir_a2t(room); TCHAR* snt = mir_a2t(who); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; GCDEST gcd = { m_szModuleName, idt, evt }; @@ -395,18 +395,19 @@ int __cdecl CYahooProto::OnGCMenuHook(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // Invite to chat dialog -static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg) +static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg) { bool root = !hItem; if (root) - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hItemT) clist_chat_invite_send(hItemT, hwndList, who, room, ppro, msg); + HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + if (hItemT) + clist_chat_invite_send(hItemT, hwndList, who, room, ppro, msg); } else { @@ -428,7 +429,7 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, cha } } } - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } if (root && who) @@ -450,26 +451,25 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, cha } } -static void ClistValidateContact(HANDLE hItem, HWND hwndList, CYahooProto* ppro) +static void ClistValidateContact(HCONTACT hItem, HWND hwndList, CYahooProto* ppro) { if (!ppro->IsMyContact(hItem) || ppro->isChatRoom(hItem) || ppro->getWord(hItem, "Status", ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE) SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); } -static void ClistChatPrepare(HANDLE hItem, HWND hwndList, CYahooProto* ppro) +static void ClistChatPrepare(HCONTACT hItem, HWND hwndList, CYahooProto* ppro) { if (hItem == NULL) - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); - while (hItem) - { - HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + while (hItem) { + HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); - if (IsHContactGroup(hItem)) - { - HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hItemT) ClistChatPrepare(hItemT, hwndList, ppro); + if (IsHContactGroup(hItem)) { + HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + if (hItemT) + ClistChatPrepare(hItemT, hwndList, ppro); } else if (IsHContactContact(hItem)) ClistValidateContact(hItem, hwndList, ppro); @@ -516,7 +516,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { case CLN_NEWCONTACT: if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - ClistValidateContact(nmc->hItem, nmc->hdr.hwndFrom, param->ppro); + ClistValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); break; case CLN_LISTREBUILT: diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index a3ac8bc57b..e83f9d3836 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -19,7 +19,7 @@ YList *file_transfers=NULL; -static y_filetransfer* new_ft(CYahooProto* ppro, int id, HANDLE hContact, const char *who, const char *msg, +static y_filetransfer* new_ft(CYahooProto* ppro, int id, HCONTACT hContact, const char *who, const char *msg, const char *url, const char *ft_token, int y7, YList *fs, int sending) { yahoo_file_info * fi; @@ -478,7 +478,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, { LOG(("[ext_yahoo_got_file] ident:%s, who: %s, url: %s, expires: %lu, msg: %s, fname: %s, fsize: %lu ftoken: %s y7: %d", me, who, url, expires, msg, fname, fesize, ft_token == NULL ? "NULL" : ft_token, y7)); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact == NULL) hContact = add_buddy(who, who, 0 /* NO FT for other IMs */, PALF_TEMPORARY); @@ -533,7 +533,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_token, int y7, YList* files) { - HANDLE hContact; + HCONTACT hContact; y_filetransfer *ft; YList *f; char fn[4096]; @@ -699,7 +699,7 @@ void __cdecl CYahooProto::send_filethread(void *psf) //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) +HANDLE __cdecl CYahooProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) { DBVARIANT dbv; y_filetransfer *sf; @@ -763,7 +763,7 @@ HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescri //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, const PROTOCHAR* szPath ) +HANDLE __cdecl CYahooProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { y_filetransfer *ft = (y_filetransfer *)hTransfer; size_t len; @@ -792,7 +792,7 @@ HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, co //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CYahooProto::FileCancel( HANDLE /*hContact*/, HANDLE hTransfer ) +int __cdecl CYahooProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) { debugLogA("[YahooFileCancel]"); @@ -815,14 +815,14 @@ int __cdecl CYahooProto::FileCancel( HANDLE /*hContact*/, HANDLE hTransfer ) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const PROTOCHAR* ) +int __cdecl CYahooProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR*) { /* deny file receive request.. just ignore it! */ y_filetransfer *ft = (y_filetransfer *)hTransfer; debugLogA("[YahooFileDeny]"); - if ( !m_bLoggedIn || ft == NULL) { + if (!m_bLoggedIn || ft == NULL) { debugLogA("[YahooFileDeny] Not logged-in or some other error!"); return 1; } @@ -838,7 +838,7 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const struct yahoo_file_info *fi = (struct yahoo_file_info *)ft->files->data; debugLogA("[YahooFileDeny] DC Detected: Denying File Transfer!"); - yahoo_ftdc_deny(m_id, ft->who, fi->filename, ft->ftoken, 2); + yahoo_ftdc_deny(m_id, ft->who, fi->filename, ft->ftoken, 2); } return 0; } @@ -846,13 +846,13 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const //////////////////////////////////////////////////////////////////////////////////////// // FileResume - processes file renaming etc -int __cdecl CYahooProto::FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ) +int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename) { y_filetransfer *ft = (y_filetransfer *)hTransfer; debugLogA("[YahooFileResume] Action: %d", *action); - if ( !m_bLoggedIn || ft == NULL) { + if (!m_bLoggedIn || ft == NULL) { debugLogA("[YahooFileResume] Not loggedin or some other error!"); return 1; } @@ -861,14 +861,13 @@ int __cdecl CYahooProto::FileResume( HANDLE hTransfer, int* action, const PROTOC debugLogA("[YahooFileResume] Action: %d", *action); - if ( *action == FILERESUME_RENAME ) { + if (*action == FILERESUME_RENAME) { debugLogA("[YahooFileResume] Renamed file!"); - + FREE(ft->pfts.tszCurrentFile); - ft->pfts.tszCurrentFile = _tcsdup( *szFilename ); - } + ft->pfts.tszCurrentFile = _tcsdup(*szFilename); + } - SetEvent( ft->hWaitEvent ); + SetEvent(ft->hWaitEvent); return 0; } - diff --git a/protocols/Yahoo/src/file_transfer.h b/protocols/Yahoo/src/file_transfer.h index f33d7cd046..cdbacd9c32 100644 --- a/protocols/Yahoo/src/file_transfer.h +++ b/protocols/Yahoo/src/file_transfer.h @@ -22,7 +22,7 @@ typedef struct { char *msg; char *ftoken; char *relay; - HANDLE hContact; + HCONTACT hContact; int cancel; char *url; HANDLE hWaitEvent; diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 63ef43875b..224c65677b 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -100,7 +100,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons /* Need to strip off formatting stuff first. Then do all decoding/converting */ LOG(("%s: %s", who, umsg)); - HANDLE hContact = add_buddy(who, who, protocol, PALF_TEMPORARY); + HCONTACT hContact = add_buddy(who, who, protocol, PALF_TEMPORARY); //setWord(hContact, "yprotoid", protocol); Set_Protocol(hContact, protocol); @@ -152,50 +152,50 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons //////////////////////////////////////////////////////////////////////////////////////// // SendMessage - sends a message -void __cdecl CYahooProto::im_sendacksuccess(HANDLE hContact) +void __cdecl CYahooProto::im_sendacksuccess(void *hContact) { - ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0); + ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -void __cdecl CYahooProto::im_sendackfail(HANDLE hContact) +void __cdecl CYahooProto::im_sendackfail(void *hContact) { SleepEx(1000, TRUE); - ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, - (LPARAM) Translate("The message send timed out.")); + ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, + (LPARAM)Translate("The message send timed out.")); } -void __cdecl CYahooProto::im_sendackfail_longmsg(HANDLE hContact) +void __cdecl CYahooProto::im_sendackfail_longmsg(void *hContact) { SleepEx(1000, TRUE); - ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, - (LPARAM)Translate("Message is too long: Yahoo messages are limited by 800 UTF8 chars")); + ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, + (LPARAM)Translate("Message is too long: Yahoo messages are limited by 800 UTF8 chars")); } -int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc ) +int __cdecl CYahooProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) { if (!m_bLoggedIn) {/* don't send message if we not connected! */ - ForkThread( &CYahooProto::im_sendackfail, hContact ); + ForkThread(&CYahooProto::im_sendackfail, hContact); return 1; } ptrA msg; if (flags & PREF_UNICODE) /* convert to utf8 */ - msg = mir_utf8encodeW(( wchar_t* )&pszSrc[ strlen(pszSrc)+1 ] ); - else if ( flags & PREF_UTF ) + msg = mir_utf8encodeW((wchar_t*)&pszSrc[strlen(pszSrc) + 1]); + else if (flags & PREF_UTF) msg = mir_strdup(pszSrc); else msg = mir_utf8encode(pszSrc); if (lstrlenA(msg) > 800) { - ForkThread( &CYahooProto::im_sendackfail_longmsg, hContact ); + ForkThread(&CYahooProto::im_sendackfail_longmsg, hContact); return 1; } DBVARIANT dbv; - if (!getString( hContact, YAHOO_LOGINID, &dbv)) { - send_msg(dbv.pszVal, getWord( hContact, "yprotoid", 0), msg, 1); + if (!getString(hContact, YAHOO_LOGINID, &dbv)) { + send_msg(dbv.pszVal, getWord(hContact, "yprotoid", 0), msg, 1); - ForkThread( &CYahooProto::im_sendacksuccess, hContact ); + ForkThread(&CYahooProto::im_sendacksuccess, hContact); db_free(&dbv); return 1; @@ -207,32 +207,32 @@ int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CYahooProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre ) +int __cdecl CYahooProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) { db_unset(hContact, "CList", "Hidden"); // NUDGES - if ( !lstrcmpA(pre->szMessage, "") && ServiceExists("NUDGE/Send")) { + if (!lstrcmpA(pre->szMessage, "") && ServiceExists("NUDGE/Send")) { debugLogA("[YahooRecvMessage] Doing Nudge Service!"); NotifyEventHooks(hYahooNudge, (WPARAM)hContact, pre->timestamp); return 0; - } + } return Proto_RecvMessage(hContact, pre); } //======================================================= -//Send a nudge +// Send a nudge //======================================================= INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE) wParam; + HCONTACT hContact = (HCONTACT)wParam; debugLogA("[YAHOO_SENDNUDGE]"); if (!m_bLoggedIn) {/* don't send nudge if we not connected! */ - ForkThread( &CYahooProto::im_sendackfail, hContact ); + ForkThread(&CYahooProto::im_sendackfail, hContact); return 1; } @@ -241,12 +241,9 @@ INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam) send_msg(dbv.pszVal, getWord(hContact, "yprotoid", 0), "", 0); db_free(&dbv); - ForkThread( &CYahooProto::im_sendacksuccess, hContact ); + ForkThread(&CYahooProto::im_sendacksuccess, hContact); return 1; } return 0; } - - - diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp index 8af33e94b3..d1136a507a 100644 --- a/protocols/Yahoo/src/links.cpp +++ b/protocols/Yahoo/src/links.cpp @@ -148,7 +148,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam) if (arg) *arg = 0; } - HANDLE hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */ + HCONTACT hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */ if (hContact) CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, (LPARAM)msg); diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp index 68e9a1167a..8078e72d67 100644 --- a/protocols/Yahoo/src/main.cpp +++ b/protocols/Yahoo/src/main.cpp @@ -79,7 +79,7 @@ LIST g_instances( 1, CompareProtos ); static CYahooProto* yahooProtoInit( const char* pszProtoName, const TCHAR* tszUserName ) { - CYahooProto* ppro = new CYahooProto( pszProtoName, tszUserName ); + CYahooProto* ppro = new CYahooProto(pszProtoName, tszUserName); g_instances.insert( ppro ); diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 183176cb8a..afd2138d9c 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -61,7 +61,7 @@ CYahooProto::~CYahooProto() //////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoadedEx - performs hook registration -int CYahooProto::OnModulesLoadedEx( WPARAM, LPARAM ) +int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) { HookProtoEvent( ME_USERINFO_INITIALISE, &CYahooProto::OnUserInfoInit ); HookProtoEvent( ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent); @@ -114,7 +114,7 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) } char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id) : mir_utf8encode((char*)psr->id); - HANDLE hContact = getbuddyH(id); + HCONTACT hContact = getbuddyH(id); if (hContact != NULL) { if (db_get_b(hContact, "CList", "NotOnList", 0)) { debugLogA("[YahooAddToList] Temporary Buddy:%s already on our buddy list", id); @@ -164,7 +164,7 @@ HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDL return 0; } - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) debugLogA("Temp Buddy found at: %p ", hContact); else @@ -199,7 +199,7 @@ int CYahooProto::Authorize( HANDLE hdbe ) return 1; /* Need to remove the buddy from our Miranda Lists */ - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { ptrA who( getStringA(hContact, YAHOO_LOGINID)); if (who) { @@ -244,7 +244,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) } /* Need to remove the buddy from our Miranda Lists */ - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { ptrA who( getStringA(hContact, YAHOO_LOGINID)); if (who) { @@ -262,7 +262,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre) +int __cdecl CYahooProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) { debugLogA("[YahooRecvAuth] "); db_unset(hContact,"CList","Hidden"); @@ -274,7 +274,7 @@ int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CYahooProto::AuthRequest( HANDLE hContact, const TCHAR* msg ) +int __cdecl CYahooProto::AuthRequest(HCONTACT hContact, const TCHAR* msg ) { debugLogA("[YahooSendAuthRequest]"); @@ -297,7 +297,7 @@ HANDLE __cdecl CYahooProto::ChangeInfo( int /*iInfoType*/, void* ) //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CYahooProto::GetCaps( int type, HANDLE /*hContact*/ ) +DWORD_PTR __cdecl CYahooProto::GetCaps(int type, HCONTACT hContact) { switch ( type ) { case PFLAGNUM_1: @@ -329,13 +329,13 @@ DWORD_PTR __cdecl CYahooProto::GetCaps( int type, HANDLE /*hContact*/ ) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -void __cdecl CYahooProto::get_info_thread(HANDLE hContact) +void __cdecl CYahooProto::get_info_thread(void *hContact) { SleepEx(500, TRUE); - ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0); + ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -int __cdecl CYahooProto::GetInfo( HANDLE hContact, int /*infoType*/ ) +int __cdecl CYahooProto::GetInfo(HCONTACT hContact, int /*infoType*/ ) { ForkThread(&CYahooProto::get_info_thread, hContact); return 0; @@ -360,7 +360,7 @@ HANDLE __cdecl CYahooProto::SearchByName( const PROTOCHAR* nick, const PROTOCHAR //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CYahooProto::RecvContacts( HANDLE /*hContact*/, PROTORECVEVENT* ) +int __cdecl CYahooProto::RecvContacts(HCONTACT/*hContact*/, PROTORECVEVENT*) { return 1; } @@ -368,7 +368,7 @@ int __cdecl CYahooProto::RecvContacts( HANDLE /*hContact*/, PROTORECVEVENT* ) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CYahooProto::RecvFile( HANDLE hContact, PROTORECVFILET* evt ) +int __cdecl CYahooProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) { db_unset(hContact, "CList", "Hidden"); @@ -378,7 +378,7 @@ int __cdecl CYahooProto::RecvFile( HANDLE hContact, PROTORECVFILET* evt ) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CYahooProto::RecvUrl( HANDLE /*hContact*/, PROTORECVEVENT* ) +int __cdecl CYahooProto::RecvUrl(HCONTACT/*hContact*/, PROTORECVEVENT*) { return 1; } @@ -386,7 +386,7 @@ int __cdecl CYahooProto::RecvUrl( HANDLE /*hContact*/, PROTORECVEVENT* ) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CYahooProto::SendContacts( HANDLE /*hContact*/, int /*flags*/, int /*nContacts*/, HANDLE* /*hContactsList*/ ) +int __cdecl CYahooProto::SendContacts(HCONTACT/*hContact*/, int /*flags*/, int /*nContacts*/, HCONTACT* /*hContactsList*/) { return 1; } @@ -394,7 +394,7 @@ int __cdecl CYahooProto::SendContacts( HANDLE /*hContact*/, int /*flags*/, int / //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CYahooProto::SendUrl( HANDLE /*hContact*/, int /*flags*/, const char* /*url*/ ) +int __cdecl CYahooProto::SendUrl(HCONTACT/*hContact*/, int /*flags*/, const char* /*url*/) { return 1; } @@ -402,7 +402,7 @@ int __cdecl CYahooProto::SendUrl( HANDLE /*hContact*/, int /*flags*/, const char //////////////////////////////////////////////////////////////////////////////////////// // SetApparentMode - sets the visibility status -int __cdecl CYahooProto::SetApparentMode( HANDLE hContact, int mode ) +int __cdecl CYahooProto::SetApparentMode(HCONTACT hContact, int mode) { if (mode && mode != ID_STATUS_OFFLINE) return 1; @@ -416,7 +416,7 @@ int __cdecl CYahooProto::SetApparentMode( HANDLE hContact, int mode ) //////////////////////////////////////////////////////////////////////////////////////// // SetStatus - sets the protocol status -int __cdecl CYahooProto::SetStatus( int iNewStatus ) +int __cdecl CYahooProto::SetStatus(int iNewStatus) { LOG(("[SetStatus] New status %S", pcli->pfnGetStatusModeDescription(iNewStatus, 0))); @@ -424,7 +424,8 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus ) logout(); - } else if (!m_bLoggedIn) { + } + else if (!m_bLoggedIn) { DBVARIANT dbv; int err = 0; char errmsg[80]; @@ -472,7 +473,7 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus ) if (err != 0) { BroadcastStatus(ID_STATUS_OFFLINE); - ShowError( TranslateT("Yahoo Login Error"), _A2T(errmsg)); + ShowError(TranslateT("Yahoo Login Error"), _A2T(errmsg)); return 0; } @@ -495,12 +496,12 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus ) BroadcastStatus(ID_STATUS_CONNECTING); - iNewStatus = (iNewStatus == ID_STATUS_INVISIBLE) ? YAHOO_STATUS_INVISIBLE: YAHOO_STATUS_AVAILABLE; + iNewStatus = (iNewStatus == ID_STATUS_INVISIBLE) ? YAHOO_STATUS_INVISIBLE : YAHOO_STATUS_AVAILABLE; ForkThread(&CYahooProto::server_main, (void *)iNewStatus); } else if (iNewStatus == ID_STATUS_INVISIBLE) { /* other normal away statuses are set via setaway */ BroadcastStatus(iNewStatus); - set_status(m_iStatus,NULL,(m_iStatus != ID_STATUS_ONLINE) ? 1 : 0); + set_status(m_iStatus, NULL, (m_iStatus != ID_STATUS_ONLINE) ? 1 : 0); } else { /* clear out our message just in case, STUPID AA! */ @@ -516,13 +517,14 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus ) //////////////////////////////////////////////////////////////////////////////////////// // GetAwayMsg - returns a contact's away message -void __cdecl CYahooProto::get_status_thread(HANDLE hContact) +void __cdecl CYahooProto::get_status_thread(void *param) { int l; DBVARIANT dbv; char *gm = NULL, *sm = NULL, *fm; + HCONTACT hContact = (HCONTACT)param; - Sleep( 150 ); + Sleep(150); /* Check Yahoo Games Message */ if (!getString(hContact, "YGMsg", &dbv)) { @@ -530,7 +532,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact) db_free(&dbv); } - if (! db_get_s(hContact, "CList", "StatusMsg", &dbv)) { + if (!db_get_s(hContact, "CList", "StatusMsg", &dbv)) { if (lstrlenA(dbv.pszVal) >= 1) sm = strdup(dbv.pszVal); @@ -538,7 +540,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact) } else { int status = getWord(hContact, "YStatus", (WORD)YAHOO_STATUS_OFFLINE); - sm = yahoo_status_code( yahoo_status(status)); + sm = yahoo_status_code(yahoo_status(status)); if (sm) sm = strdup(sm); /* we need this to go global FREE later */ } @@ -547,18 +549,19 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact) l += lstrlenA(gm) + 3; l += lstrlenA(sm) + 1; - fm = (char *) malloc(l); + fm = (char *)malloc(l); - fm[0] ='\0'; + fm[0] = '\0'; if (gm && lstrlenA(gm) > 0) { /* BAH YAHOO SUCKS! WHAT A PAIN! find first carriage return add status message then add the rest */ char *c = strchr(gm, '\r'); if (c != NULL) { - lstrcpynA(fm,gm, c - gm + 1); + lstrcpynA(fm, gm, c - gm + 1); fm[c - gm + 1] = '\0'; - } else + } + else lstrcpyA(fm, gm); if (sm) { @@ -568,16 +571,17 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact) if (c != NULL) lstrcatA(fm, c); - } else if (sm) { + } + else if (sm) { lstrcatA(fm, sm); } FREE(sm); - ProtoBroadcastAck( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, (LPARAM)( TCHAR* )_A2T(fm)); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)(TCHAR*)_A2T(fm)); } -HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact ) +HANDLE __cdecl CYahooProto::GetAwayMsg(HCONTACT hContact) { debugLogA("[YahooGetAwayMessage] "); @@ -595,7 +599,7 @@ HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact ) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CYahooProto::RecvAwayMsg( HANDLE /*hContact*/, int /*statusMode*/, PROTORECVEVENT* ) +int __cdecl CYahooProto::RecvAwayMsg(HCONTACT/*hContact*/, int /*statusMode*/, PROTORECVEVENT*) { return 1; } @@ -603,18 +607,19 @@ int __cdecl CYahooProto::RecvAwayMsg( HANDLE /*hContact*/, int /*statusMode*/, P //////////////////////////////////////////////////////////////////////////////////////// // SetAwayMsg - sets the away status message -int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg ) +int __cdecl CYahooProto::SetAwayMsg(int status, const PROTOCHAR* msg) { char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL; debugLogA("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c); - if (!m_bLoggedIn) { + if (!m_bLoggedIn) { if (m_iStatus == ID_STATUS_OFFLINE) { debugLogA("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!"); mir_free(c); return 1; - } else { + } + else { if (m_startMsg) free(m_startMsg); m_startMsg = c ? strdup(c) : NULL; @@ -634,10 +639,12 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg ) m_startMsg = strdup(c); if (status == ID_STATUS_ONLINE) { set_status(YAHOO_CUSTOM_STATUS, c, 0); - } else if (status != ID_STATUS_INVISIBLE) { + } + else if (status != ID_STATUS_INVISIBLE) { set_status(YAHOO_CUSTOM_STATUS, c, 1); } - } else { + } + else { set_status(status, NULL, 0); m_startMsg = NULL; } @@ -651,32 +658,33 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg ) INT_PTR __cdecl CYahooProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) { - if (!m_bLoggedIn || ! m_startMsg) + if (!m_bLoggedIn || !m_startMsg) return 0; if (lParam & SGMA_UNICODE) { - return (INT_PTR) mir_utf8decodeW(m_startMsg); - } else { - return (INT_PTR) mir_utf8decodeA(m_startMsg); + return (INT_PTR)mir_utf8decodeW(m_startMsg); + } + else { + return (INT_PTR)mir_utf8decodeA(m_startMsg); } } ///////////////////////////////////////////////////////////////////////////////////////// // UserIsTyping - sends a UTN notification -int __cdecl CYahooProto::UserIsTyping( HANDLE hContact, int type ) +int __cdecl CYahooProto::UserIsTyping(HCONTACT hContact, int type) { if (!m_bLoggedIn) return 0; char *szProto = GetContactProto(hContact); - if (szProto==NULL || strcmp(szProto, m_szModuleName)) + if (szProto == NULL || strcmp(szProto, m_szModuleName)) return 0; DBVARIANT dbv; if (!getString(hContact, YAHOO_LOGINID, &dbv)) { if (type == PROTOTYPE_SELFTYPING_OFF || type == PROTOTYPE_SELFTYPING_ON) { - sendtyping(dbv.pszVal, getWord(hContact, "yprotoid", 0), type == PROTOTYPE_SELFTYPING_ON?1:0); + sendtyping(dbv.pszVal, getWord(hContact, "yprotoid", 0), type == PROTOTYPE_SELFTYPING_ON ? 1 : 0); } db_free(&dbv); } @@ -686,31 +694,31 @@ int __cdecl CYahooProto::UserIsTyping( HANDLE hContact, int type ) ///////////////////////////////////////////////////////////////////////////////////////// // OnEvent - maintain protocol events -int __cdecl CYahooProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ) +int __cdecl CYahooProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) { - switch( eventType ) { - case EV_PROTO_ONLOAD: return OnModulesLoadedEx( 0, 0); + switch (eventType) { + case EV_PROTO_ONLOAD: return OnModulesLoadedEx(0, 0); //case EV_PROTO_ONEXIT: return OnPreShutdown( 0, 0); - case EV_PROTO_ONOPTIONS: return OnOptionsInit( wParam, lParam ); - - case EV_PROTO_ONMENU: - MenuMainInit(); - break; - - case EV_PROTO_ONRENAME: - if ( mainMenuRoot ) { - CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; - mi.ptszName = m_tszUserName; - Menu_ModifyItem(mainMenuRoot, &mi); - } - break; + case EV_PROTO_ONOPTIONS: return OnOptionsInit(wParam, lParam); + + case EV_PROTO_ONMENU: + MenuMainInit(); + break; - case EV_PROTO_ONCONTACTDELETED: - return OnContactDeleted(wParam, lParam); + case EV_PROTO_ONRENAME: + if (mainMenuRoot) { + CLISTMENUITEM mi = { sizeof(mi) }; + mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; + mi.ptszName = m_tszUserName; + Menu_ModifyItem(mainMenuRoot, &mi); + } + break; + + case EV_PROTO_ONCONTACTDELETED: + return OnContactDeleted(wParam, lParam); - case EV_PROTO_DBSETTINGSCHANGED: - return OnSettingChanged(wParam, lParam); + case EV_PROTO_DBSETTINGSCHANGED: + return OnSettingChanged(wParam, lParam); } return 1; } @@ -727,12 +735,12 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ppro = (CYahooProto*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); - if ( !ppro->getString(YAHOO_LOGINID, &dbv)) { + if (!ppro->getString(YAHOO_LOGINID, &dbv)) { SetDlgItemTextA(hwndDlg, IDC_HANDLE, dbv.pszVal); db_free(&dbv); } - if ( !ppro->getString(YAHOO_PASSWORD, &dbv)) { + if (!ppro->getString(YAHOO_PASSWORD, &dbv)) { SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal); db_free(&dbv); } @@ -741,19 +749,19 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM return TRUE; case WM_COMMAND: - if ( LOWORD( wParam ) == IDC_NEWYAHOOACCOUNTLINK ) { + if (LOWORD(wParam) == IDC_NEWYAHOOACCOUNTLINK) { CallService(MS_UTILS_OPENURL, - 1, - ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN ) == 1) ? - (LPARAM) "http://edit.yahoo.co.jp/config/eval_register" : - (LPARAM) "http://edit.yahoo.com/config/eval_register" - ); + 1, + ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN) == 1) ? + (LPARAM) "http://edit.yahoo.co.jp/config/eval_register" : + (LPARAM) "http://edit.yahoo.com/config/eval_register" + ); return TRUE; } - if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) + if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) { - switch( LOWORD( wParam )) { + switch (LOWORD(wParam)) { case IDC_HANDLE: case IDC_PASSWORD: case IDC_YAHOO_JAPAN: @@ -763,7 +771,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY ) { + if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) { char str[128]; BOOL reconnectRequired = FALSE; @@ -771,17 +779,17 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dbv.pszVal = NULL; - if (ppro->getString( YAHOO_LOGINID, &dbv) || lstrcmpA(str, dbv.pszVal)) + if (ppro->getString(YAHOO_LOGINID, &dbv) || lstrcmpA(str, dbv.pszVal)) reconnectRequired = TRUE; - if ( dbv.pszVal != NULL) + if (dbv.pszVal != NULL) db_free(&dbv); ppro->setString(YAHOO_LOGINID, str); GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(str)); dbv.pszVal = NULL; - if (ppro->getString( YAHOO_PASSWORD, &dbv) || lstrcmpA(str, dbv.pszVal)) + if (ppro->getString(YAHOO_PASSWORD, &dbv) || lstrcmpA(str, dbv.pszVal)) reconnectRequired = TRUE; if (dbv.pszVal != NULL) db_free(&dbv); @@ -790,10 +798,10 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ppro->delSetting(YAHOO_PWTOKEN); ppro->setString(YAHOO_PASSWORD, str); - ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN )); + ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN)); - if ( reconnectRequired && ppro->m_bLoggedIn ) - MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK ); + if (reconnectRequired && ppro->m_bLoggedIn) + MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK); return TRUE; } @@ -803,9 +811,8 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM return FALSE; } - INT_PTR CYahooProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam) { - return (INT_PTR)CreateDialogParam (hInstance, MAKEINTRESOURCE( IDD_YAHOOACCOUNT ), - (HWND)lParam, first_run_dialog, (LPARAM)this ); + return (INT_PTR)CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_YAHOOACCOUNT), + (HWND)lParam, first_run_dialog, (LPARAM)this); } diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 7bff1a73dd..c548585dab 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -30,18 +30,18 @@ struct CYahooProto : public PROTO virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); - virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer ); - virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); + virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); + virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL); - virtual int __cdecl GetInfo( HANDLE hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL); + virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ); @@ -49,49 +49,49 @@ struct CYahooProto : public PROTO virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* ); - virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList ); - virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ); - virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg ); - virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url ); + virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles); + virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode( HANDLE hContact, int mode ); - virtual int __cdecl SetStatus( int iNewStatus ); + virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact ); - virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt ); - virtual int __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR* msg ); + virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); + virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt); + virtual int __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR *msg); virtual INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam); - virtual int __cdecl UserIsTyping( HANDLE hContact, int type ); + virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); - virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); + virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); //====| Events |====================================================================== - int __cdecl OnContactDeleted( WPARAM, LPARAM ); - int __cdecl OnIdleEvent( WPARAM, LPARAM ); - int __cdecl OnModulesLoadedEx( WPARAM, LPARAM ); - int __cdecl OnOptionsInit( WPARAM, LPARAM ); - int __cdecl OnSettingChanged( WPARAM, LPARAM ); + int __cdecl OnContactDeleted(WPARAM, LPARAM); + int __cdecl OnIdleEvent(WPARAM, LPARAM); + int __cdecl OnModulesLoadedEx(WPARAM, LPARAM); + int __cdecl OnOptionsInit(WPARAM, LPARAM); + int __cdecl OnSettingChanged(WPARAM, LPARAM); int __cdecl OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam); //====| Services |==================================================================== - INT_PTR __cdecl OnABCommand( WPARAM, LPARAM ); - INT_PTR __cdecl OnCalendarCommand( WPARAM, LPARAM ); - INT_PTR __cdecl OnEditMyProfile( WPARAM, LPARAM ); - INT_PTR __cdecl OnGotoMailboxCommand( WPARAM, LPARAM ); - INT_PTR __cdecl OnRefreshCommand( WPARAM, LPARAM ); - INT_PTR __cdecl OnShowMyProfileCommand( WPARAM, LPARAM ); - INT_PTR __cdecl OnShowProfileCommand( WPARAM, LPARAM ); + INT_PTR __cdecl OnABCommand(WPARAM, LPARAM); + INT_PTR __cdecl OnCalendarCommand(WPARAM, LPARAM); + INT_PTR __cdecl OnEditMyProfile(WPARAM, LPARAM); + INT_PTR __cdecl OnGotoMailboxCommand(WPARAM, LPARAM); + INT_PTR __cdecl OnRefreshCommand(WPARAM, LPARAM); + INT_PTR __cdecl OnShowMyProfileCommand(WPARAM, LPARAM); + INT_PTR __cdecl OnShowProfileCommand(WPARAM, LPARAM); INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam); - INT_PTR __cdecl GetUnreadEmailCount( WPARAM, LPARAM ); - INT_PTR __cdecl SendNudge( WPARAM, LPARAM ); - INT_PTR __cdecl SetMyAvatar( WPARAM, LPARAM ); + INT_PTR __cdecl GetUnreadEmailCount(WPARAM, LPARAM); + INT_PTR __cdecl SendNudge(WPARAM, LPARAM); + INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM); INT_PTR __cdecl CreateConference(WPARAM /*wParam*/, LPARAM /*lParam*/); @@ -141,9 +141,9 @@ struct CYahooProto : public PROTO void __cdecl send_avt_thread(void *psf); void __cdecl recv_avatarthread(void *pavt); - INT_PTR __cdecl GetAvatarInfo( WPARAM, LPARAM ); - INT_PTR __cdecl GetAvatarCaps( WPARAM, LPARAM ); - INT_PTR __cdecl GetMyAvatar( WPARAM, LPARAM ); + INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM); + INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM); + INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM); void ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type); void ext_got_picture_checksum(const char *me, const char *who, int cksum); @@ -152,11 +152,11 @@ struct CYahooProto : public PROTO void ext_got_picture_upload(const char *me, const char *url, unsigned int ts); void ext_got_avatar_share(int buddy_icon); - void reset_avatar(HANDLE hContact); + void reset_avatar(HCONTACT hContact); void request_avatar(const char* who); void SendAvatar(const TCHAR *szFile); - void GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int type); + void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type); //====| chat.cpp |==================================================================== void ChatRegister(void); @@ -195,13 +195,13 @@ struct CYahooProto : public PROTO void send_msg(const char *id, int protocol, const char *msg, int utf8); - void __cdecl im_sendacksuccess(HANDLE hContact); - void __cdecl im_sendackfail(HANDLE hContact); - void __cdecl im_sendackfail_longmsg(HANDLE hContact); + void __cdecl im_sendacksuccess(void *hContact); + void __cdecl im_sendackfail(void *hContact); + void __cdecl im_sendackfail_longmsg(void *hContact); //====| proto.cpp |=================================================================== - void __cdecl get_status_thread(HANDLE hContact); - void __cdecl get_info_thread(HANDLE hContact); + void __cdecl get_status_thread(void *hContact); + void __cdecl get_info_thread(void *hContact); //====| search.cpp |================================================================== void __cdecl search_simplethread(void *snsearch); @@ -217,26 +217,26 @@ struct CYahooProto : public PROTO void OpenURL(const char *url, int autoLogin); - INT_PTR __cdecl SetCustomStatCommand( WPARAM, LPARAM ); + INT_PTR __cdecl SetCustomStatCommand(WPARAM, LPARAM); //====| user_info.cpp |=============================================================== int __cdecl OnUserInfoInit( WPARAM wParam, LPARAM lParam ); //====| util.cpp |==================================================================== - int GetStringUtf( HANDLE hContact, const char* name, DBVARIANT* ); - DWORD SetStringUtf( HANDLE hContact, const char* valueName, const char* parValue ); + int GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* ); + DWORD SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue ); - DWORD Set_Protocol( HANDLE hContact, int protocol ); + DWORD Set_Protocol(HCONTACT hContact, int protocol ); int ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags); void ShowError(const TCHAR *title, const TCHAR *buff); int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL ); - bool IsMyContact(HANDLE hContact); + bool IsMyContact(HCONTACT hContact); //====| yahoo.cpp |=================================================================== - HANDLE add_buddy( const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags ); + HCONTACT add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags); const char *find_buddy( const char *yahoo_id); - HANDLE getbuddyH(const char *yahoo_id); + HCONTACT getbuddyH(const char *yahoo_id); void remove_buddy(const char *who, int protocol); void logout(); @@ -272,7 +272,7 @@ struct CYahooProto : public PROTO void ext_login_response(int succ, const char *url); void ext_login(enum yahoo_status login_mode); - void AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg); + void AddBuddy(HCONTACT hContact, const char *group, const TCHAR *msg); void YAHOO_utils_logversion(); diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 4730a59211..ebf142a7ab 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -31,7 +31,7 @@ void CYahooProto::logoff_buddies() { //set all contacts to 'offline' - for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { setWord( hContact, "Status", ID_STATUS_OFFLINE ); setDword(hContact, "IdleTS", 0); setDword(hContact, "PictLastCheck", 0); @@ -80,14 +80,14 @@ void CYahooProto::BroadcastStatus(int s) //======================================================= //Contact deletion event //======================================================= -int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam ) +int __cdecl CYahooProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - HANDLE hContact = (HANDLE) wParam; + HCONTACT hContact = (HCONTACT)wParam; debugLogA("[YahooContactDeleted]"); - if ( !m_bLoggedIn ) {//should never happen for Yahoo contacts + if (!m_bLoggedIn) {//should never happen for Yahoo contacts debugLogA("[YahooContactDeleted] We are not Logged On!!!"); return 0; } @@ -103,9 +103,9 @@ int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam ) remove_buddy(dbv.pszVal, getWord(hContact, "yprotoid", 0)); db_free(&dbv); - } else { - debugLogA("[YahooContactDeleted] Can't retrieve contact Yahoo ID"); } + else debugLogA("[YahooContactDeleted] Can't retrieve contact Yahoo ID"); + return 0; } @@ -244,21 +244,21 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) } //======================================================= -//Show buddy profile +// Show buddy profile //======================================================= -INT_PTR __cdecl CYahooProto::OnShowProfileCommand( WPARAM wParam, LPARAM lParam ) +INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM lParam) { - char tUrl[ 4096 ]; + char tUrl[4096]; DBVARIANT dbv; /** * We don't show profile for users using other IM clients through the IM server bridge */ - if (getWord(( HANDLE )wParam, "yprotoid", 0) != 0) { + if (getWord((HCONTACT)wParam, "yprotoid", 0) != 0) { return 0; } - if (getString((HANDLE)wParam, YAHOO_LOGINID, &dbv)) + if (getString((HCONTACT)wParam, YAHOO_LOGINID, &dbv)) return 0; mir_snprintf(tUrl, sizeof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal); @@ -497,7 +497,7 @@ void CYahooProto::MenuUninit( void ) int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { - const HANDLE hContact = (HANDLE)wParam; + const HCONTACT hContact = (HCONTACT)wParam; if (!IsMyContact(hContact)) { debugLogA("[OnPrebuildContactMenu] Not a Yahoo Contact!!!"); return 0; diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp index 39d5ed9027..79a2c77c64 100644 --- a/protocols/Yahoo/src/user_info.cpp +++ b/protocols/Yahoo/src/user_info.cpp @@ -47,7 +47,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa break; char* szProto; - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact == NULL) { szProto = ppro->m_szModuleName; @@ -118,7 +118,7 @@ int __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam ) odp.dwInitParam = (LPARAM)this; odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE; - HANDLE hContact = ( HANDLE )lParam; + HCONTACT hContact = (HCONTACT)lParam; if ( IsMyContact(hContact)) { odp.pfnDlgProc = YahooUserInfoDlgProc; odp.position = -1900000000; diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index 044c31ba84..2cad148fb1 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -39,7 +39,7 @@ int debugLogA( const char *fmt, ... ) return CallService(MS_NETLIB_LOG, (WPARAM)g_hNetlibUser, (LPARAM)str); } -DWORD CYahooProto::Set_Protocol( HANDLE hContact, int protocol ) +DWORD CYahooProto::Set_Protocol(HCONTACT hContact, int protocol ) { char *s=NULL; @@ -59,11 +59,11 @@ DWORD CYahooProto::Set_Protocol( HANDLE hContact, int protocol ) return 0; } -int CYahooProto::GetStringUtf(HANDLE hContact, const char* name, DBVARIANT* result) +int CYahooProto::GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result) { return db_get_utf(hContact, m_szModuleName, name, result); } -DWORD CYahooProto::SetStringUtf(HANDLE hContact, const char* valueName, const char* parValue) +DWORD CYahooProto::SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue) { return db_set_utf(hContact, m_szModuleName, valueName, parValue); } @@ -162,8 +162,8 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam) debugLogA("DB Setting changed. YAHOO user's visible setting changed."); DBVARIANT dbv; - if (!getString((HANDLE)wParam, YAHOO_LOGINID, &dbv)) { - int iAdd = (ID_STATUS_OFFLINE == getWord((HANDLE) wParam, "ApparentMode", 0)); + if (!getString((HCONTACT)wParam, YAHOO_LOGINID, &dbv)) { + int iAdd = (ID_STATUS_OFFLINE == getWord((HCONTACT)wParam, "ApparentMode", 0)); stealth(dbv.pszVal, iAdd); db_free(&dbv); } @@ -171,7 +171,7 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam) return 0; } -bool CYahooProto::IsMyContact(HANDLE hContact) +bool CYahooProto::IsMyContact(HCONTACT hContact) { if (!hContact) return false; diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 980fb3461e..9c5edf2f63 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -228,7 +228,7 @@ void CYahooProto::logout() poll_loop = 0; } -void CYahooProto::AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg) +void CYahooProto::AddBuddy(HCONTACT hContact, const char *group, const TCHAR *msg) { DBVARIANT dbv; char *fname=NULL, *lname=NULL, *ident=NULL, *who, *u_msg; @@ -282,9 +282,9 @@ void CYahooProto::AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg) mir_free(u_msg); } -HANDLE CYahooProto::getbuddyH(const char *yahoo_id) +HCONTACT CYahooProto::getbuddyH(const char *yahoo_id) { - for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (getString(hContact, YAHOO_LOGINID, &dbv)) continue; @@ -300,12 +300,12 @@ HANDLE CYahooProto::getbuddyH(const char *yahoo_id) return NULL; } -HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags ) +HCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags) { char *yid = NEWSTR_ALLOCA(yahoo_id); strlwr(yid); - HANDLE hContact = getbuddyH(yid); + HCONTACT hContact = getbuddyH(yid); if (hContact != NULL) { LOG(("[add_buddy] Found buddy id: %s, handle: %p", yid, hContact)); if ( !(flags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 1)) { @@ -319,7 +319,7 @@ HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int //not already there: add LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags)); - hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)m_szModuleName); setString( hContact, YAHOO_LOGINID, yid ); Set_Protocol( hContact, protocol ); @@ -340,7 +340,7 @@ HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int const char* CYahooProto::find_buddy( const char *yahoo_id) { static char nick[128]; - HANDLE hContact; + HCONTACT hContact; DBVARIANT dbv; hContact = getbuddyH(yahoo_id); @@ -371,7 +371,7 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co away, idle); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact == NULL) { debugLogA("Buddy Not Found. Adding..."); hContact = add_buddy(who, who, protocol, 0); @@ -426,7 +426,7 @@ void CYahooProto::ext_status_logon(const char *who, int protocol, int stat, cons ext_status_changed(who, protocol, stat, msg, away, idle, mobile, utf8); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact == NULL) { debugLogA("[ext_status_logon] Can't find handle for %s??? PANIC!!!", who); return; @@ -569,7 +569,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a LOG(("ext_got_audible for %s aud: %s msg:'%s' hash: %s", who, aud, msg, aud_hash)); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact == NULL) { LOG(("Buddy Not Found. Skipping avatar update")); return; @@ -600,7 +600,7 @@ void CYahooProto::ext_got_stealth(char *stealthlist) if (stealthlist) stealth = y_strsplit(stealthlist, ",", -1); - for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (getString( hContact, YAHOO_LOGINID, &dbv)) continue; @@ -645,7 +645,7 @@ void CYahooProto::ext_got_buddies(YList * buds) debugLogA(("[ext_got_buddies] Walking buddy list...")); for (; buds; buds = buds->next) { - HANDLE hContact; + HCONTACT hContact; yahoo_buddy *bud = ( yahoo_buddy* )buds->data; if (bud == NULL) { @@ -719,7 +719,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) { LOG(("[ext_rejected] who: %s msg: %s", who, msg)); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact != NULL) { /* * Make sure the contact is temporary so we could delete it w/o extra traffic @@ -739,7 +739,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status, int auth) { - HANDLE hContact=getbuddyH(who); + HCONTACT hContact=getbuddyH(who); LOG(("[ext_buddy_added] %s authorized you as %s group: %s status: %d auth: %d", who, myid, group, status, auth)); @@ -778,7 +778,7 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha { char nick[128]; BYTE *pCurBlob; - HANDLE hContact = NULL; + HCONTACT hContact = NULL; PROTORECVEVENT pre = { 0 }; /* NOTE: Msg is actually in UTF8 unless stated otherwise!! */ @@ -869,7 +869,7 @@ void CYahooProto::ext_typing_notify(const char *me, const char *who, int protoco { LOG(("[ext_typing_notify] me: '%s' who: '%s' protocol: %d stat: %d ", me, who, protocol, stat)); - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (hContact) CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)stat?10:0); @@ -904,7 +904,7 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con LOG(("[ext_game_notify] me: %s, who: %s, stat: %d, msg: %s", me, who, stat, msg)); /* FIXME - Not Implemented - this informs you someone else is playing on Yahoo! Games */ /* Also Stubbed in Sample Client */ - HANDLE hContact = getbuddyH(who); + HCONTACT hContact = getbuddyH(who); if (!hContact) return; -- cgit v1.2.3