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/im.cpp | 51 ++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'protocols/Yahoo/src/im.cpp') 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; } - - - -- cgit v1.2.3