From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/avatars.cpp | 6 +- protocols/AimOscar/src/chat.cpp | 6 +- protocols/AimOscar/src/file.cpp | 4 +- protocols/AimOscar/src/file.h | 8 +- protocols/AimOscar/src/links.cpp | 4 +- protocols/AimOscar/src/proto.cpp | 46 ++-- protocols/AimOscar/src/proto.h | 74 +++--- protocols/AimOscar/src/server.cpp | 24 +- protocols/AimOscar/src/services.cpp | 18 +- protocols/AimOscar/src/theme.cpp | 16 +- protocols/AimOscar/src/theme.h | 2 +- protocols/AimOscar/src/ui.cpp | 20 +- protocols/AimOscar/src/utility.cpp | 40 +-- protocols/EmLanProto/src/mlan.cpp | 24 +- protocols/EmLanProto/src/mlan.h | 6 +- protocols/FacebookRM/src/avatars.cpp | 2 +- protocols/FacebookRM/src/chat.cpp | 6 +- protocols/FacebookRM/src/communication.cpp | 2 +- protocols/FacebookRM/src/contacts.cpp | 32 +-- protocols/FacebookRM/src/dialogs.cpp | 16 +- protocols/FacebookRM/src/entities.h | 10 +- protocols/FacebookRM/src/events.cpp | 2 +- protocols/FacebookRM/src/json.cpp | 8 +- protocols/FacebookRM/src/messages.cpp | 12 +- protocols/FacebookRM/src/process.cpp | 14 +- protocols/FacebookRM/src/proto.cpp | 36 +-- protocols/FacebookRM/src/proto.h | 66 ++--- protocols/FacebookRM/src/stubs.cpp | 28 +- protocols/FacebookRM/src/theme.cpp | 8 +- protocols/GTalkExt/src/avatar.cpp | 8 +- protocols/GTalkExt/src/db.cpp | 2 +- protocols/GTalkExt/src/handlers.cpp | 2 +- protocols/GTalkExt/src/notifications.cpp | 18 +- protocols/GTalkExt/src/notifications.h | 2 +- protocols/GTalkExt/src/stdafx.h | 2 +- protocols/Gadu-Gadu/src/avatar.cpp | 8 +- protocols/Gadu-Gadu/src/core.cpp | 32 +-- protocols/Gadu-Gadu/src/dialogs.cpp | 10 +- protocols/Gadu-Gadu/src/filetransfer.cpp | 52 ++-- protocols/Gadu-Gadu/src/gg.cpp | 6 +- protocols/Gadu-Gadu/src/gg.h | 4 +- protocols/Gadu-Gadu/src/gg_proto.cpp | 42 +-- protocols/Gadu-Gadu/src/gg_proto.h | 68 ++--- protocols/Gadu-Gadu/src/groupchat.cpp | 26 +- protocols/Gadu-Gadu/src/image.cpp | 10 +- protocols/Gadu-Gadu/src/import.cpp | 4 +- protocols/Gadu-Gadu/src/links.cpp | 2 +- protocols/Gadu-Gadu/src/services.cpp | 2 +- protocols/IRCG/src/clist.cpp | 26 +- protocols/IRCG/src/commandmonitor.cpp | 24 +- protocols/IRCG/src/input.cpp | 10 +- protocols/IRCG/src/irc.h | 60 ++--- protocols/IRCG/src/irclib.cpp | 6 +- protocols/IRCG/src/irclib.h | 2 +- protocols/IRCG/src/ircproto.cpp | 52 ++-- protocols/IRCG/src/services.cpp | 40 +-- protocols/IRCG/src/ui_utils.cpp | 4 +- protocols/IRCG/src/ui_utils.h | 4 +- protocols/IRCG/src/userinfo.cpp | 8 +- protocols/IcqOscarJ/src/UI/askauthentication.cpp | 4 +- protocols/IcqOscarJ/src/UI/userinfotab.cpp | 6 +- protocols/IcqOscarJ/src/capabilities.cpp | 12 +- protocols/IcqOscarJ/src/cookies.cpp | 12 +- protocols/IcqOscarJ/src/cookies.h | 6 +- protocols/IcqOscarJ/src/directpackets.cpp | 12 +- protocols/IcqOscarJ/src/fam_01service.cpp | 6 +- protocols/IcqOscarJ/src/fam_02location.cpp | 8 +- protocols/IcqOscarJ/src/fam_03buddy.cpp | 10 +- protocols/IcqOscarJ/src/fam_04message.cpp | 52 ++-- protocols/IcqOscarJ/src/fam_09bos.cpp | 2 +- protocols/IcqOscarJ/src/fam_13servclist.cpp | 36 +-- protocols/IcqOscarJ/src/fam_15icqserver.cpp | 12 +- protocols/IcqOscarJ/src/icq_avatar.cpp | 12 +- protocols/IcqOscarJ/src/icq_avatar.h | 8 +- protocols/IcqOscarJ/src/icq_clients.cpp | 2 +- protocols/IcqOscarJ/src/icq_db.cpp | 36 +-- protocols/IcqOscarJ/src/icq_direct.cpp | 16 +- protocols/IcqOscarJ/src/icq_direct.h | 4 +- protocols/IcqOscarJ/src/icq_directmsg.cpp | 4 +- protocols/IcqOscarJ/src/icq_filerequests.cpp | 8 +- protocols/IcqOscarJ/src/icq_infoupdate.cpp | 4 +- protocols/IcqOscarJ/src/icq_menu.cpp | 20 +- protocols/IcqOscarJ/src/icq_popups.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 54 ++-- protocols/IcqOscarJ/src/icq_proto.h | 318 +++++++++++------------ protocols/IcqOscarJ/src/icq_rates.h | 2 +- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 64 ++--- protocols/IcqOscarJ/src/icq_servlist.h | 6 +- protocols/IcqOscarJ/src/icq_uploadui.cpp | 14 +- protocols/IcqOscarJ/src/icq_xstatus.cpp | 22 +- protocols/IcqOscarJ/src/icq_xtraz.cpp | 14 +- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 26 +- protocols/IcqOscarJ/src/oscar_filetransfer.cpp | 18 +- protocols/IcqOscarJ/src/oscar_filetransfer.h | 4 +- protocols/IcqOscarJ/src/stdpackets.cpp | 26 +- protocols/IcqOscarJ/src/utilities.cpp | 90 +++---- protocols/IcqOscarJ/src/utilities.h | 10 +- protocols/JabberG/src/jabber.h | 4 +- protocols/JabberG/src/jabber_adhoc.cpp | 2 +- protocols/JabberG/src/jabber_api.cpp | 4 +- protocols/JabberG/src/jabber_archive.cpp | 12 +- protocols/JabberG/src/jabber_chat.cpp | 24 +- protocols/JabberG/src/jabber_disco.cpp | 14 +- protocols/JabberG/src/jabber_events.cpp | 10 +- protocols/JabberG/src/jabber_groupchat.cpp | 10 +- protocols/JabberG/src/jabber_icolib.cpp | 8 +- protocols/JabberG/src/jabber_iq.h | 4 +- protocols/JabberG/src/jabber_iq_handlers.cpp | 2 +- protocols/JabberG/src/jabber_iqid.cpp | 24 +- protocols/JabberG/src/jabber_list.h | 4 +- protocols/JabberG/src/jabber_menu.cpp | 54 ++-- protocols/JabberG/src/jabber_message_manager.h | 4 +- protocols/JabberG/src/jabber_misc.cpp | 24 +- protocols/JabberG/src/jabber_notes.cpp | 2 +- protocols/JabberG/src/jabber_opt.cpp | 4 +- protocols/JabberG/src/jabber_privacy.cpp | 12 +- protocols/JabberG/src/jabber_proto.cpp | 62 ++--- protocols/JabberG/src/jabber_proto.h | 98 +++---- protocols/JabberG/src/jabber_rc.cpp | 4 +- protocols/JabberG/src/jabber_std.cpp | 4 +- protocols/JabberG/src/jabber_svc.cpp | 6 +- protocols/JabberG/src/jabber_thread.cpp | 22 +- protocols/JabberG/src/jabber_userinfo.cpp | 18 +- protocols/JabberG/src/jabber_util.cpp | 18 +- protocols/JabberG/src/jabber_xstatus.cpp | 28 +- protocols/JabberG/src/jabber_xstatus.h | 16 +- protocols/JabberG/src/ui_utils.cpp | 4 +- protocols/JabberG/src/ui_utils.h | 4 +- protocols/MRA/src/Mra.h | 20 +- protocols/MRA/src/MraAvatars.cpp | 16 +- protocols/MRA/src/MraChat.cpp | 26 +- protocols/MRA/src/MraFilesQueue.cpp | 6 +- protocols/MRA/src/MraPopUp.cpp | 4 +- protocols/MRA/src/MraProto.cpp | 50 ++-- protocols/MRA/src/MraProto.h | 162 ++++++------ protocols/MRA/src/MraSelectEMail.cpp | 6 +- protocols/MRA/src/MraSendCommand.cpp | 14 +- protocols/MRA/src/MraSendQueue.cpp | 8 +- protocols/MRA/src/MraSendQueue.h | 6 +- protocols/MRA/src/Mra_functions.cpp | 66 ++--- protocols/MRA/src/Mra_menus.cpp | 52 ++-- protocols/MRA/src/Mra_proto.cpp | 28 +- protocols/MRA/src/Mra_svcs.cpp | 14 +- protocols/MSN/src/msn_avatar.cpp | 2 +- protocols/MSN/src/msn_chat.cpp | 24 +- protocols/MSN/src/msn_commands.cpp | 32 +-- protocols/MSN/src/msn_contact.cpp | 10 +- protocols/MSN/src/msn_global.h | 18 +- protocols/MSN/src/msn_links.cpp | 12 +- protocols/MSN/src/msn_lists.cpp | 32 +-- protocols/MSN/src/msn_mail.cpp | 4 +- protocols/MSN/src/msn_menu.cpp | 26 +- protocols/MSN/src/msn_misc.cpp | 22 +- protocols/MSN/src/msn_msgqueue.cpp | 4 +- protocols/MSN/src/msn_opts.cpp | 2 +- protocols/MSN/src/msn_p2ps.cpp | 8 +- protocols/MSN/src/msn_proto.cpp | 58 ++--- protocols/MSN/src/msn_proto.h | 94 +++---- protocols/MSN/src/msn_soapab.cpp | 8 +- protocols/MSN/src/msn_srv.cpp | 4 +- protocols/MSN/src/msn_std.cpp | 6 +- protocols/MSN/src/msn_svcs.cpp | 10 +- protocols/MSN/src/msn_switchboard.cpp | 2 +- protocols/MSN/src/msn_threads.cpp | 4 +- protocols/MSN/src/msn_ws.cpp | 4 +- protocols/Omegle/src/chat.cpp | 4 +- protocols/Omegle/src/messages.cpp | 2 +- protocols/Omegle/src/proto.cpp | 4 +- protocols/Omegle/src/proto.h | 44 ++-- protocols/Omegle/src/stubs.cpp | 38 +-- protocols/Omegle/src/theme.cpp | 2 +- protocols/Skype/src/skype_avatars.cpp | 4 +- protocols/Skype/src/skype_blocked.cpp | 8 +- protocols/Skype/src/skype_chat.cpp | 32 +-- protocols/Skype/src/skype_chat.h | 4 +- protocols/Skype/src/skype_contacts.cpp | 44 ++-- protocols/Skype/src/skype_database.cpp | 8 +- protocols/Skype/src/skype_dialogs.cpp | 4 +- protocols/Skype/src/skype_events.cpp | 8 +- protocols/Skype/src/skype_instances.cpp | 2 +- protocols/Skype/src/skype_menus.cpp | 12 +- protocols/Skype/src/skype_messages.cpp | 22 +- protocols/Skype/src/skype_profile.cpp | 36 +-- protocols/Skype/src/skype_proto.cpp | 50 ++-- protocols/Skype/src/skype_proto.h | 132 +++++----- protocols/Skype/src/skype_utils.cpp | 6 +- protocols/SkypeClassic/src/contacts.cpp | 32 +-- protocols/SkypeClassic/src/contacts.h | 8 +- protocols/SkypeClassic/src/gchat.cpp | 28 +- protocols/SkypeClassic/src/gchat.h | 6 +- protocols/SkypeClassic/src/skype.cpp | 74 +++--- protocols/SkypeClassic/src/skype.h | 2 +- protocols/SkypeClassic/src/skypeapi.cpp | 30 +-- protocols/SkypeClassic/src/skypeapi.h | 2 +- protocols/SkypeClassic/src/skypeopt.cpp | 4 +- protocols/SkypeClassic/src/voiceservice.cpp | 8 +- protocols/SkypeClassic/src/voiceservice.h | 2 +- protocols/Tlen/src/tlen.cpp | 10 +- protocols/Tlen/src/tlen.h | 54 ++-- protocols/Tlen/src/tlen_avatar.cpp | 14 +- protocols/Tlen/src/tlen_avatar.h | 2 +- protocols/Tlen/src/tlen_iqid.cpp | 14 +- protocols/Tlen/src/tlen_misc.cpp | 18 +- protocols/Tlen/src/tlen_muc.cpp | 12 +- protocols/Tlen/src/tlen_picture.cpp | 2 +- protocols/Tlen/src/tlen_picture.h | 2 +- protocols/Tlen/src/tlen_presence.cpp | 4 +- protocols/Tlen/src/tlen_svc.cpp | 70 ++--- protocols/Tlen/src/tlen_thread.cpp | 10 +- protocols/Tlen/src/tlen_userinfo.cpp | 8 +- protocols/Tlen/src/tlen_util.cpp | 2 +- protocols/Tlen/src/tlen_voice.cpp | 6 +- protocols/Twitter/src/chat.cpp | 4 +- protocols/Twitter/src/connection.cpp | 18 +- protocols/Twitter/src/contacts.cpp | 36 +-- protocols/Twitter/src/proto.cpp | 20 +- protocols/Twitter/src/proto.h | 52 ++-- protocols/Twitter/src/stubs.cpp | 30 +-- protocols/Twitter/src/theme.cpp | 6 +- protocols/Twitter/src/ui.cpp | 2 +- protocols/VKontakte/src/misc.cpp | 8 +- protocols/VKontakte/src/vk_avatars.cpp | 10 +- protocols/VKontakte/src/vk_chats.cpp | 14 +- protocols/VKontakte/src/vk_proto.cpp | 48 ++-- protocols/VKontakte/src/vk_proto.h | 52 ++-- protocols/VKontakte/src/vk_thread.cpp | 10 +- protocols/WhatsApp/src/chat.cpp | 2 +- protocols/WhatsApp/src/contacts.cpp | 78 +++--- protocols/WhatsApp/src/entities.h | 8 +- protocols/WhatsApp/src/messages.cpp | 12 +- protocols/WhatsApp/src/proto.cpp | 12 +- protocols/WhatsApp/src/proto.h | 64 ++--- protocols/WhatsApp/src/theme.cpp | 18 +- protocols/Xfire/src/Xfire_avatar_loader.cpp | 2 +- protocols/Xfire/src/Xfire_avatar_loader.h | 34 +-- protocols/Xfire/src/baseProtocol.h | 4 +- protocols/Xfire/src/buddylist.cpp | 2 +- protocols/Xfire/src/buddylist.h | 2 +- protocols/Xfire/src/main.cpp | 86 +++--- protocols/Xfire/src/processbuddyinfo.cpp | 2 +- protocols/Xfire/src/processbuddyinfo.h | 2 +- protocols/Xfire/src/recvremovebuddypacket.h | 2 +- protocols/Xfire/src/userdetails.cpp | 20 +- protocols/Yahoo/src/avatar.cpp | 16 +- protocols/Yahoo/src/chat.cpp | 22 +- protocols/Yahoo/src/file_transfer.cpp | 14 +- protocols/Yahoo/src/file_transfer.h | 2 +- protocols/Yahoo/src/im.cpp | 14 +- protocols/Yahoo/src/links.cpp | 2 +- protocols/Yahoo/src/proto.cpp | 42 +-- protocols/Yahoo/src/proto.h | 60 ++--- protocols/Yahoo/src/services.cpp | 10 +- protocols/Yahoo/src/user_info.cpp | 4 +- protocols/Yahoo/src/util.cpp | 12 +- protocols/Yahoo/src/yahoo.cpp | 34 +-- 256 files changed, 2596 insertions(+), 2596 deletions(-) (limited to 'protocols') diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index a4617dbd29..a5d6c1cc5d 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . void __cdecl CAimProto::avatar_request_thread(void* param) { - HCONTACT hContact = (HCONTACT)param; + MCONTACT hContact = (MCONTACT)param; char *sn = getStringA(hContact, AIM_KEY_SN); debugLogA("Starting avatar request thread for %s)", sn); @@ -59,7 +59,7 @@ void __cdecl CAimProto::avatar_upload_thread(void* param) delete req; } -void CAimProto::avatar_request_handler(HCONTACT hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested +void CAimProto::avatar_request_handler(MCONTACT hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested { if (hContact == NULL) { @@ -121,7 +121,7 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, res ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, &AI, 0); } -int CAimProto::get_avatar_filename(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) +int CAimProto::get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName); diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp index 7ba14d4e84..29b1a202dd 100644 --- a/protocols/AimOscar/src/chat.cpp +++ b/protocols/AimOscar/src/chat.cpp @@ -68,7 +68,7 @@ void CAimProto::chat_event(const char* id, const char* sn, int evt, const TCHAR* TCHAR* idt = mir_a2t(id); TCHAR* snt = mir_a2t(sn); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; @@ -137,7 +137,7 @@ int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_PRIVMESS: { char* sn = mir_t2a(gch->ptszUID); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); mir_free(sn); CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); } @@ -160,7 +160,7 @@ int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_NICKLISTMENU: { char *sn = mir_t2a(gch->ptszUID); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); mir_free(sn); switch (gch->dwData) diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 8d4972e3e4..03871937f8 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -484,7 +484,7 @@ void CAimProto::shutdown_file_transfers(void) ft_list_type::ft_list_type() : OBJLIST (10) {}; -file_transfer* ft_list_type::find_by_cookie(char* cookie, HCONTACT hContact) +file_transfer* ft_list_type::find_by_cookie(char* cookie, MCONTACT hContact) { for (int i = 0; i < getCount(); ++i) { @@ -528,7 +528,7 @@ void ft_list_type::remove_by_ft(file_transfer *ft) } } -file_transfer::file_transfer(HCONTACT hCont, char* nick, char* cookie) +file_transfer::file_transfer(MCONTACT hCont, char* nick, char* cookie) { memset(this, 0, sizeof(*this)); diff --git a/protocols/AimOscar/src/file.h b/protocols/AimOscar/src/file.h index 61bc3e9d13..4577f2bb0e 100644 --- a/protocols/AimOscar/src/file.h +++ b/protocols/AimOscar/src/file.h @@ -23,7 +23,7 @@ struct CAimProto; struct file_transfer { - HCONTACT hContact; + MCONTACT hContact; char* sn; char icbm_cookie[8]; @@ -56,7 +56,7 @@ struct file_transfer bool requester; bool success; - file_transfer(HCONTACT hCont, char* nick, char* cookie); + file_transfer(MCONTACT hCont, char* nick, char* cookie); ~file_transfer(); void listen(CAimProto* ppro); @@ -68,8 +68,8 @@ struct ft_list_type : OBJLIST { ft_list_type(); - file_transfer* find_by_handle(HCONTACT hContact); - file_transfer* find_by_cookie(char* cookie, HCONTACT hContact); + file_transfer* find_by_handle(MCONTACT hContact); + file_transfer* find_by_cookie(char* cookie, MCONTACT hContact); file_transfer* find_by_port(unsigned short port); bool find_by_ft(file_transfer *ft); diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index a4ca30f868..0286e3af93 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -113,7 +113,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam) if (!proto->contact_from_sn(sn)) /* does not yet check if sn is current user */ { - HCONTACT hContact = proto->contact_from_sn(sn, true); + MCONTACT hContact = proto->contact_from_sn(sn, true); proto->add_contact_to_group(hContact, group && group[0] ? group : AIM_DEFAULT_GROUP); } mir_free(group); @@ -137,7 +137,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam) } if (sn == NULL) return 1; /* parse failed */ - HCONTACT hContact = proto->contact_from_sn(sn, true, true); + MCONTACT hContact = proto->contact_from_sn(sn, true, true); if (hContact) CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, (LPARAM)msg); diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index c7001071cc..fb51b7e3b9 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -126,17 +126,17 @@ int CAimProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -HCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { if (state != 1) return 0; TCHAR *id = psr->id ? psr->id : psr->nick; char *sn = psr->flags & PSR_UNICODE ? mir_u2a((wchar_t*)id) : mir_strdup((char*)id); - HCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0); + MCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0); mir_free(sn); return hContact; //See authrequest for serverside addition } -HCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } @@ -160,7 +160,7 @@ int CAimProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CAimProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) +int __cdecl CAimProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt) { return 1; } @@ -168,7 +168,7 @@ int __cdecl CAimProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CAimProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { //Not a real authrequest- only used b/c we don't know the group until now. if (state != 1) @@ -196,7 +196,7 @@ HANDLE __cdecl CAimProto::ChangeInfo(int iInfoType, void* pInfoData) //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CAimProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE __cdecl CAimProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { file_transfer *ft = (file_transfer*)hTransfer; if (ft && ft_list.find_by_ft(ft)) @@ -224,7 +224,7 @@ HANDLE __cdecl CAimProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const P //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CAimProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CAimProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -247,7 +247,7 @@ int __cdecl CAimProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CAimProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) +int __cdecl CAimProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -302,7 +302,7 @@ int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CAimProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CAimProto::GetCaps(int type, MCONTACT hContact) { switch (type) { @@ -345,7 +345,7 @@ DWORD_PTR __cdecl CAimProto::GetCaps(int type, HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CAimProto::GetInfo(HCONTACT hContact, int infoType) +int __cdecl CAimProto::GetInfo(MCONTACT hContact, int infoType) { return 1; } @@ -421,7 +421,7 @@ HWND __cdecl CAimProto::CreateExtendedSearchUI(HWND owner) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CAimProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CAimProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -429,7 +429,7 @@ int __cdecl CAimProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CAimProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) +int __cdecl CAimProto::RecvFile(MCONTACT hContact, PROTOFILEEVENT* evt) { return Proto_RecvFile(hContact, evt); } @@ -437,7 +437,7 @@ int __cdecl CAimProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CAimProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CAimProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { char *omsg = pre->szMessage; char *bbuf = NULL; @@ -458,7 +458,7 @@ int __cdecl CAimProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CAimProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CAimProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -466,7 +466,7 @@ int __cdecl CAimProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CAimProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CAimProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } @@ -474,7 +474,7 @@ int __cdecl CAimProto::SendContacts(HCONTACT hContact, int flags, int nContacts, //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CAimProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) +HANDLE __cdecl CAimProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { if (state != 1) return 0; @@ -557,7 +557,7 @@ void __cdecl CAimProto::msg_ack_success(void* param) } -int __cdecl CAimProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CAimProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { if (pszSrc == NULL) return 0; @@ -626,7 +626,7 @@ int __cdecl CAimProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CAimProto::SendUrl(HCONTACT hContact, int flags, const char* url) +int __cdecl CAimProto::SendUrl(MCONTACT hContact, int flags, const char* url) { return 1; } @@ -634,7 +634,7 @@ int __cdecl CAimProto::SendUrl(HCONTACT hContact, int flags, const char* url) //////////////////////////////////////////////////////////////////////////////////////// // SetApparentMode - sets the visibility m_iStatus -int __cdecl CAimProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CAimProto::SetApparentMode(MCONTACT hContact, int mode) { return 0; } @@ -715,7 +715,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg) { Sleep(150); - HCONTACT hContact = (HCONTACT)arg; + MCONTACT hContact = (MCONTACT)arg; DBVARIANT dbv; if (!db_get_ts(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); @@ -724,7 +724,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg) else ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -HANDLE __cdecl CAimProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CAimProto::GetAwayMsg(MCONTACT hContact) { if (state != 1) return 0; @@ -746,7 +746,7 @@ HANDLE __cdecl CAimProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CAimProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* pre) +int __cdecl CAimProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* pre) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)pre->szMessage); return 0; @@ -800,7 +800,7 @@ int __cdecl CAimProto::SetAwayMsg(int status, const TCHAR* msg) ///////////////////////////////////////////////////////////////////////////////////////// // UserIsTyping - sends a UTN notification -int __cdecl CAimProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CAimProto::UserIsTyping(MCONTACT hContact, int type) { if (state != 1) return 0; diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index fa1f999728..9a59176ab0 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -28,23 +28,23 @@ struct CAimProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - 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 HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ); @@ -52,24 +52,24 @@ struct CAimProto : public PROTO virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* ); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT* ); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* ); - 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode ); virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact ); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt ); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact ); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt ); virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg ); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); @@ -213,9 +213,9 @@ struct CAimProto : public PROTO void __cdecl avatar_request_thread( void* param ); void __cdecl avatar_upload_thread( void* param ); - void avatar_request_handler(HCONTACT hContact, char* hash, unsigned char type); + void avatar_request_handler(MCONTACT hContact, char* hash, unsigned char type); void avatar_retrieval_handler(const char* sn, const char* hash, const char* data, int data_len); - int get_avatar_filename(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); + int get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); ////////////////////////////////////////////////////////////////////////////////////// // away.cpp @@ -414,37 +414,37 @@ struct CAimProto : public PROTO ////////////////////////////////////////////////////////////////////////////////////// // utilities.cpp - struct msg_ack_param { HCONTACT hContact; const char *msg; int id; bool success; }; + struct msg_ack_param { MCONTACT hContact; const char *msg; int id; bool success; }; void __cdecl msg_ack_success(void*); void __cdecl start_connection(void*); - HCONTACT find_chat_contact(const char * room); - HCONTACT contact_from_sn(const char* sn, bool addIfNeeded = false, bool temporary = false); + MCONTACT find_chat_contact(const char * room); + MCONTACT contact_from_sn(const char* sn, bool addIfNeeded = false, bool temporary = false); void broadcast_status(int status); bool wait_conn(HANDLE& hConn, HANDLE& hEvent, unsigned short service); - bool is_my_contact(HCONTACT hContact); - void add_contact_to_group(HCONTACT hContact, const char* group); - void set_local_nick(HCONTACT hContact, char* nick, char* note); + bool is_my_contact(MCONTACT hContact); + void add_contact_to_group(MCONTACT hContact, const char* group); + void set_local_nick(MCONTACT hContact, char* nick, char* note); void upload_nicks(void); void update_server_group(const char* group, unsigned short group_id); void offline_contacts(void); - void offline_contact(HCONTACT hContact, bool remove_settings); + void offline_contact(MCONTACT hContact, bool remove_settings); unsigned short get_default_port(void); int open_contact_file(const char* sn, const TCHAR* file, const char* mode, TCHAR* &path, bool contact_dir); void write_away_message(const char* sn, const char* msg, bool utf); void write_profile(const char* sn, const char* msg, bool utf); - unsigned short getBuddyId(HCONTACT hContact, int i); - unsigned short getGroupId(HCONTACT hContact, int i); - void setBuddyId(HCONTACT hContact, int i, unsigned short id); - void setGroupId(HCONTACT hContact, int i, unsigned short id); - int deleteBuddyId(HCONTACT hContact, int i); - int deleteGroupId(HCONTACT hContact, int i); + unsigned short getBuddyId(MCONTACT hContact, int i); + unsigned short getGroupId(MCONTACT hContact, int i); + void setBuddyId(MCONTACT hContact, int i, unsigned short id); + void setGroupId(MCONTACT hContact, int i, unsigned short id); + int deleteBuddyId(MCONTACT hContact, int i); + int deleteGroupId(MCONTACT hContact, int i); - unsigned short search_for_free_item_id(HCONTACT hbuddy); + unsigned short search_for_free_item_id(MCONTACT hbuddy); unsigned short* get_members_of_group(unsigned short group_id, unsigned short& size); void ShowPopup( const char* msg, int flags, char* url = 0 ); diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 2702a5af90..4a966254a7 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -238,7 +238,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 unsigned char sn_len = snac.ubyte(); char* sn = snac.part(1, sn_len); - HCONTACT hContact = contact_from_sn(sn, true); + MCONTACT hContact = contact_from_sn(sn, true); int offset = sn_len + 3; int tlv_count = snac.ushort(offset); @@ -618,7 +618,7 @@ void CAimProto::snac_user_offline(SNAC &snac)//family 0x0003 { unsigned char buddy_length=snac.ubyte(); char* buddy=snac.part(1,buddy_length); - HCONTACT hContact=contact_from_sn(buddy, true); + MCONTACT hContact=contact_from_sn(buddy, true); if (hContact) offline_contact(hContact,0); mir_free(buddy); @@ -646,7 +646,7 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset) { case 0x0000: //buddy record { - HCONTACT hContact = contact_from_sn(name, true); + MCONTACT hContact = contact_from_sn(name, true); if (hContact) { int i; @@ -863,7 +863,7 @@ void CAimProto::modify_ssi_list(SNAC &snac, int &offset) { case 0x0000: //buddy record { - HCONTACT hContact = contact_from_sn(name, true); + MCONTACT hContact = contact_from_sn(name, true); if (hContact) { for (int tlv_offset = 0; tlv_offset < tlv_size; ) @@ -982,7 +982,7 @@ void CAimProto::delete_ssi_list(SNAC &snac, int &offset) unsigned short item_id=snac.ushort(offset+4+name_length); unsigned short type=snac.ushort(offset+6+name_length); - HCONTACT hContact = contact_from_sn(name); + MCONTACT hContact = contact_from_sn(name); switch (type) { case 0x0000: //buddy record @@ -1094,7 +1094,7 @@ void CAimProto::snac_message_accepted(SNAC &snac)//family 0x004 unsigned char sn_length=snac.ubyte(10); char* sn = snac.part(11,sn_length); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); if (hContact) { msg_ack_param *msg_ack = (msg_ack_param*)mir_alloc(sizeof(msg_ack_param)); @@ -1117,7 +1117,7 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho unsigned char sn_length = snac.ubyte(10); char* sn = snac.part(11,sn_length); - HCONTACT hContact = contact_from_sn(sn, true, true), hMsgContact = NULL; + MCONTACT hContact = contact_from_sn(sn, true, true), hMsgContact = NULL; int offset=15+sn_length; @@ -1476,7 +1476,7 @@ void CAimProto::snac_file_decline(SNAC &snac)//family 0x0004 int sn_len = snac.ubyte(10); char* sn = snac.part(11, sn_len); int reason = snac.ushort(11 + sn_len); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); msg_ack_param *msg_ack = (msg_ack_param*)mir_alloc(sizeof(msg_ack_param)); msg_ack->hContact = hContact; @@ -1496,7 +1496,7 @@ void CAimProto::snac_file_decline(SNAC &snac)//family 0x0004 if (error == 0x02) { debugLogA("File Transfer declied"); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); file_transfer *ft = ft_list.find_by_cookie(icbm_cookie, hContact); if (ft) { @@ -1527,7 +1527,7 @@ void CAimProto::snac_received_info(SNAC &snac)//family 0x0002 char* sn = snac.part(1, sn_length); unsigned short tlv_count = snac.ushort(3 + sn_length); offset = 5 + sn_length; - HCONTACT hContact = contact_from_sn(sn, true, true); + MCONTACT hContact = contact_from_sn(sn, true, true); while (offset < snac.len()) { @@ -1589,7 +1589,7 @@ void CAimProto::snac_typing_notification(SNAC &snac)//family 0x004 { unsigned char sn_length=snac.ubyte(10); char* sn=snac.part(11,sn_length); - HCONTACT hContact=contact_from_sn(sn); + MCONTACT hContact=contact_from_sn(sn); if (hContact) { unsigned short type=snac.ushort(11+sn_length); @@ -2304,7 +2304,7 @@ void CAimProto::snac_admin_account_confirm(SNAC &snac)//family 0x0007 { char sn[33]; int sn_length=buf[SNAC_SIZE*2]; - HCONTACT hContact; + MCONTACT hContact; ZeroMemory(sn,sizeof(sn)); memcpy(sn,&buf[SNAC_SIZE*2+1],sn_length); hContact=find_contact(sn); diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index f2646551c0..64ac487fe9 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -91,7 +91,7 @@ INT_PTR CAimProto::GetProfile(WPARAM wParam, LPARAM lParam) return 0; DBVARIANT dbv; - if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv)) { + if (!getString((MCONTACT)wParam, AIM_KEY_SN, &dbv)) { request_HTML_profile = 1; aim_query_profile(hServerConn, seqno, dbv.pszVal); db_free(&dbv); @@ -105,7 +105,7 @@ INT_PTR CAimProto::GetHTMLAwayMsg(WPARAM wParam, LPARAM /*lParam*/) return 0; DBVARIANT dbv; - if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv)) + if (!getString((MCONTACT)wParam, AIM_KEY_SN, &dbv)) { request_away_message = 1; aim_query_away_message(hServerConn, seqno, dbv.pszVal); @@ -119,7 +119,7 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam) if (strcmp(cws->szModule, MOD_KEY_CL) == 0 && state == 1 && wParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (strcmp(cws->szSetting, AIM_KEY_NL) == 0) { if (cws->value.type == DBVT_DELETED) @@ -169,7 +169,7 @@ int CAimProto::OnContactDeleted(WPARAM wParam,LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0)) return 0; @@ -203,7 +203,7 @@ int CAimProto::OnGroupChange(WPARAM wParam,LPARAM lParam) { if (state != 1 || !getByte(AIM_KEY_MG, 1)) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam; if (hContact == NULL) @@ -254,7 +254,7 @@ INT_PTR CAimProto::AddToServerList(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0]) { @@ -270,7 +270,7 @@ INT_PTR CAimProto::BlockBuddy(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; unsigned short item_id; DBVARIANT dbv; if (getString(hContact, AIM_KEY_SN, &dbv)) return 0; @@ -328,7 +328,7 @@ INT_PTR CAimProto::OnJoinChat(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) @@ -344,7 +344,7 @@ INT_PTR CAimProto::OnLeaveChat(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 711dd27b9d..57fdc2a032 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -120,7 +120,7 @@ static const char* extra_ES_icon_name[2] = "hiptop", }; -static void set_AT_icon(CAimProto* ppro, HCONTACT hContact) +static void set_AT_icon(CAimProto* ppro, MCONTACT hContact) { if (ppro->isChatRoom(hContact)) return; @@ -128,7 +128,7 @@ static void set_AT_icon(CAimProto* ppro, HCONTACT hContact) ExtraIcon_SetIcon(hExtraAT, hContact, (i < 5) ? GetIconHandle(extra_AT_icon_name[i]) : NULL); } -static void set_ES_icon(CAimProto* ppro, HCONTACT hContact) +static void set_ES_icon(CAimProto* ppro, MCONTACT hContact) { if (ppro->isChatRoom(hContact)) return; @@ -136,7 +136,7 @@ static void set_ES_icon(CAimProto* ppro, HCONTACT hContact) ExtraIcon_SetIcon(hExtraAT, hContact, (i < 2) ? GetIconHandle(extra_ES_icon_name[i]) : NULL); } -void set_contact_icon(CAimProto* ppro, HCONTACT hContact) +void set_contact_icon(CAimProto* ppro, MCONTACT hContact) { if (!ppro->getByte(AIM_KEY_AT, 0)) set_AT_icon(ppro, hContact); if (!ppro->getByte(AIM_KEY_ES, 0)) set_ES_icon(ppro, hContact); @@ -144,27 +144,27 @@ void set_contact_icon(CAimProto* ppro, HCONTACT hContact) void remove_AT_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) if (!ppro->isChatRoom(hContact)) ExtraIcon_Clear(hExtraAT, hContact); } void remove_ES_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) if (!ppro->isChatRoom(hContact)) ExtraIcon_Clear(hExtraES, hContact); } void add_AT_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) set_AT_icon(ppro, hContact); } void add_ES_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) set_ES_icon(ppro, hContact); } @@ -179,7 +179,7 @@ void InitExtraIcons(void) int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; bool bIsChatRoom = isChatRoom(hContact); //see if we should add the html away message context menu items diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h index c2e8093ce9..e2e6531174 100644 --- a/protocols/AimOscar/src/theme.h +++ b/protocols/AimOscar/src/theme.h @@ -33,6 +33,6 @@ void remove_AT_icons(CAimProto* ppro); void add_ES_icons(CAimProto* ppro); void remove_ES_icons(CAimProto* ppro); -void set_contact_icon(CAimProto* ppro, HCONTACT hContact); +void set_contact_icon(CAimProto* ppro, MCONTACT hContact); #endif diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index fd4dba0bea..fbcf065d70 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -1326,14 +1326,14 @@ INT_PTR CALLBACK join_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ///////////////////////////////////////////////////////////////////////////////////////// // Invite to chat dialog -static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg) +static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) clist_chat_invite_send(hItemT, hwndList, item, ppro, msg); } @@ -1359,26 +1359,26 @@ static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, chat_list_item } } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } -static void clist_validate_contact(HCONTACT hItem, HWND hwndList, CAimProto* ppro) +static void clist_validate_contact(MCONTACT hItem, HWND hwndList, CAimProto* ppro) { if (!ppro->is_my_contact(hItem) || ppro->isChatRoom(hItem) || ppro->getWord(hItem, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE) SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); } -static void clist_chat_prepare(HCONTACT hItem, HWND hwndList, CAimProto* ppro) +static void clist_chat_prepare(MCONTACT hItem, HWND hwndList, CAimProto* ppro) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) clist_chat_prepare(hItemT, hwndList, ppro); } @@ -1423,7 +1423,7 @@ INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP { case CLN_NEWCONTACT: if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - clist_validate_contact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); + clist_validate_contact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); break; case CLN_LISTREBUILT: diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 7df2eccaaf..119234a93c 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -160,15 +160,15 @@ unsigned short CAimProto::get_default_port(void) return getWord(AIM_KEY_PN, getByte(AIM_KEY_DSSL, 0) ? AIM_DEFAULT_PORT : AIM_DEFAULT_SSL_PORT); } -bool CAimProto::is_my_contact(HCONTACT hContact) +bool CAimProto::is_my_contact(MCONTACT hContact) { const char* szProto = GetContactProto(hContact); return szProto != NULL && strcmp(m_szModuleName, szProto) == 0; } -HCONTACT CAimProto::find_chat_contact(const char* room) +MCONTACT CAimProto::find_chat_contact(const char* room) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) { bool found = !strcmp(room, dbv.pszVal); @@ -180,11 +180,11 @@ HCONTACT CAimProto::find_chat_contact(const char* room) return NULL; } -HCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary) +MCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary) { ptrA norm_sn( normalize_name(sn)); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (!getString(hContact, AIM_KEY_SN, &dbv)) { bool found = !strcmp(norm_sn, dbv.pszVal); @@ -195,7 +195,7 @@ HCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempo } if (addIfNeeded) { - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) m_szModuleName) == 0) { setString(hContact, AIM_KEY_SN, norm_sn); @@ -234,7 +234,7 @@ void CAimProto::update_server_group(const char* group, unsigned short group_id) mir_free(user_id_array); } -void CAimProto::add_contact_to_group(HCONTACT hContact, const char* new_group) +void CAimProto::add_contact_to_group(MCONTACT hContact, const char* new_group) { if (new_group == NULL) return; @@ -300,7 +300,7 @@ void CAimProto::add_contact_to_group(HCONTACT hContact, const char* new_group) db_free(&dbv); } -void CAimProto::offline_contact(HCONTACT hContact, bool remove_settings) +void CAimProto::offline_contact(MCONTACT hContact, bool remove_settings) { if (remove_settings) { @@ -318,7 +318,7 @@ void CAimProto::offline_contact(HCONTACT hContact, bool remove_settings) void CAimProto::offline_contacts(void) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) offline_contact(hContact,true); allow_list.destroy(); @@ -376,14 +376,14 @@ void create_group(const char *group) mir_free(szGroupName); } -unsigned short CAimProto::search_for_free_item_id(HCONTACT hbuddy)//returns a free item id and links the id to the buddy +unsigned short CAimProto::search_for_free_item_id(MCONTACT hbuddy)//returns a free item id and links the id to the buddy { unsigned short id; retry: id = get_random(); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { for(int i=1; ;++i) { unsigned short item_id = getBuddyId(hContact, i); if (item_id == 0) break; @@ -402,7 +402,7 @@ unsigned short* CAimProto::get_members_of_group(unsigned short group_id, unsigne unsigned short* list = NULL; size = 0; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { for(int i=1; ;++i) { unsigned short user_group_id = getGroupId(hContact, i); if (user_group_id == 0) @@ -422,7 +422,7 @@ unsigned short* CAimProto::get_members_of_group(unsigned short group_id, unsigne void CAimProto::upload_nicks(void) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if ( !db_get_utf(hContact, MOD_KEY_CL, "MyHandle", &dbv)) { set_local_nick(hContact, dbv.pszVal, NULL); @@ -431,7 +431,7 @@ void CAimProto::upload_nicks(void) } } -void CAimProto::set_local_nick(HCONTACT hContact, char* nick, char* note) +void CAimProto::set_local_nick(MCONTACT hContact, char* nick, char* note) { DBVARIANT dbv; if (getString(hContact, AIM_KEY_SN, &dbv)) return; @@ -498,42 +498,42 @@ void BdList::remove_by_id(unsigned short id) ///////////////////////////////////////////////////////////////////////////////////////// -unsigned short CAimProto::getBuddyId(HCONTACT hContact, int i) +unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); return getWord(hContact, item, 0); } -void CAimProto::setBuddyId(HCONTACT hContact, int i, unsigned short id) +void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); setWord(hContact, item, id); } -int CAimProto::deleteBuddyId(HCONTACT hContact, int i) +int CAimProto::deleteBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); return delSetting(hContact, item); } -unsigned short CAimProto::getGroupId(HCONTACT hContact, int i) +unsigned short CAimProto::getGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); return getWord(hContact, item, 0); } -void CAimProto::setGroupId(HCONTACT hContact, int i, unsigned short id) +void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); setWord(hContact, item, id); } -int CAimProto::deleteGroupId(HCONTACT hContact, int i) +int CAimProto::deleteGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 32bdd1a2da..539c82bf97 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -127,7 +127,7 @@ void CMLan::SetMirandaStatus(u_int status) void CMLan::SetAllOffline() { - for (HCONTACT hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) { + for (MCONTACT hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) { db_set_w(hContact, PROTONAME, "Status", ID_STATUS_OFFLINE); db_unset(hContact, PROTONAME, "IP"); } @@ -204,7 +204,7 @@ void CMLan::Check() if (!cont->m_time) { cont->m_status = ID_STATUS_OFFLINE; - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) { db_set_w(hContact,PROTONAME,"Status",ID_STATUS_OFFLINE); @@ -236,9 +236,9 @@ void CMLan::SendPacketExt(TPacket& pak, u_long addr) delete[] buf; } -HCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status) +MCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status) { - for (HCONTACT res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) { + for (MCONTACT res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) { u_long caddr = db_get_dw(res, PROTONAME, "ipaddr", -1); if (caddr==addr.S_un.S_addr) { if (make_permanent) @@ -250,7 +250,7 @@ HCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, b } if (add_to_list) { - HCONTACT res=(HCONTACT)CallService(MS_DB_CONTACT_ADD,0,0); + MCONTACT res=(MCONTACT)CallService(MS_DB_CONTACT_ADD,0,0); CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)res,(LPARAM)PROTONAME); db_set_dw(res,PROTONAME, "ipaddr", addr.S_un.S_addr); db_set_s(res,PROTONAME, "Nick", nick); @@ -315,7 +315,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) cont->m_ver = pak.idVersion; u_int old_status = cont->m_status; cont->m_status = pak.idStatus; - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) { db_set_w(hContact,PROTONAME, "Status", cont->m_status); @@ -358,7 +358,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.idAckMessage) { - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) ProtoBroadcastAck(PROTONAME, hContact, pak.flIsUrl?ACKTYPE_URL:ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pak.idAckMessage, 0); } @@ -374,7 +374,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.idReqAwayMessage && cont) { - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false); // Removed - it causes that whoisreadingawaymessage plugin was not working // if (hContact) // { @@ -459,7 +459,7 @@ int CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr) bool TempAdd = flags&PALF_TEMPORARY; - HCONTACT contact = FindContact(addr, psr->hdr.nick, true, !TempAdd, !TempAdd, psr->stat); + MCONTACT contact = FindContact(addr, psr->hdr.nick, true, !TempAdd, !TempAdd, psr->stat); if (contact != NULL) { db_set_w(contact,PROTONAME,"Status", psr->stat ); db_set_w(contact,PROTONAME,"RemoteVersion", psr->ver ); @@ -568,7 +568,7 @@ void CMLan::SearchExt(TDataHolder* hold) void CMLan::SendMessageExt(TDataHolder* hold) { Sleep(0); - if (db_get_w((HCONTACT)hold->hContact, PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE) + if (db_get_w((MCONTACT)hold->hContact, PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE) { Sleep(20); ProtoBroadcastAck(PROTONAME, hold->hContact, (hold->op==LEXT_SENDURL)?ACKTYPE_URL:ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)hold->id, 0); @@ -577,7 +577,7 @@ void CMLan::SendMessageExt(TDataHolder* hold) { TPacket pak; ZeroMemory(&pak, sizeof(pak)); - u_long addr = db_get_dw((HCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); + u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); pak.strMessage = hold->msg; pak.idMessage = hold->id; if (hold->op==LEXT_SENDURL) @@ -594,7 +594,7 @@ void CMLan::GetAwayMsgExt(TDataHolder* hold) TPacket pak; ZeroMemory(&pak, sizeof(pak)); pak.idReqAwayMessage = hold->id; - u_long addr = db_get_dw((HCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); + u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); SendPacketExt(pak, addr); ProtoBroadcastAck(PROTONAME, hold->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SENTREQUEST, (HANDLE)hold->id, 0); diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h index 41bde7544b..71d4182dfa 100644 --- a/protocols/EmLanProto/src/mlan.h +++ b/protocols/EmLanProto/src/mlan.h @@ -30,7 +30,7 @@ public: long id; long op; - HCONTACT hContact; + MCONTACT hContact; char* const msg; CMLan* lan; @@ -101,7 +101,7 @@ private: CRITICAL_SECTION m_csAccessAwayMes; void RequestStatus(bool answer=false, u_long m_addr=INADDR_BROADCAST); - HCONTACT FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status = ID_STATUS_ONLINE); + MCONTACT FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status = ID_STATUS_ONLINE); void DeleteCache(); void StartChecking(); @@ -176,7 +176,7 @@ private: int m_cid; SOCKET m_socket; u_long m_addr; - HCONTACT m_hContact; + MCONTACT m_hContact; char* m_szDescription; char** m_szFiles; diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 8e3006a12a..358018219a 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -48,7 +48,7 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string * return false; } -void FacebookProto::CheckAvatarChange(HCONTACT hContact, std::string image_url) +void FacebookProto::CheckAvatarChange(MCONTACT hContact, std::string image_url) { // Facebook contacts always have some avatar - keep avatar in database even if we have loaded empty one (e.g. for 'On Mobile' contacts) if (image_url.empty()) diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 6a4884090c..52b998ca06 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -84,7 +84,7 @@ int FacebookProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_PRIVMESS: { char* sn = mir_t2a(hook->ptszUID); - HCONTACT hContact = ContactIDToHContact(sn); + MCONTACT hContact = ContactIDToHContact(sn); mir_free(sn); CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0); @@ -112,7 +112,7 @@ int FacebookProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_NICKLISTMENU: { char *sn = mir_t2a(hook->ptszUID); - HCONTACT hContact = ContactIDToHContact(sn); + MCONTACT hContact = ContactIDToHContact(sn); mir_free(sn); switch (hook->dwData) @@ -248,7 +248,7 @@ void FacebookProto::AddChat(const TCHAR *tid, const TCHAR *tname) INT_PTR FacebookProto::OnJoinChat(WPARAM wParam,LPARAM suppress) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // TODO: load info from server + old history,... diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 92333f3d1f..544fb3f066 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -1252,7 +1252,7 @@ bool facebook_client::send_message(std::string message_recipient, std::string me case 1356003: // Contact is offline { - HCONTACT hContact = parent->ContactIDToHContact(message_recipient); + MCONTACT hContact = parent->ContactIDToHContact(message_recipient); if (hContact != NULL) parent->setWord(hContact, "Status", ID_STATUS_OFFLINE); return false; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index fde9b8f678..84f30411a0 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -void FacebookProto::SaveName(HCONTACT hContact, const facebook_user *fbu) +void FacebookProto::SaveName(MCONTACT hContact, const facebook_user *fbu) { if (fbu->real_name.empty()) { delSetting(hContact, FACEBOOK_KEY_NICK); @@ -55,7 +55,7 @@ void FacebookProto::SaveName(HCONTACT hContact, const facebook_user *fbu) } } -bool FacebookProto::IsMyContact(HCONTACT hContact, bool include_chat) +bool FacebookProto::IsMyContact(MCONTACT hContact, bool include_chat) { const char *proto = GetContactProto(hContact); if (proto && !strcmp(m_szModuleName, proto)) { @@ -66,9 +66,9 @@ bool FacebookProto::IsMyContact(HCONTACT hContact, bool include_chat) return false; } -HCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) +MCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact, true)) continue; @@ -80,9 +80,9 @@ HCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) return 0; } -HCONTACT FacebookProto::ContactIDToHContact(std::string user_id) +MCONTACT FacebookProto::ContactIDToHContact(std::string user_id) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact)) continue; @@ -98,7 +98,7 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id) { std::string user_id; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact)) continue; @@ -138,9 +138,9 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id) return user_id; } -HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check) +MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check) { - HCONTACT hContact; + MCONTACT hContact; if (!dont_check) { // First, check if this contact exists @@ -150,7 +150,7 @@ HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b } // If not, make a new contact! - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if(hContact) { if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0) @@ -193,7 +193,7 @@ HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b void FacebookProto::SetAllContactStatuses(int status) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; @@ -228,7 +228,7 @@ void FacebookProto::DeleteContactFromServer(void *data) if (fbu != NULL) fbu->deleted = true; - HCONTACT hContact = ContactIDToHContact(id); + MCONTACT hContact = ContactIDToHContact(id); // If contact wasn't deleted from database if (hContact != NULL) { @@ -265,7 +265,7 @@ void FacebookProto::AddContactToServer(void *data) http::response resp = facy.flap(REQUEST_REQUEST_FRIEND, &query); if (resp.data.find("\"success\":true", 0) != std::string::npos) { - HCONTACT hContact = ContactIDToHContact(id); + MCONTACT hContact = ContactIDToHContact(id); // If contact wasn't deleted from database if (hContact != NULL) @@ -287,7 +287,7 @@ void FacebookProto::ApproveContactToServer(void *data) if (data == NULL) return; - HCONTACT hContact = *(HCONTACT*)data; + MCONTACT hContact = *(MCONTACT*)data; delete data; std::string post_data = "fb_dtsg=" + facy.dtsg_; @@ -310,7 +310,7 @@ void FacebookProto::CancelFriendsRequest(void *data) if (data == NULL) return; - HCONTACT hContact = *(HCONTACT*)data; + MCONTACT hContact = *(MCONTACT*)data; delete data; std::string query = "phstamp=0&confirmed=1"; @@ -370,7 +370,7 @@ void FacebookProto::SendPokeWorker(void *p) } -HANDLE FacebookProto::GetAwayMsg(HCONTACT hContact) +HANDLE FacebookProto::GetAwayMsg(MCONTACT hContact) { return 0; // Status messages are disabled } diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index e35c52f3b9..76b7f1a100 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -120,17 +120,17 @@ void RefreshPrivacy(HWND hwnd, post_status_data *data) SendDlgItemMessage(hwnd, IDC_PRIVACY, CB_SETCURSEL, data->proto->getByte(FACEBOOK_KEY_PRIVACY_TYPE, 0), 0); } -void ClistPrepare(FacebookProto *proto, HCONTACT hItem, HWND hwndList) +void ClistPrepare(FacebookProto *proto, MCONTACT hItem, HWND hwndList) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) ClistPrepare(proto, hItemT, hwndList); } @@ -143,14 +143,14 @@ void ClistPrepare(FacebookProto *proto, HCONTACT hItem, HWND hwndList) } } -void GetSelectedContacts(FacebookProto *proto, HCONTACT hItem, HWND hwndList, std::vector *contacts) +void GetSelectedContacts(FacebookProto *proto, MCONTACT hItem, HWND hwndList, std::vector *contacts) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) GetSelectedContacts(proto, hItemT, hwndList, contacts); } else { @@ -161,7 +161,7 @@ void GetSelectedContacts(FacebookProto *proto, HCONTACT hItem, HWND hwndList, st contacts->push_back(fu); } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } diff --git a/protocols/FacebookRM/src/entities.h b/protocols/FacebookRM/src/entities.h index 6909b6d611..14a62ef0eb 100644 --- a/protocols/FacebookRM/src/entities.h +++ b/protocols/FacebookRM/src/entities.h @@ -24,7 +24,7 @@ along with this program. If not, see . struct facebook_user { - HCONTACT handle; + MCONTACT handle; std::string user_id; std::string real_name; @@ -164,16 +164,16 @@ struct send_chat struct send_direct { - send_direct(HCONTACT hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {} - HCONTACT hContact; + send_direct(MCONTACT hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {} + MCONTACT hContact; std::string msg; HANDLE msgid; }; struct send_typing { - send_typing(HCONTACT hContact,const int status) : hContact(hContact), status(status) {} - HCONTACT hContact; + send_typing(MCONTACT hContact,const int status) : hContact(hContact), status(status) {} + MCONTACT hContact; int status; }; diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp index 81c54f3fd8..19a9c68701 100644 --- a/protocols/FacebookRM/src/events.cpp +++ b/protocols/FacebookRM/src/events.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, std::string *url, std::string *notification_id) +void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url, std::string *notification_id) { char name[256]; diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 7fdbcbe2a8..8add178e11 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -424,7 +424,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa participant = chatroom->second.participants.find(reader_id); if (participant != chatroom->second.participants.end()) { - HCONTACT hChatContact = proto->ChatIDToHContact(tid); + MCONTACT hChatContact = proto->ChatIDToHContact(tid); const char *participant_name = participant->second.c_str(); if (!chatroom->second.message_readers.empty()) @@ -438,7 +438,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa } } } else { // classic contact - HCONTACT hContact = proto->ContactIDToHContact(json_as_pstring(reader)); + MCONTACT hContact = proto->ContactIDToHContact(json_as_pstring(reader)); if (hContact) { TCHAR ttime[64], tstr[100]; _tcsftime(ttime, SIZEOF(ttime), _T("%X"), utils::conversion::fbtime_to_timeinfo(json_as_float(time))); @@ -519,7 +519,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa } } - HCONTACT hChatContact = NULL; + MCONTACT hChatContact = NULL; // RM TODO: better use check if chatroom exists/is in db/is online... no? /// e.g. HANDLE hChatContact = proto->ChatIDToHContact(thread_id); ? @@ -627,7 +627,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa facebook_user fbu; fbu.user_id = json_as_pstring(from); - HCONTACT hContact = proto->AddToContactList(&fbu, CONTACT_FRIEND); + MCONTACT hContact = proto->AddToContactList(&fbu, CONTACT_FRIEND); if (proto->isOnline() && proto->getWord(hContact, "Status", 0) == ID_STATUS_OFFLINE) proto->setWord(hContact, "Status", ID_STATUS_ONLINE); diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 0efbe5ea1c..fd09bfa507 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -int FacebookProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int FacebookProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { ForkThread(&FacebookProto::ReadMessageWorker, (void*)hContact); CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF); @@ -74,7 +74,7 @@ void FacebookProto::SendChatMsgWorker(void *p) send_chat *data = static_cast(p); std::string err_message = ""; - HCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str()))); + MCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str()))); if (hContact) { std::string tid; DBVARIANT dbv; @@ -105,7 +105,7 @@ void FacebookProto::SendChatMsgWorker(void *p) delete data; } -int FacebookProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int FacebookProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { // TODO: msg comes as Unicode (retyped wchar_t*), why should we convert it as ANSI to UTF-8? o_O if (flags & PREF_UNICODE) @@ -116,7 +116,7 @@ int FacebookProto::SendMsg(HCONTACT hContact, int flags, const char *msg) return facy.msgid_; } -int FacebookProto::UserIsTyping(HCONTACT hContact,int type) +int FacebookProto::UserIsTyping(MCONTACT hContact,int type) { if (hContact && isOnline()) ForkThread(&FacebookProto::SendTypingWorker, new send_typing(hContact, type)); @@ -166,7 +166,7 @@ void FacebookProto::ReadMessageWorker(void *p) if (p == NULL) return; - HCONTACT hContact = (HCONTACT)p; + MCONTACT hContact = (MCONTACT)p; if (getBool(FACEBOOK_KEY_KEEP_UNREAD, 0) || getBool(hContact, FACEBOOK_KEY_KEEP_UNREAD, 0)) return; @@ -184,7 +184,7 @@ void FacebookProto::ReadMessageWorker(void *p) facy.flap(REQUEST_MARK_READ, &data); } -void FacebookProto::ParseSmileys(std::string message, HCONTACT hContact) +void FacebookProto::ParseSmileys(std::string message, MCONTACT hContact) { if (!getByte(FACEBOOK_KEY_CUSTOM_SMILEYS, DEFAULT_CUSTOM_SMILEYS)) return; diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 4e0531996a..81db47063d 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -63,7 +63,7 @@ void FacebookProto::ProcessBuddyList(void* data) if (!fbu->deleted) { - HCONTACT hContact = fbu->handle; + MCONTACT hContact = fbu->handle; if (!hContact) hContact = AddToContactList(fbu, CONTACT_FRIEND); @@ -154,7 +154,7 @@ void FacebookProto::ProcessFriendList(void* data) // Check and update old contacts - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if ( isChatRoom(hContact)) continue; @@ -243,7 +243,7 @@ void FacebookProto::ProcessFriendList(void* data) facebook_user *fbu = iter->second; if (!fbu->deleted) - HCONTACT hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now + MCONTACT hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now delete fbu; } @@ -361,7 +361,7 @@ void FacebookProto::ProcessUnreadMessage(void *p) for (std::map::iterator it = chatrooms.begin(); it != chatrooms.end(); ) { facebook_chatroom *room = it->second; - HCONTACT hChatContact = NULL; + MCONTACT hChatContact = NULL; if (GetChatUsers(room->thread_id.c_str()) == NULL) { AddChat(room->thread_id.c_str(), room->chat_name.c_str()); hChatContact = ChatIDToHContact(room->thread_id); @@ -397,7 +397,7 @@ void FacebookProto::ProcessUnreadMessage(void *p) fbu.real_name = messages[i]->sender_name; // TODO: optimize this? - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); setString(hContact, FACEBOOK_KEY_MESSAGE_ID, messages[i]->message_id.c_str()); // Save TID if not exists already @@ -486,7 +486,7 @@ void FacebookProto::ProcessMessages(void* data) fbu.user_id = messages[i]->user_id; fbu.real_name = messages[i]->sender_name; - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); setString(hContact, FACEBOOK_KEY_MESSAGE_ID, messages[i]->message_id.c_str()); // Save TID if not exists already @@ -627,7 +627,7 @@ void FacebookProto::ProcessFriendRequests(void*) if (fbu->user_id.length() && fbu->real_name.length()) { - HCONTACT hContact = AddToContactList(fbu, CONTACT_APPROVE); + MCONTACT hContact = AddToContactList(fbu, CONTACT_APPROVE); setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_APPROVE); bool seen = false; diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index ea869c4830..7346774879 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -104,7 +104,7 @@ FacebookProto::~FacebookProto() ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR FacebookProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT hContact) { switch(type) { @@ -238,7 +238,7 @@ HANDLE FacebookProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* first return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs) } -HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { ptrA id( mir_t2a_cp(psr->id, CP_UTF8)); ptrA name( mir_t2a_cp(psr->firstName, CP_UTF8)); @@ -261,7 +261,7 @@ HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return NULL; } - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); if (hContact) { if (flags & PALF_TEMPORARY) { db_set_b(hContact, "Clist", "Hidden", 1); @@ -276,7 +276,7 @@ HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return hContact; } -int FacebookProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message) +int FacebookProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) { return RequestFriendship((WPARAM)hContact, NULL); } @@ -286,8 +286,8 @@ int FacebookProto::Authorize(HANDLE hDbEvent) if (!hDbEvent || isOffline()) return 1; - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; return ApproveFriendship((WPARAM)hContact, NULL); @@ -298,8 +298,8 @@ int FacebookProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason) if (!hDbEvent || isOffline()) return 1; - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; // TODO: hide from facebook requests list @@ -450,7 +450,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM lParam) if (!isOnline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); wall_data *wall = new wall_data(); wall->user_id = ptrA(getStringA(hContact, FACEBOOK_KEY_ID)); @@ -504,7 +504,7 @@ INT_PTR FacebookProto::RefreshBuddyList(WPARAM, LPARAM) INT_PTR FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); std::string url = FACEBOOK_URL_PROFILE; @@ -527,7 +527,7 @@ INT_PTR FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) INT_PTR FacebookProto::VisitFriendship(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); if (wParam == 0 || !IsMyContact(hContact)) return 1; @@ -547,7 +547,7 @@ INT_PTR FacebookProto::Poke(WPARAM wParam,LPARAM lParam) if (wParam == NULL || isOffline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) @@ -564,7 +564,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) bool deleting = (lParam == 1); - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); // Ignore groupchats and, if deleting, also not-friends if (isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND)) @@ -601,7 +601,7 @@ INT_PTR FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam) if (wParam == NULL || isOffline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) @@ -633,7 +633,7 @@ INT_PTR FacebookProto::OnCancelFriendshipRequest(WPARAM wParam,LPARAM lParam) return 0; } -HCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) +MCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) { DWORD body[2]; DBEVENTINFO dbei = { sizeof(dbei) }; @@ -641,13 +641,13 @@ HCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body; if (db_event_get(hEvent, &dbei)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (strcmp(dbei.szModule, m_szModuleName)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; return DbGetAuthEventContact(&dbei); } diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index b271f62c8a..27c29883ca 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -54,31 +54,31 @@ public: __forceinline INT_PTR getStringUtf(const char *name, DBVARIANT *result) { return db_get_utf(NULL, m_szModuleName, name, result); } - __forceinline INT_PTR getStringUtf(HCONTACT hContact, const char *name, DBVARIANT *result) { + __forceinline INT_PTR getStringUtf(MCONTACT hContact, const char *name, DBVARIANT *result) { return db_get_utf(hContact, m_szModuleName, name, result); } __forceinline void setStringUtf(const char *name, const char* value) { db_set_utf(NULL, m_szModuleName, name, value); } - __forceinline void setStringUtf(HCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } + __forceinline void setStringUtf(MCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } //PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - 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 HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email); @@ -86,24 +86,24 @@ public: virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); @@ -185,13 +185,13 @@ public: void __cdecl SendPokeWorker(void*); // Contacts handling - bool IsMyContact(HCONTACT, bool include_chat = false); - HCONTACT ContactIDToHContact(std::string); - HCONTACT ChatIDToHContact(std::tstring); + bool IsMyContact(MCONTACT, bool include_chat = false); + MCONTACT ContactIDToHContact(std::string); + MCONTACT ChatIDToHContact(std::tstring); std::string ThreadIDToContactID(std::string thread_id); - HCONTACT AddToContactList(facebook_user*, ContactType type, bool dont_check = false); + MCONTACT AddToContactList(facebook_user*, ContactType type, bool dont_check = false); void SetAllContactStatuses(int status); - HCONTACT HContactFromAuthEvent(HANDLE hEvent); + MCONTACT HContactFromAuthEvent(HANDLE hEvent); // Chats handling void AddChat(const TCHAR *id, const TCHAR *name); @@ -209,11 +209,11 @@ public: // Helpers std::tstring GetAvatarFolder(); bool GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string *url); - void CheckAvatarChange(HCONTACT hContact, std::string image_url); + void CheckAvatarChange(MCONTACT hContact, std::string image_url); void ToggleStatusMenuItems(BOOL bEnable); - void ParseSmileys(std::string message, HCONTACT hContact); + void ParseSmileys(std::string message, MCONTACT hContact); void OpenUrl(std::string url); - void SaveName(HCONTACT hContact, const facebook_user *fbu); + void SaveName(MCONTACT hContact, const facebook_user *fbu); // Handles, Locks HGENMENU m_hMenuRoot, m_hMenuServicesRoot, m_hStatusMind; @@ -227,10 +227,10 @@ public: std::string last_status_msg_; HANDLE hSmileysFolder_; - std::vector avatar_queue; + std::vector avatar_queue; static void CALLBACK APC_callback(ULONG_PTR p); // Information providing - void NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL); + void NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL); }; diff --git a/protocols/FacebookRM/src/stubs.cpp b/protocols/FacebookRM/src/stubs.cpp index eb086a2fa8..8329a78980 100644 --- a/protocols/FacebookRM/src/stubs.cpp +++ b/protocols/FacebookRM/src/stubs.cpp @@ -22,12 +22,12 @@ along with this program. If not, see . #include "common.h" -HCONTACT FacebookProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT FacebookProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) { return NULL; } -int FacebookProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::AuthRecv(MCONTACT hContact,PROTORECVEVENT *) { return 1; } @@ -38,17 +38,17 @@ HANDLE FacebookProto::ChangeInfo(int type,void *info_data) return NULL; } -HANDLE FacebookProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) +HANDLE FacebookProto::FileAllow(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) { return NULL; } -int FacebookProto::FileCancel(HCONTACT hContact,HANDLE hTransfer) +int FacebookProto::FileCancel(MCONTACT hContact,HANDLE hTransfer) { return 1; } -int FacebookProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) +int FacebookProto::FileDeny(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) { return 1; } @@ -58,7 +58,7 @@ int FacebookProto::FileResume(HANDLE hTransfer,int *action,const PROTOCHAR **fil return 1; } -int FacebookProto::GetInfo(HCONTACT hContact, int infoType) +int FacebookProto::GetInfo(MCONTACT hContact, int infoType) { // TODO: Most probably some ProtoAck should be here instead return 1; @@ -74,42 +74,42 @@ HWND FacebookProto::CreateExtendedSearchUI(HWND owner) return NULL; } -int FacebookProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::RecvContacts(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int FacebookProto::RecvFile(HCONTACT hContact,PROTORECVFILET *) +int FacebookProto::RecvFile(MCONTACT hContact,PROTORECVFILET *) { return 1; } -int FacebookProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::RecvUrl(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int FacebookProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int FacebookProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } -HANDLE FacebookProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) +HANDLE FacebookProto::SendFile(MCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) { return NULL; } -int FacebookProto::SendUrl(HCONTACT hContact,int flags,const char *url) +int FacebookProto::SendUrl(MCONTACT hContact,int flags,const char *url) { return 1; } -int FacebookProto::SetApparentMode(HCONTACT hContact,int mode) +int FacebookProto::SetApparentMode(MCONTACT hContact,int mode) { return 1; } -int FacebookProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt) +int FacebookProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) { return 1; } diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 61025d53d3..f9e60078ee 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -53,7 +53,7 @@ HANDLE GetIconHandle(const char* name) HGENMENU g_hContactMenuItems[CMITEMS_COUNT]; // Helper functions -static FacebookProto * GetInstanceByHContact(HCONTACT hContact) +static FacebookProto * GetInstanceByHContact(MCONTACT hContact) { char *proto = GetContactProto(hContact); if(!proto) @@ -69,7 +69,7 @@ static FacebookProto * GetInstanceByHContact(HCONTACT hContact) template INT_PTR GlobalService(WPARAM wParam,LPARAM lParam) { - FacebookProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + FacebookProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? (proto->*Fcn)(wParam,lParam) : 0; } @@ -78,7 +78,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) for (size_t i=0; iOnPrebuildContactMenu(wParam,lParam) : 0; } @@ -152,7 +152,7 @@ void UninitContactMenus() int FacebookProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); bool bIsChatroom = isChatRoom(hContact); Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_PROFILE], true); diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 744b990e96..db6d5af883 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -84,7 +84,7 @@ BOOL SaveAvatar(HANDLE hFile) struct AVACHANGED { HANDLE hTimer; - HCONTACT hContact; + MCONTACT hContact; }; VOID CALLBACK CallSetAvatar(PVOID lpParameter, BOOLEAN TimerOrWaitFired) @@ -107,11 +107,11 @@ VOID CALLBACK CallSetAvatar(PVOID lpParameter, BOOLEAN TimerOrWaitFired) int AvaChanged(WPARAM wParam, LPARAM lParam) { - if (!lParam && db_get_b((HCONTACT)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { + if (!lParam && db_get_b((MCONTACT)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { BOOL enqueued = FALSE; AVACHANGED *ach = (AVACHANGED*)malloc(sizeof(AVACHANGED)); __try { - ach->hContact = (HCONTACT)wParam; + ach->hContact = (MCONTACT)wParam; enqueued = CreateTimerQueueTimer(&ach->hTimer, NULL, CallSetAvatar, ach, SET_AVATAR_INTERVAL, 0, WT_EXECUTEONLYONCE); } __finally { @@ -146,7 +146,7 @@ BOOL InitAvaUnit(BOOL init) } } -void SetAvatar(HCONTACT hContact) +void SetAvatar(MCONTACT hContact) { mir_cslock lck(g_csSetAvatar); diff --git a/protocols/GTalkExt/src/db.cpp b/protocols/GTalkExt/src/db.cpp index 661bce4409..bbda342b2b 100644 --- a/protocols/GTalkExt/src/db.cpp +++ b/protocols/GTalkExt/src/db.cpp @@ -42,7 +42,7 @@ void RenewPseudocontactHandles() db_unset(0, protos[i]->szModuleName, "GMailExtNotifyContact"); // remove this } - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { LPCSTR proto = (LPCSTR)GetContactProto(hContact); db_set_dw(NULL, proto, PSEUDOCONTACT_LINK, (DWORD)hContact); diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 087a38e2aa..6c35356762 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -426,7 +426,7 @@ int OnExtListInit(WPARAM wParam, LPARAM lParam) int OnFilterPopup(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if ( !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) return 0; diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index 4e66154ac0..f9dc9e9111 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -42,7 +42,7 @@ struct POPUP_DATA_HEADER { BOOL MarkRead; HANDLE hDbEvent; - HCONTACT hContact; + MCONTACT hContact; LPTSTR jid; LPTSTR url; }; @@ -65,7 +65,7 @@ LPCSTR GetJidAcc(LPCTSTR jid) return NULL; } -void MarkEventRead(HCONTACT hCnt, HANDLE hEvt) +void MarkEventRead(MCONTACT hCnt, HANDLE hEvt) { DWORD settings = (DWORD)TlsGetValue(itlsSettings); if ( ReadCheckbox(0, IDC_POPUPSENABLED, settings) && @@ -77,7 +77,7 @@ void MarkEventRead(HCONTACT hCnt, HANDLE hEvt) int OnEventDeleted(WPARAM hContact, LPARAM hDbEvent, LPARAM wnd) { - if (db_get_b((HCONTACT)hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { + if (db_get_b((MCONTACT)hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { CallService(MS_CLIST_REMOVEEVENT, hContact, hDbEvent); PostMessage((HWND)wnd, EVENT_DELETED_MSG, hContact, hDbEvent); } @@ -166,11 +166,11 @@ void FormatPseudocontactDisplayName(LPTSTR buff, LPCTSTR jid, LPCTSTR unreadCoun wsprintf(buff, _T("%s"), jid); //!!!!!!!!!!! } -HCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName) +MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName) { - HCONTACT result = (HCONTACT)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); + MCONTACT result = (MCONTACT)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); if (!result || !db_get_b(result, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { - result = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + result = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); db_set_dw(0, acc, PSEUDOCONTACT_LINK, (DWORD)result); db_set_b(result, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 1); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)result, (LPARAM)acc); @@ -191,7 +191,7 @@ HCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST return result; } -HANDLE AddCListNotification(HCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount) +HANDLE AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount) { mir_ptr szUrl( mir_utf8encodeT(url)), szText( mir_utf8encodeT(data->lptzText)); @@ -216,7 +216,7 @@ BOOL UsePopups() void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount) { - HCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]); + MCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]); HANDLE hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (DWORD)TlsGetValue(itlsSettings)) ? AddCListNotification(hCnt, acc, data, jid, url, unreadCount) : NULL; @@ -287,7 +287,7 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre void ClearNotificationContactHistory(LPCSTR acc) { - HCONTACT hContact = (HCONTACT)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); + MCONTACT hContact = (MCONTACT)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); if (!hContact || !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) return; diff --git a/protocols/GTalkExt/src/notifications.h b/protocols/GTalkExt/src/notifications.h index 43de74607d..c9cf4684af 100644 --- a/protocols/GTalkExt/src/notifications.h +++ b/protocols/GTalkExt/src/notifications.h @@ -40,5 +40,5 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount, const MAIL_THREAD_NOTIFICATION *mtn); void CloseNotifications(LPCSTR acc, LPCTSTR url, LPCTSTR jid, BOOL PopupsOnly); DWORD ReadNotificationSettings(LPCSTR acc); -HCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName = NULL); +MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName = NULL); LPCSTR GetJidAcc(LPCTSTR jid); \ No newline at end of file diff --git a/protocols/GTalkExt/src/stdafx.h b/protocols/GTalkExt/src/stdafx.h index fd47c8a964..163db4c0c4 100644 --- a/protocols/GTalkExt/src/stdafx.h +++ b/protocols/GTalkExt/src/stdafx.h @@ -72,5 +72,5 @@ extern HINSTANCE g_hInst; extern LIST g_accs; -void SetAvatar(HCONTACT hContact); +void SetAvatar(MCONTACT hContact); BOOL InitAvaUnit(BOOL init); diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 6cadef414a..3072de1898 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -26,7 +26,7 @@ ////////////////////////////////////////////////////////// // Avatars support -void GGPROTO::getAvatarFilename(HCONTACT hContact, TCHAR *pszDest, int cbLen) +void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName); @@ -142,7 +142,7 @@ char *gg_avatarhash(char *param) return bin2hex(digest, sizeof(digest), result); } -void GGPROTO::requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL) +void GGPROTO::requestAvatarTransfer(MCONTACT hContact, char *szAvatarURL) { if (pth_avatar.dwThreadId == NULL) { debugLogA("requestAvatarTransfer(): Can not list_add element to avatar_transfers list. No pth_avatar.dwThreadId"); @@ -159,7 +159,7 @@ void GGPROTO::requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL) gg_LeaveCriticalSection(&avatar_mutex, "requestAvatarTransfer", 1, 1, "avatar_mutex", 1); } -void GGPROTO::requestAvatarInfo(HCONTACT hContact, int iWaitFor) +void GGPROTO::requestAvatarInfo(MCONTACT hContact, int iWaitFor) { if (pth_avatar.dwThreadId == NULL) { debugLogA("requestAvatarInfo(): Can not list_add element to avatar_requests list. No pth_avatar.dwThreadId"); @@ -192,7 +192,7 @@ void __cdecl GGPROTO::avatarrequestthread(void*) if (avatar_requests.getCount()) { GGREQUESTAVATARDATA *data = avatar_requests[0]; int iWaitFor = data->iWaitFor; - HCONTACT hContact = data->hContact; + MCONTACT hContact = data->hContact; avatar_requests.remove(0); mir_free(data); gg_LeaveCriticalSection(&avatar_mutex, "avatarrequestthread", 3, 1, "avatar_mutex", 1); diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 2c210c57a7..c6983d0665 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -628,7 +628,7 @@ retry: const char *__status = gg_pubdir50_get(res, i, GG_PUBDIR50_STATUS); uin_t uin = __fmnumber ? atoi(__fmnumber) : 0; - HCONTACT hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, NULL); + MCONTACT hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, NULL); debugLogA("mainthread() (%x): Search result for uin %d, seq %d.", this, uin, res->seq); if (res->seq == GG_SEQ_SEARCH) { @@ -766,7 +766,7 @@ retry: // Status (version >= 6.0) case GG_EVENT_STATUS60: { - HCONTACT hContact = getcontact(e->event.status60.uin, 0, 0, NULL); + MCONTACT hContact = getcontact(e->event.status60.uin, 0, 0, NULL); int oldstatus = getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE); uin_t uin = (uin_t)getDword(GG_KEY_UIN, 0); @@ -991,7 +991,7 @@ retry: // Get rid of empty image if (e->event.image_reply.size && e->event.image_reply.image) { - HCONTACT hContact = getcontact(e->event.image_reply.sender, 1, 0, NULL); + MCONTACT hContact = getcontact(e->event.image_reply.sender, 1, 0, NULL); void *img = (void *)img_loadpicture(e, 0); if (!img) @@ -1064,7 +1064,7 @@ retry: pre.tszDescription = filenameT; pre.ptszFiles = &filenameT; pre.lParam = (LPARAM)dcc7; - ProtoChainRecvFile((HCONTACT)dcc7->contact, &pre); + ProtoChainRecvFile((MCONTACT)dcc7->contact, &pre); mir_free(filenameT); e->event.dcc7_new = NULL; @@ -1078,7 +1078,7 @@ retry: if (dcc7->type == GG_SESSION_DCC7_SEND) { debugLogA("mainthread() (%x): File transfer denied by client %d (reason = %d).", this, dcc7->peer_uin, e->event.dcc7_reject.reason); - ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0); + ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0); // Remove from watches and free gg_EnterCriticalSection(&ft_mutex, "mainthread", 21, "ft_mutex", 1); @@ -1139,7 +1139,7 @@ retry: } if (dcc7->contact) - ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); + ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); // Free dcc gg_dcc7_free(dcc7); @@ -1186,7 +1186,7 @@ retry: case GG_EVENT_TYPING_NOTIFICATION: { - HCONTACT hContact = getcontact(e->event.typing_notification.uin, 0, 0, NULL); + MCONTACT hContact = getcontact(e->event.typing_notification.uin, 0, 0, NULL); #ifdef DEBUGMODE debugLogA("mainthread() (%x): Typing notification from %d (%d).", this, e->event.typing_notification.uin, e->event.typing_notification.length); @@ -1272,7 +1272,7 @@ void GGPROTO::broadcastnewstatus(int newStatus) // When contact is deleted int GGPROTO::contactdeleted(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0); // Terminate conference if contact is deleted @@ -1327,7 +1327,7 @@ static TCHAR* sttSettingToTchar( DBVARIANT* value ) int GGPROTO::dbsettingchanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char *szProto = NULL; debugLogA("dbsettingchanged(): fired. szModule=%s szSetting=%s", cws->szModule, cws->szSetting); @@ -1411,7 +1411,7 @@ void GGPROTO::setalloffline() debugLogA("setalloffline(): started. Setting buddies offline"); setWord(GG_KEY_STATUS, ID_STATUS_OFFLINE); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE); // Clear IP and port settings delSetting(hContact, GG_KEY_CLIENTIP); @@ -1427,7 +1427,7 @@ void GGPROTO::setalloffline() //////////////////////////////////////////////////////////// // All users set offline -void GGPROTO::notifyuser(HCONTACT hContact, int refresh) +void GGPROTO::notifyuser(MCONTACT hContact, int refresh) { uin_t uin; if (!hContact) return; @@ -1469,7 +1469,7 @@ void GGPROTO::notifyuser(HCONTACT hContact, int refresh) void GGPROTO::notifyall() { - HCONTACT hContact; + MCONTACT hContact; int count = 0, cc = 0; uin_t *uins; char *types; @@ -1522,13 +1522,13 @@ void GGPROTO::notifyall() //////////////////////////////////////////////////////////// // Get contact by uin -HCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) +MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) { #ifdef DEBUGMODE debugLogA("getcontact(): uin=%d create=%d inlist=%d", uin, create, inlist); #endif // Look for contact in DB - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) { if (inlist) { db_unset(hContact, "CList", "NotOnList"); @@ -1540,7 +1540,7 @@ HCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) if (!create) return NULL; - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (!hContact) { debugLog(_T("getcontact(): Failed to create Gadu-Gadu contact %s"), szNick); return NULL; @@ -1698,7 +1698,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in #ifdef DEBUGMODE debugLogA("changecontactstatus(): uin=%d status=%d", uin, status); #endif - HCONTACT hContact = getcontact(uin, 0, 0, NULL); + MCONTACT hContact = getcontact(uin, 0, 0, NULL); // Check if contact is on list if (!hContact) return; diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index e0f39d35dc..b4745e0b8e 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -38,7 +38,7 @@ extern INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam #define SVS_TIMEZONE 7 #define SVS_GGVERSION 9 -static void SetValue(HWND hwndDlg, int idCtrl, HCONTACT hContact, char *szModule, char *szSetting, int special, int disableIfUndef) +static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special, int disableIfUndef) { DBVARIANT dbv = {0}; TCHAR str[256]; @@ -688,7 +688,7 @@ static INT_PTR CALLBACK gg_advoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, struct GGDETAILSDLGDATA { GGPROTO *gg; - HCONTACT hContact; + MCONTACT hContact; int disableUpdate; int updating; }; @@ -704,7 +704,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, TranslateDialogDefault(hwndDlg); dat = (struct GGDETAILSDLGDATA *)mir_alloc(sizeof(struct GGDETAILSDLGDATA)); - dat->hContact = (HCONTACT)lParam; + dat->hContact = (MCONTACT)lParam; dat->disableUpdate = FALSE; dat->updating = FALSE; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); @@ -728,7 +728,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, case PSN_INFOCHANGED: { char *szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; GGPROTO *gg = dat->gg; // Show updated message @@ -902,7 +902,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, int GGPROTO::details_init(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; char* pszTemplate; if (hContact == NULL){ diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 14d4f6bd62..4426f3c9eb 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -60,7 +60,7 @@ void GGPROTO::dccstart() void GGPROTO::dccconnect(uin_t uin) { struct gg_dcc *local_dcc; - HCONTACT hContact = getcontact(uin, 0, 0, NULL); + MCONTACT hContact = getcontact(uin, 0, 0, NULL); DWORD ip, myuin; WORD port; debugLogA("dccconnect(): Connecting to uin %d.", uin); @@ -89,7 +89,7 @@ void GGPROTO::dccconnect(uin_t uin) // THREAD: File transfer fail struct ftfaildata { - HCONTACT hContact; + MCONTACT hContact; HANDLE hProcess; }; @@ -103,7 +103,7 @@ void __cdecl GGPROTO::ftfailthread(void *param) debugLogA("ftfailthread(): end."); } -HANDLE ftfail(GGPROTO *gg, HCONTACT hContact) +HANDLE ftfail(GGPROTO *gg, MCONTACT hContact) { ftfaildata *ft = (ftfaildata*)malloc(sizeof(struct ftfaildata)); #ifdef DEBUGMODE @@ -273,7 +273,7 @@ void __cdecl GGPROTO::dccmainthread(void*) strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename)); memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS)); pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS); - pfts.hContact = (HCONTACT)local_dcc->contact; + pfts.hContact = (MCONTACT)local_dcc->contact; pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND); pfts.pszFiles = NULL; pfts.totalFiles = 1; @@ -286,7 +286,7 @@ void __cdecl GGPROTO::dccmainthread(void*) pfts.currentFileProgress = local_dcc->offset; pfts.currentFileTime = 0; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 3, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts); + ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } break; @@ -304,7 +304,7 @@ void __cdecl GGPROTO::dccmainthread(void*) strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename)); memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS)); pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS); - pfts.hContact = (HCONTACT)local_dcc->contact; + pfts.hContact = (MCONTACT)local_dcc->contact; pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND); pfts.pszFiles = NULL; pfts.totalFiles = 1; @@ -317,11 +317,11 @@ void __cdecl GGPROTO::dccmainthread(void*) pfts.currentFileProgress = local_dcc->file_info.size; pfts.currentFileTime = 0; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 4, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts); + ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); _close(local_dcc->file_fd); local_dcc->file_fd = -1; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 5, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0); + ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } // Free dcc @@ -361,7 +361,7 @@ void __cdecl GGPROTO::dccmainthread(void*) { _close(local_dcc->file_fd); local_dcc->file_fd = -1; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 6, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0); + ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } // Free dcc @@ -393,7 +393,7 @@ void __cdecl GGPROTO::dccmainthread(void*) pre.lParam = (LPARAM)local_dcc; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1); - ProtoChainRecvFile((HCONTACT)local_dcc->contact, &pre); + ProtoChainRecvFile((MCONTACT)local_dcc->contact, &pre); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); mir_free(filenameT); @@ -503,7 +503,7 @@ void __cdecl GGPROTO::dccmainthread(void*) strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename)); memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS)); pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS); - pfts.hContact = (HCONTACT)local_dcc7->contact; + pfts.hContact = (MCONTACT)local_dcc7->contact; pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND); pfts.pszFiles = NULL; pfts.totalFiles = 1; @@ -516,7 +516,7 @@ void __cdecl GGPROTO::dccmainthread(void*) pfts.currentFileProgress = local_dcc7->offset; pfts.currentFileTime = 0; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 9, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts); + ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } break; @@ -534,7 +534,7 @@ void __cdecl GGPROTO::dccmainthread(void*) strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename)); memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS)); pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS); - pfts.hContact = (HCONTACT)local_dcc7->contact; + pfts.hContact = (MCONTACT)local_dcc7->contact; pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND); pfts.pszFiles = NULL; pfts.totalFiles = 1; @@ -547,11 +547,11 @@ void __cdecl GGPROTO::dccmainthread(void*) pfts.currentFileProgress = local_dcc7->size; pfts.currentFileTime = 0; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 10, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts); + ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); _close(local_dcc7->file_fd); local_dcc7->file_fd = -1; gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 11, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0); + ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } // Free dcc @@ -595,7 +595,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->contact) { gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 12, "ft_mutex", 1); - ProtoBroadcastAck((HCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0); + ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0); gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1); } @@ -684,7 +684,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath) TCHAR error[512]; mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath); showpopup(m_tszUserName, error, GG_POPUP_ERROR); - ProtoBroadcastAck((HCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0); + ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0); // Free transfer gg_free_dcc(dcc); return 0; @@ -722,7 +722,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) if (iFtRemoveRes == -1) { debugLogA("dcc7fileallow(): File transfer denied."); - ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0); + ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0); // Free transfer gg_dcc7_free(dcc7); return 0; @@ -736,7 +736,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath); showpopup(m_tszUserName, error, GG_POPUP_ERROR); gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER); - ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); + ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); // Free transfer gg_dcc7_free(dcc7); return 0; @@ -807,7 +807,7 @@ int GGPROTO::dccfilecancel(HANDLE hTransfer) gg_LeaveCriticalSection(&ft_mutex, "dccfilecancel", 44, 1, "ft_mutex", 1); // Send failed info - ProtoBroadcastAck((HCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0); + ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0); // Close file if (dcc->file_fd != -1) { @@ -837,7 +837,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer) gg_LeaveCriticalSection(&ft_mutex, "dcc7filecancel", 45, 1, "ft_mutex", 1); // Send failed info - ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); + ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0); // Close file if (dcc7->file_fd != -1) { @@ -856,7 +856,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer) //////////////////////////////////////////////////////////// // File receiving allowed -HANDLE GGPROTO::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE GGPROTO::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { // Check if its proper dcc struct gg_common *c = (struct gg_common *) hTransfer; @@ -872,7 +872,7 @@ HANDLE GGPROTO::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* //////////////////////////////////////////////////////////// // File transfer canceled -int GGPROTO::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int GGPROTO::FileCancel(MCONTACT hContact, HANDLE hTransfer) { // Check if its proper dcc struct gg_common *c = (struct gg_common *) hTransfer; @@ -888,7 +888,7 @@ int GGPROTO::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////// // File receiving denied -int GGPROTO::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) +int GGPROTO::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) { // Check if its proper dcc struct gg_common *c = (struct gg_common *) hTransfer; @@ -904,7 +904,7 @@ int GGPROTO::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szRe //////////////////////////////////////////////////////////// // Called when received an file -int GGPROTO::RecvFile(HCONTACT hContact, PROTOFILEEVENT* pre) +int GGPROTO::RecvFile(MCONTACT hContact, PROTOFILEEVENT* pre) { return Proto_RecvFile(hContact, pre); } @@ -912,7 +912,7 @@ int GGPROTO::RecvFile(HCONTACT hContact, PROTOFILEEVENT* pre) //////////////////////////////////////////////////////////// // Called when user sends a file -HANDLE GGPROTO::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) +HANDLE GGPROTO::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { char *bslash, *filename; struct gg_dcc *dcc; diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 2945c3c96c..e340b6703b 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -196,7 +196,7 @@ static int gg_modulesloaded(WPARAM wParam, LPARAM lParam) ////////////////////////////////////////////////////////// // Gets protocol instance associated with a contact -static GGPROTO* gg_getprotoinstance(HCONTACT hContact) +static GGPROTO* gg_getprotoinstance(MCONTACT hContact) { char* szProto = GetContactProto(hContact); if (szProto == NULL) @@ -213,7 +213,7 @@ static GGPROTO* gg_getprotoinstance(HCONTACT hContact) // Handles PrebuildContactMenu event static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam) { - const HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)wParam; GGPROTO* gg = gg_getprotoinstance(hContact); if (gg == NULL) return 0; @@ -232,7 +232,7 @@ static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam) // Contact block service function INT_PTR GGPROTO::blockuser(WPARAM wParam, LPARAM lParam) { - const HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)wParam; setByte(hContact, GG_KEY_BLOCK, !getByte(hContact, GG_KEY_BLOCK, 0)); notifyuser(hContact, 1); return 0; diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index d5babd7e52..9240ef7e09 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -122,13 +122,13 @@ typedef struct struct GGREQUESTAVATARDATA { - HCONTACT hContact; + MCONTACT hContact; int iWaitFor; }; struct GGGETAVATARDATA { - HCONTACT hContact; + MCONTACT hContact; char *szAvatarURL; }; diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 1d8e211195..b6f55e0db7 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -124,24 +124,24 @@ GGPROTO::~GGPROTO() ////////////////////////////////////////////////////////// // Dummies for function that have to be implemented -HCONTACT GGPROTO::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } +MCONTACT GGPROTO::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } int GGPROTO::Authorize(HANDLE hDbEvent) { return 1; } int GGPROTO::AuthDeny(HANDLE hDbEvent, const TCHAR *szReason) { return 1; } -int GGPROTO::AuthRecv(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; } -int GGPROTO::AuthRequest(HCONTACT hContact, const TCHAR *szMessage) { return 1; } +int GGPROTO::AuthRecv(MCONTACT hContact, PROTORECVEVENT *pre) { return 1; } +int GGPROTO::AuthRequest(MCONTACT hContact, const TCHAR *szMessage) { return 1; } HANDLE GGPROTO::ChangeInfo(int iInfoType, void *pInfoData) { return NULL; } int GGPROTO::FileResume(HANDLE hTransfer, int *action, const PROTOCHAR** szFilename) { return 1; } HANDLE GGPROTO::SearchByEmail(const PROTOCHAR *email) { return NULL; } -int GGPROTO::RecvContacts(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; } -int GGPROTO::RecvUrl(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; } -int GGPROTO::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { return 1; } -int GGPROTO::SendUrl(HCONTACT hContact, int flags, const char *url) { return 1; } -int GGPROTO::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 1; } +int GGPROTO::RecvContacts(MCONTACT hContact, PROTORECVEVENT *pre) { return 1; } +int GGPROTO::RecvUrl(MCONTACT hContact, PROTORECVEVENT *pre) { return 1; } +int GGPROTO::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } +int GGPROTO::SendUrl(MCONTACT hContact, int flags, const char *url) { return 1; } +int GGPROTO::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 1; } ////////////////////////////////////////////////////////// // when contact is added to list -HCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr) +MCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr) { #ifdef DEBUGMODE debugLogA("AddToList(): id=%s"); @@ -160,7 +160,7 @@ HCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr) ////////////////////////////////////////////////////////// // checks proto capabilities -DWORD_PTR GGPROTO::GetCaps(int type, HCONTACT hContact) +DWORD_PTR GGPROTO::GetCaps(int type, MCONTACT hContact) { switch (type) { case PFLAGNUM_1: @@ -190,11 +190,11 @@ void __cdecl GGPROTO::cmdgetinfothread(void *hContact) { debugLogA("cmdgetinfothread(): started. Failed info retreival."); gg_sleep(100, FALSE, "cmdgetinfothread", 103, 1); - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0); debugLogA("cmdgetinfothread(): end."); } -int GGPROTO::GetInfo(HCONTACT hContact, int infoType) +int GGPROTO::GetInfo(MCONTACT hContact, int infoType) { gg_pubdir50_t req; @@ -570,7 +570,7 @@ HWND GGPROTO::CreateExtendedSearchUI(HWND owner) ////////////////////////////////////////////////////////// // when messsage received -int GGPROTO::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int GGPROTO::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { return Proto_RecvMessage(hContact, pre); } @@ -580,7 +580,7 @@ int GGPROTO::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) typedef struct { - HCONTACT hContact; + MCONTACT hContact; int seq; } GG_SEQ_ACK; @@ -592,7 +592,7 @@ void __cdecl GGPROTO::sendackthread(void *ack) mir_free(ack); } -int GGPROTO::SendMsg(HCONTACT hContact, int flags, const char *msg) +int GGPROTO::SendMsg(MCONTACT hContact, int flags, const char *msg) { uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0); if (!isonline() || !uin) @@ -633,7 +633,7 @@ int GGPROTO::SendMsg(HCONTACT hContact, int flags, const char *msg) ////////////////////////////////////////////////////////// // visible lists -int GGPROTO::SetApparentMode(HCONTACT hContact, int mode) +int GGPROTO::SetApparentMode(MCONTACT hContact, int mode) { setWord(hContact, GG_KEY_APPARENT, (WORD)mode); notifyuser(hContact, 1); @@ -670,18 +670,18 @@ void __cdecl GGPROTO::getawaymsgthread(void *hContact) debugLogA("getawaymsgthread(): started"); gg_sleep(100, FALSE, "getawaymsgthread", 106, 1); - if (!db_get_s((HCONTACT)hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) + if (!db_get_s((MCONTACT)hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) { - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); debugLog(_T("getawaymsgthread(): Reading away msg <%s>."), dbv.ptszVal); db_free(&dbv); } else { - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL); } debugLogA("getawaymsgthread(): end"); } -HANDLE GGPROTO::GetAwayMsg(HCONTACT hContact) +HANDLE GGPROTO::GetAwayMsg(MCONTACT hContact) { #ifdef DEBUGMODE debugLogA("GetAwayMsg(): ForkThread 17 GGPROTO::getawaymsgthread"); @@ -757,7 +757,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const PROTOCHAR *newMsg) ////////////////////////////////////////////////////////// // sends a notification that the user is typing a message -int GGPROTO::UserIsTyping(HCONTACT hContact, int type) +int GGPROTO::UserIsTyping(MCONTACT hContact, int type) { uin_t uin = getDword(hContact, GG_KEY_UIN, 0); if (!uin || !isonline()) diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index a993447226..fc34dd0aab 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -31,23 +31,23 @@ struct GGPROTO : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const TCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const TCHAR* email ); @@ -55,24 +55,24 @@ struct GGPROTO : public PROTO virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET* ); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles ); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode ); virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact ); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt ); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact ); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt ); virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg ); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); @@ -110,10 +110,10 @@ struct GGPROTO : public PROTO void gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging); /* Global GG functions */ - void notifyuser(HCONTACT hContact, int refresh); + void notifyuser(MCONTACT hContact, int refresh); void setalloffline(); void disconnect(); - HCONTACT getcontact(uin_t uin, int create, int inlist, TCHAR *nick); + MCONTACT getcontact(uin_t uin, int create, int inlist, TCHAR *nick); void __cdecl mainthread(void *empty); int isonline(); int refreshstatus(int status); @@ -133,9 +133,9 @@ struct GGPROTO : public PROTO void menus_init(); /* Avatar functions */ - void getAvatarFilename(HCONTACT hContact, TCHAR *pszDest, int cbLen); - void requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL); - void requestAvatarInfo(HCONTACT hContact, int iWaitFor); + void getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen); + void requestAvatarTransfer(MCONTACT hContact, char *szAvatarURL); + void requestAvatarInfo(MCONTACT hContact, int iWaitFor); void getOwnAvatar(); void setAvatar(const TCHAR *szFilename); bool getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts); @@ -152,11 +152,11 @@ struct GGPROTO : public PROTO void __cdecl setavatarthread(void*); /* File transfer functions */ - HANDLE fileallow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); - int filecancel(HCONTACT hContact, HANDLE hTransfer); - int filedeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); - int recvfile(HCONTACT hContact, PROTOFILEEVENT* pre); - HANDLE sendfile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + HANDLE fileallow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); + int filecancel(MCONTACT hContact, HANDLE hTransfer); + int filedeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); + int recvfile(MCONTACT hContact, PROTOFILEEVENT* pre); + HANDLE sendfile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); HANDLE dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath); HANDLE dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath); @@ -187,8 +187,8 @@ struct GGPROTO : public PROTO int img_sendonrequest(gg_event* e); BOOL img_opened(uin_t uin); void *img_loadpicture(gg_event* e, TCHAR *szFileName); - int img_display(HCONTACT hContact, void *img); - int img_displayasmsg(HCONTACT hContact, void *img); + int img_display(MCONTACT hContact, void *img); + int img_displayasmsg(MCONTACT hContact, void *img); void __cdecl img_dlgcallthread(void *param); @@ -211,7 +211,7 @@ struct GGPROTO : public PROTO int gc_destroy(); TCHAR * gc_getchat(uin_t sender, uin_t *recipients, int recipients_count); GGGC *gc_lookup(const TCHAR *id); - int gc_changenick(HCONTACT hContact, TCHAR *ptszNick); + int gc_changenick(MCONTACT hContact, TCHAR *ptszNick); int __cdecl gc_event(WPARAM wParam, LPARAM lParam); diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 676b7abbe5..816e1e5d9b 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -138,8 +138,8 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam) list_remove(&chats, chat, 1); // Remove contact from contact list (duh!) should be done by chat.dll !! - for (HCONTACT hContact = db_find_first(); hContact; ) { - HCONTACT hNext = db_find_next(hContact); + for (MCONTACT hContact = db_find_first(); hContact; ) { + MCONTACT hNext = db_find_next(hContact); DBVARIANT dbv; if (!getTString(hContact, "ChatRoomID", &dbv)) { if (dbv.ptszVal && !_tcscmp(gch->pDest->ptszID, dbv.ptszVal)) @@ -193,7 +193,7 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam) // Privmessage selected if (gch->pDest->iType == GC_USER_PRIVMESS) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; if ((uin = _ttoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL))) CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); } @@ -369,7 +369,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count // Add contacts for(i = 0; i < chat->recipients_count; i++) { - HCONTACT hContact = getcontact(chat->recipients[i], 1, 0, NULL); + MCONTACT hContact = getcontact(chat->recipients[i], 1, 0, NULL); UIN2IDT(chat->recipients[i], id); if (hContact && (name = pcli->pfnGetContactDisplayName(hContact, 0)) != NULL) gce.ptszNick = name; @@ -389,7 +389,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count return chat->id; } -static HCONTACT gg_getsubcontact(GGPROTO* gg, HCONTACT hContact) +static MCONTACT gg_getsubcontact(GGPROTO* gg, MCONTACT hContact) { char* szProto = GetContactProto(hContact); char* szMetaProto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0); @@ -398,7 +398,7 @@ static HCONTACT gg_getsubcontact(GGPROTO* gg, HCONTACT hContact) { int nSubContacts = (int)CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0), i; for (i = 0; i < nSubContacts; i++) { - HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i); + MCONTACT hMetaContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i); szProto = GetContactProto(hMetaContact); if (szProto && !lstrcmpA(szProto, gg->m_szModuleName)) return hMetaContact; @@ -423,7 +423,7 @@ static void gg_gc_resetclistopts(HWND hwndList) static int gg_gc_countcheckmarks(HWND hwndList) { int count = 0; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) count++; @@ -475,10 +475,10 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa TCHAR* chat; uin_t* participants = (uin_t*)calloc(count, sizeof(uin_t)); gg->debugLogA("gg_gc_openconfdlg(): WM_COMMAND IDOK Opening new conference for %d contacts.", count); - for (HCONTACT hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { - HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support + MCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support participants[i++] = db_get_dw(hMetaContact ? hMetaContact : hContact, gg->m_szModuleName, GG_KEY_UIN, 0); } } @@ -524,10 +524,10 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa if (!gg) break; // Delete non-gg contacts - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - HCONTACT hItem = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + MCONTACT hItem = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem) { - HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support + MCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support if (hMetaContact) { szProto = gg->m_szModuleName; uin = (uin_t)gg->getDword(hMetaContact, GG_KEY_UIN, 0); @@ -618,7 +618,7 @@ INT_PTR GGPROTO::gc_openconf(WPARAM wParam, LPARAM lParam) return 1; } -int GGPROTO::gc_changenick(HCONTACT hContact, TCHAR *ptszNick) +int GGPROTO::gc_changenick(MCONTACT hContact, TCHAR *ptszNick) { list_t l; uin_t uin = getDword(hContact, GG_KEY_UIN, 0); diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 607edfdb37..be57084318 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -49,7 +49,7 @@ typedef struct _GGIMAGEENTRY typedef struct { - HCONTACT hContact; + MCONTACT hContact; HANDLE hEvent; HWND hWnd; uin_t uin; @@ -730,7 +730,7 @@ void __cdecl GGPROTO::img_dlgcallthread(void *param) //////////////////////////////////////////////////////////////////////////// // Open dialog receive for specified contact -GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, HCONTACT hContact) +GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, MCONTACT hContact) { // Create dialog data GGIMAGEDLGDATA *dat = (GGIMAGEDLGDATA *)calloc(1, sizeof(GGIMAGEDLGDATA)); @@ -804,7 +804,7 @@ TCHAR *gg_img_hasextension(TCHAR *filename) //////////////////////////////////////////////////////////////////////////////// // Display received image using message with [img] BBCode -int GGPROTO::img_displayasmsg(HCONTACT hContact, void *img) +int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) { GGIMAGEENTRY *dat = (GGIMAGEENTRY *)img; TCHAR szPath[MAX_PATH], path[MAX_PATH], *pImgext, imgext[6]; @@ -896,7 +896,7 @@ BOOL GGPROTO::img_opened(uin_t uin) //////////////////////////////////////////////////////////////////////////// // Image Module : Looking for window entry, create if not found -int GGPROTO::img_display(HCONTACT hContact, void *img) +int GGPROTO::img_display(MCONTACT hContact, void *img) { list_t l = imagedlgs; GGIMAGEDLGDATA *dat; @@ -1173,7 +1173,7 @@ BOOL GGPROTO::img_sendonrequest(gg_event* e) INT_PTR GGPROTO::img_sendimg(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; GGIMAGEDLGDATA *dat = NULL; gg_EnterCriticalSection(&img_mutex, "img_sendimg", 64, "img_mutex", 1); diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index e4954fc14c..5b528ee0ef 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -26,7 +26,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) char *contacts; // Readup contacts - for (HCONTACT hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) { if (gg->isChatRoom(hContact)) continue; @@ -210,7 +210,7 @@ void GGPROTO::parsecontacts(char *contacts) // Loadup contact if (uin && strNick) { - HCONTACT hContact = getcontact(uin, 1, 1, _A2T(strNick)); + MCONTACT hContact = getcontact(uin, 1, 1, _A2T(strNick)); #ifdef DEBUGMODE debugLogA("parsecontacts(): Found contact %d with nickname \"%s\".", uin, strNick); #endif diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index f241938c5a..8b46a68b80 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -99,7 +99,7 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) if (ServiceExists(MS_MSG_SENDMESSAGE)) { - HCONTACT hContact = gg->getcontact(uin, 1, 0, NULL); + MCONTACT hContact = gg->getcontact(uin, 1, 0, NULL); if (hContact != NULL) CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); } diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 4b6d8610df..cac6119d71 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -382,7 +382,7 @@ INT_PTR GGPROTO::get_acc_mgr_gui(WPARAM wParam, LPARAM lParam) INT_PTR GGPROTO::leavechat(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 54ade38cac..ff021ea86e 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -24,13 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, unsigned long adr, int port) { - HCONTACT hContact; + MCONTACT hContact; TCHAR szNick[256]; char szService[256]; bool bFlag = false; CONTACT usertemp = { (TCHAR*)name.c_str(), NULL, NULL, false, false, true }; - HCONTACT hc = CList_FindContact(&usertemp); + MCONTACT hc = CList_FindContact(&usertemp); if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && db_get_b(hc, "CList", "Hidden", 0) == 0) bFlag = true; @@ -80,12 +80,12 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, return TRUE; } -HCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) +MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) { if (user->name == NULL) return 0; - HCONTACT hContact = CList_FindContact(user); + MCONTACT hContact = CList_FindContact(user); if (hContact) { if (InList) db_unset(hContact, "CList", "NotOnList"); @@ -97,7 +97,7 @@ HCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) } // here we create a new one since no one is to be found - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); @@ -116,9 +116,9 @@ HCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) return false; } -HCONTACT CIrcProto::CList_SetOffline(CONTACT *user) +MCONTACT CIrcProto::CList_SetOffline(CONTACT *user) { - HCONTACT hContact = CList_FindContact(user); + MCONTACT hContact = CList_FindContact(user); if (hContact) { DBVARIANT dbv; if (!getTString(hContact, "Default", &dbv)) { @@ -140,7 +140,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) DisconnectAllDCCSessions(false); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; @@ -160,7 +160,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) return true; } -HCONTACT CIrcProto::CList_FindContact(CONTACT *user) +MCONTACT CIrcProto::CList_FindContact(CONTACT *user) { if (!user || !user->name) return 0; @@ -168,11 +168,11 @@ HCONTACT CIrcProto::CList_FindContact(CONTACT *user) TCHAR* lowercasename = mir_tstrdup(user->name); CharLower(lowercasename); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; - HCONTACT hContact_temp = NULL; + MCONTACT hContact_temp = NULL; ptrT DBNick(getTStringA(hContact, "Nick")); ptrT DBUser(getTStringA(hContact, "UUser")); ptrT DBHost(getTStringA(hContact, "UHost")); @@ -183,7 +183,7 @@ HCONTACT CIrcProto::CList_FindContact(CONTACT *user) CharLower(DBWildcard); if (IsChannel(user->name)) { if (DBDefault && !lstrcmpi(DBDefault, user->name)) - hContact_temp = (HCONTACT)-1; + hContact_temp = (MCONTACT)-1; } else if (user->ExactNick && DBNick && !lstrcmpi(DBNick, user->name)) hContact_temp = hContact; @@ -208,7 +208,7 @@ HCONTACT CIrcProto::CList_FindContact(CONTACT *user) if (hContact_temp != NULL) { mir_free(lowercasename); - if (hContact_temp != (HCONTACT)-1) + if (hContact_temp != (MCONTACT)-1) return hContact_temp; return 0; } diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 41556d434e..52d4b03d20 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -140,7 +140,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) if (name.IsEmpty() && name2.IsEmpty()) { DBVARIANT dbv; - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { if (ppro->isChatRoom(hContact)) continue; @@ -215,7 +215,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) ppro->SetChatTimer(ppro->OnlineNotifTimer, ppro->m_onlineNotificationTime * 1000, OnlineNotifTimerProc); } -int CIrcProto::AddOutgoingMessageToDB(HCONTACT hContact, TCHAR* msg) +int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, TCHAR* msg) { if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING) return 0; @@ -582,7 +582,7 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg) DoEvent(GC_EVENT_CHUID, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, NULL, NULL, true, false); struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (hContact) { if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) setWord(hContact, "Status", ID_STATUS_ONLINE); @@ -696,12 +696,12 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg) return true; if ((m_ignore && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'q'))) { - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (!hContact || (hContact && db_get_b(hContact, "CList", "Hidden", 0) == 1)) return true; } - HCONTACT hContact = CList_AddContact(&user, false, true); + MCONTACT hContact = CList_AddContact(&user, false, true); PROTORECVEVENT pre = { 0 }; pre.timestamp = (DWORD)time(NULL); @@ -1066,7 +1066,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // incoming chat request if (bIsChat) { CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), 0, 0, false, false, true }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); // check if it should be ignored if (m_DCCChatIgnore == 1 || @@ -1139,7 +1139,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) if (!CList_FindContact(&user)) return true; - HCONTACT hContact = CList_AddContact(&user, false, true); + MCONTACT hContact = CList_AddContact(&user, false, true); if (hContact) { DCCINFO* di = new DCCINFO; di->hContact = hContact; @@ -1188,7 +1188,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) //if we got incoming CTCP Version for contact in CList - then write its as MirVer for that contact! if (pmsg->m_bIncoming && command == _T("version")) { struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (hContact) setTString(hContact, "MirVer", DoColorCodes(GetWordAddress(mess.c_str(), 1), TRUE, FALSE)); } @@ -1688,7 +1688,7 @@ bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg) { if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1 && m_manualWhoisCount < 1) { CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, true }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (hContact) ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)WhoisAwayReply.c_str()); } @@ -1767,7 +1767,7 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg) m_whoisDlg->ShowMessageNoUser(pmsg); CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, false }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (hContact) { AddOutgoingMessageToDB(hContact, (TCHAR*)((CMString)_T("> ") + pmsg->parameters[2] + (CMString)_T(": ") + pmsg->parameters[1]).c_str()); @@ -1949,7 +1949,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) const TCHAR* p1 = UserList; m_whoReply = _T(""); CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); if (hContact && getByte(hContact, "AdvancedMode", 0) == 1) { ptrT DBHost(getTStringA(hContact, "UHost")); @@ -2118,7 +2118,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg) finduser.host = (TCHAR*)host.c_str(); finduser.user = (TCHAR*)user.c_str(); - HCONTACT hContact = CList_FindContact(&finduser); + MCONTACT hContact = CList_FindContact(&finduser); if (hContact && getByte(hContact, "AdvancedMode", 0) == 0) { setWord(hContact, "Status", awaystatus == '-' ? ID_STATUS_AWAY : ID_STATUS_ONLINE); setTString(hContact, "User", user.c_str()); diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index fbc43f7cec..1ad5c203bf 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -212,7 +212,7 @@ static void __stdcall sttSetTimerOff(void* _pro) ppro->KillChatTimer(ppro->OnlineNotifTimer3); } -BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HCONTACT hContact) +BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hContact) { TCHAR temp[30]; lstrcpyn(temp, GetWord(text.c_str(), 0).c_str(), 29); @@ -555,7 +555,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HCONTACT hConta return true; CONTACT user = { (TCHAR*)one.c_str(), NULL, NULL, false, false, false }; - HCONTACT hContact2 = CList_AddContact(&user, false, false); + MCONTACT hContact2 = CList_AddContact(&user, false, false); if (hContact2) { if (getByte(hContact, "AdvancedMode", 0) == 0) DoUserhostWithReason(1, (_T("S") + one).c_str(), true, one.c_str()); @@ -628,7 +628,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HCONTACT hConta if (ulAdr) { CONTACT user = { (TCHAR*)two.c_str(), NULL, NULL, false, false, true }; - HCONTACT hContact = CList_AddContact(&user, false, false); + MCONTACT hContact = CList_AddContact(&user, false, false); if (hContact) { CMString s; @@ -679,7 +679,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HCONTACT hConta if (ulAdr) { CMString contact = two; contact += _T(DCCSTRING); CONTACT user = { (TCHAR*)contact.c_str(), NULL, NULL, false, false, true }; - HCONTACT hContact = CList_AddContact(&user, false, false); + MCONTACT hContact = CList_AddContact(&user, false, false); setByte(hContact, "DCC", 1); int iPort = 0; @@ -805,7 +805,7 @@ bool CIrcProto::PostIrcMessage(const TCHAR* fmt, ...) return PostIrcMessageWnd(NULL, NULL, szBuf); } -bool CIrcProto::PostIrcMessageWnd(TCHAR* window, HCONTACT hContact, const TCHAR* szBuf) +bool CIrcProto::PostIrcMessageWnd(TCHAR* window, MCONTACT hContact, const TCHAR* szBuf) { DBVARIANT dbv; TCHAR windowname[256]; diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h index 6a024ad099..bb6f6d7a70 100644 --- a/protocols/IRCG/src/irc.h +++ b/protocols/IRCG/src/irc.h @@ -214,23 +214,23 @@ struct CIrcProto : public PROTO // Protocol interface - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email); @@ -238,24 +238,24 @@ struct CIrcProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -389,18 +389,18 @@ struct CIrcProto : public PROTO CDlgBase::CreateParam OptCreateAccount, OptCreateConn, OptCreateIgnore, OptCreateOther; //clist.cpp - HCONTACT CList_AddContact(CONTACT *user, bool InList, bool SetOnline); + MCONTACT CList_AddContact(CONTACT *user, bool InList, bool SetOnline); bool CList_SetAllOffline(BYTE ChatsToo); - HCONTACT CList_SetOffline(CONTACT *user); + MCONTACT CList_SetOffline(CONTACT *user); bool CList_AddEvent(CONTACT *user, HICON Icon, HANDLE event, const char *tooltip, int type ) ; - HCONTACT CList_FindContact(CONTACT *user); + MCONTACT CList_FindContact(CONTACT *user); BOOL CList_AddDCCChat(const CMString &name, const CMString &hostmask, unsigned long adr, int port) ; //commandmonitor.cpp UINT_PTR IdentTimer, InitTimer, KeepAliveTimer, OnlineNotifTimer, OnlineNotifTimer3; - int AddOutgoingMessageToDB(HCONTACT hContact, TCHAR *msg); + int AddOutgoingMessageToDB(MCONTACT hContact, TCHAR *msg); bool DoOnConnect(const CIrcMessage *pmsg); int DoPerform(const char *event); void __cdecl ResolveIPThread(void *di); @@ -412,10 +412,10 @@ struct CIrcProto : public PROTO //input.cpp CMString DoAlias( const TCHAR *text, TCHAR *window); - BOOL DoHardcodedCommand(CMString text, TCHAR *window, HCONTACT hContact); + BOOL DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hContact); CMString DoIdentifiers(CMString text, const TCHAR *window); void FormatMsg(CMString &text); - bool PostIrcMessageWnd(TCHAR *pszWindow, HCONTACT hContact, const TCHAR *szBuf); + bool PostIrcMessageWnd(TCHAR *pszWindow, MCONTACT hContact, const TCHAR *szBuf); bool PostIrcMessage(const TCHAR *fmt, ...); // irclib.cpp @@ -501,12 +501,12 @@ struct CIrcProto : public PROTO //////////////////////////////////////////////////////////////////////////////////////// // former CIrcSession class - void AddDCCSession(HCONTACT hContact, CDccSession* dcc); + void AddDCCSession(MCONTACT hContact, CDccSession* dcc); void AddDCCSession(DCCINFO* pdci, CDccSession* dcc); - void RemoveDCCSession(HCONTACT hContact); + void RemoveDCCSession(MCONTACT hContact); void RemoveDCCSession(DCCINFO* pdci); - CDccSession* FindDCCSession(HCONTACT hContact); + CDccSession* FindDCCSession(MCONTACT hContact); CDccSession* FindDCCSession(DCCINFO* pdci); CDccSession* FindDCCSendByPort(int iPort); CDccSession* FindDCCRecvByPortAndName(int iPort, const TCHAR* szName); diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index b1e97a4212..901834c7e1 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -457,7 +457,7 @@ void __cdecl CIrcProto::ThreadProc(void*) m_info.Reset(); } -void CIrcProto::AddDCCSession(HCONTACT, CDccSession* dcc) +void CIrcProto::AddDCCSession(MCONTACT, CDccSession* dcc) { EnterCriticalSection(&m_dcc); @@ -479,7 +479,7 @@ void CIrcProto::AddDCCSession(DCCINFO*, CDccSession* dcc) LeaveCriticalSection(&m_dcc); } -void CIrcProto::RemoveDCCSession(HCONTACT hContact) +void CIrcProto::RemoveDCCSession(MCONTACT hContact) { EnterCriticalSection(&m_dcc); @@ -505,7 +505,7 @@ void CIrcProto::RemoveDCCSession(DCCINFO* pdci) LeaveCriticalSection(&m_dcc); } -CDccSession* CIrcProto::FindDCCSession(HCONTACT hContact) +CDccSession* CIrcProto::FindDCCSession(MCONTACT hContact) { EnterCriticalSection(&m_dcc); diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h index d0efcd6fcf..4fc6c9bff5 100644 --- a/protocols/IRCG/src/irclib.h +++ b/protocols/IRCG/src/irclib.h @@ -48,7 +48,7 @@ struct DCCINFO : public MZeroedObject CMString sFile; CMString sFileAndPath; CMString sHostmask; - HCONTACT hContact; + MCONTACT hContact; CMString sContactName; }; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index a74fe449da..de66eb369b 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -318,7 +318,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -HCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) +MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) { if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING) return 0; @@ -327,7 +327,7 @@ HCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) id = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)id) : mir_a2t((char*)id); CONTACT user = { id, NULL, NULL, true, false, false }; - HCONTACT hContact = CList_AddContact(&user, true, false); + MCONTACT hContact = CList_AddContact(&user, true, false); if (hContact) { DBVARIANT dbv1; @@ -359,7 +359,7 @@ HCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -HCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE) +MCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE) { return NULL; } @@ -383,7 +383,7 @@ int __cdecl CIrcProto::AuthDeny(HANDLE, const TCHAR*) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CIrcProto::AuthRecv(HCONTACT, PROTORECVEVENT*) +int __cdecl CIrcProto::AuthRecv(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -391,7 +391,7 @@ int __cdecl CIrcProto::AuthRecv(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CIrcProto::AuthRequest(HCONTACT, const TCHAR*) +int __cdecl CIrcProto::AuthRequest(MCONTACT, const TCHAR*) { return 1; } @@ -407,7 +407,7 @@ HANDLE __cdecl CIrcProto::ChangeInfo(int, void*) //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CIrcProto::FileAllow(HCONTACT, HANDLE hTransfer, const TCHAR* szPath) +HANDLE __cdecl CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath) { DCCINFO* di = (DCCINFO*)hTransfer; @@ -428,7 +428,7 @@ HANDLE __cdecl CIrcProto::FileAllow(HCONTACT, HANDLE hTransfer, const TCHAR* szP //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CIrcProto::FileCancel(HCONTACT, HANDLE hTransfer) +int __cdecl CIrcProto::FileCancel(MCONTACT, HANDLE hTransfer) { DCCINFO* di = (DCCINFO*)hTransfer; @@ -444,7 +444,7 @@ int __cdecl CIrcProto::FileCancel(HCONTACT, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CIrcProto::FileDeny(HCONTACT, HANDLE hTransfer, const TCHAR*) +int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*) { DCCINFO* di = (DCCINFO*)hTransfer; delete di; @@ -500,7 +500,7 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CIrcProto::GetCaps(int type, HCONTACT) +DWORD_PTR __cdecl CIrcProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -531,7 +531,7 @@ DWORD_PTR __cdecl CIrcProto::GetCaps(int type, HCONTACT) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CIrcProto::GetInfo(HCONTACT, int) +int __cdecl CIrcProto::GetInfo(MCONTACT, int) { return 1; } @@ -599,7 +599,7 @@ HWND __cdecl CIrcProto::SearchAdvanced(HWND) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CIrcProto::RecvContacts(HCONTACT, PROTORECVEVENT*) +int __cdecl CIrcProto::RecvContacts(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -607,7 +607,7 @@ int __cdecl CIrcProto::RecvContacts(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CIrcProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) +int __cdecl CIrcProto::RecvFile(MCONTACT hContact, PROTORECVFILET* evt) { return Proto_RecvFile(hContact, evt); } @@ -615,7 +615,7 @@ int __cdecl CIrcProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CIrcProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt) +int __cdecl CIrcProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* evt) { return Proto_RecvMessage(hContact, evt); } @@ -623,7 +623,7 @@ int __cdecl CIrcProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CIrcProto::RecvUrl(HCONTACT, PROTORECVEVENT*) +int __cdecl CIrcProto::RecvUrl(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -631,7 +631,7 @@ int __cdecl CIrcProto::RecvUrl(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CIrcProto::SendContacts(HCONTACT, int, int, HCONTACT*) +int __cdecl CIrcProto::SendContacts(MCONTACT, int, int, MCONTACT*) { return 1; } @@ -639,7 +639,7 @@ int __cdecl CIrcProto::SendContacts(HCONTACT, int, int, HCONTACT*) //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CIrcProto::SendFile(HCONTACT hContact, const TCHAR*, TCHAR** ppszFiles) +HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppszFiles) { DCCINFO* dci = NULL; int iPort = 0; @@ -780,22 +780,22 @@ HANDLE __cdecl CIrcProto::SendFile(HCONTACT hContact, const TCHAR*, TCHAR** ppsz struct TFakeAckParam { - __inline TFakeAckParam(HCONTACT _hContact, int _msgid) : + __inline TFakeAckParam(MCONTACT _hContact, int _msgid) : hContact(_hContact), msgid(_msgid) {} - HCONTACT hContact; + MCONTACT hContact; int msgid; }; void __cdecl CIrcProto::AckMessageFail(void *info) { - ProtoBroadcastAck((HCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online")); + ProtoBroadcastAck((MCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online")); } void __cdecl CIrcProto::AckMessageFailDcc(void *info) { - ProtoBroadcastAck((HCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active")); + ProtoBroadcastAck((MCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active")); } void __cdecl CIrcProto::AckMessageSuccess(void *info) @@ -805,7 +805,7 @@ void __cdecl CIrcProto::AckMessageSuccess(void *info) delete param; } -int __cdecl CIrcProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { BYTE bDcc = getByte(hContact, "DCC", 0); WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); @@ -846,7 +846,7 @@ int __cdecl CIrcProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CIrcProto::SendUrl(HCONTACT, int, const char*) +int __cdecl CIrcProto::SendUrl(MCONTACT, int, const char*) { return 1; } @@ -854,7 +854,7 @@ int __cdecl CIrcProto::SendUrl(HCONTACT, int, const char*) //////////////////////////////////////////////////////////////////////////////////////// // SetApparentMode - sets the visibility status -int __cdecl CIrcProto::SetApparentMode(HCONTACT, int) +int __cdecl CIrcProto::SetApparentMode(MCONTACT, int) { return 0; } @@ -936,7 +936,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal) //////////////////////////////////////////////////////////////////////////////////////// // GetAwayMsg - returns a contact's away message -HANDLE __cdecl CIrcProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact) { WhoisAwayReply = _T(""); DBVARIANT dbv; @@ -963,7 +963,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CIrcProto::RecvAwayMsg(HCONTACT, int, PROTORECVEVENT*) +int __cdecl CIrcProto::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*) { return 1; } @@ -998,7 +998,7 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const TCHAR* msg) ///////////////////////////////////////////////////////////////////////////////////////// // UserIsTyping - sends a UTN notification -int __cdecl CIrcProto::UserIsTyping(HCONTACT, int) +int __cdecl CIrcProto::UserIsTyping(MCONTACT, int) { return 0; } diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 8e82c02da0..647ece9070 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -90,7 +90,7 @@ void CIrcProto::InitMainMenus(void) static HGENMENU hUMenuChanSettings, hUMenuWhois, hUMenuDisconnect, hUMenuIgnore; static HANDLE hMenuChanSettings, hMenuWhois, hMenuDisconnect, hMenuIgnore; -static CIrcProto* IrcGetInstanceByHContact(HCONTACT hContact) +static CIrcProto* IrcGetInstanceByHContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); if (szProto == NULL) @@ -105,25 +105,25 @@ static CIrcProto* IrcGetInstanceByHContact(HCONTACT hContact) static INT_PTR IrcMenuChanSettings(WPARAM wParam, LPARAM lParam) { - CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam); + CIrcProto *ppro = IrcGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnMenuChanSettings(wParam, lParam) : 0; } static INT_PTR IrcMenuWhois(WPARAM wParam, LPARAM lParam) { - CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam); + CIrcProto *ppro = IrcGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnMenuWhois(wParam, lParam) : 0; } static INT_PTR IrcMenuDisconnect(WPARAM wParam, LPARAM lParam) { - CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam); + CIrcProto *ppro = IrcGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnMenuDisconnect(wParam, lParam) : 0; } static INT_PTR IrcMenuIgnore(WPARAM wParam, LPARAM lParam) { - CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam); + CIrcProto *ppro = IrcGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnMenuIgnore(wParam, lParam) : 0; } @@ -134,7 +134,7 @@ int IrcPrebuildContactMenu(WPARAM wParam, LPARAM lParam) Menu_ShowItem(hUMenuDisconnect, false); Menu_ShowItem(hUMenuIgnore, false); - CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam); + CIrcProto *ppro = IrcGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnMenuPreBuild(wParam, lParam) : 0; } @@ -213,7 +213,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam) int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM) { - HCONTACT hContact = (HCONTACT)wp; + MCONTACT hContact = (MCONTACT)wp; if (!hContact) return 0; @@ -233,9 +233,9 @@ int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM) PostIrcMessage(_T("/PART %s %s"), dbv.ptszVal, m_userInfo); } else { - BYTE bDCC = getByte((HCONTACT)wp, "DCC", 0); + BYTE bDCC = getByte((MCONTACT)wp, "DCC", 0); if (bDCC) { - CDccSession* dcc = FindDCCSession((HCONTACT)wp); + CDccSession* dcc = FindDCCSession((MCONTACT)wp); if (dcc) dcc->Disconnect(); } @@ -252,8 +252,8 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM) return 0; DBVARIANT dbv; - if (!getTString((HCONTACT)wp, "Nick", &dbv)) { - if (getByte((HCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) + if (!getTString((MCONTACT)wp, "Nick", &dbv)) { + if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) PostIrcMessage(_T("/JOIN %s"), dbv.ptszVal); db_free(&dbv); } @@ -266,8 +266,8 @@ INT_PTR __cdecl CIrcProto::OnLeaveChat(WPARAM wp, LPARAM) return 0; DBVARIANT dbv; - if (!getTString((HCONTACT)wp, "Nick", &dbv)) { - if (getByte((HCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) { + if (!getTString((MCONTACT)wp, "Nick", &dbv)) { + if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) { PostIrcMessage(_T("/PART %s %s"), dbv.ptszVal, m_userInfo); CMString S = MakeWndID(dbv.ptszVal); @@ -285,7 +285,7 @@ INT_PTR __cdecl CIrcProto::OnMenuChanSettings(WPARAM wp, LPARAM) if (!wp) return 0; - HCONTACT hContact = (HCONTACT)wp; + MCONTACT hContact = (MCONTACT)wp; DBVARIANT dbv; if (!getTString(hContact, "Nick", &dbv)) { PostIrcMessageWnd(dbv.ptszVal, NULL, _T("/CHANNELMANAGER")); @@ -301,7 +301,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM) DBVARIANT dbv; - if (!getTString((HCONTACT)wp, "Nick", &dbv)) { + if (!getTString((MCONTACT)wp, "Nick", &dbv)) { PostIrcMessage(_T("/WHOIS %s %s"), dbv.ptszVal, dbv.ptszVal); db_free(&dbv); } @@ -310,7 +310,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM) INT_PTR __cdecl CIrcProto::OnMenuDisconnect(WPARAM wp, LPARAM) { - CDccSession* dcc = FindDCCSession((HCONTACT)wp); + CDccSession* dcc = FindDCCSession((MCONTACT)wp); if (dcc) dcc->Disconnect(); return 0; @@ -321,7 +321,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM) if (!wp) return 0; - HCONTACT hContact = (HCONTACT)wp; + MCONTACT hContact = (MCONTACT)wp; DBVARIANT dbv; if (!getTString(hContact, "Nick", &dbv)) { if (!isChatRoom(hContact)) { @@ -865,7 +865,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) if (gcmi->Type == MENU_ON_NICKLIST) { CONTACT user = { (TCHAR*)gcmi->pszUID, NULL, NULL, false, false, false }; - HCONTACT hContact = CList_FindContact(&user); + MCONTACT hContact = CList_FindContact(&user); gcmi->nItems = SIZEOF(nickItems); gcmi->Item = nickItems; @@ -934,7 +934,7 @@ int __cdecl CIrcProto::OnPreShutdown(WPARAM, LPARAM) int __cdecl CIrcProto::OnMenuPreBuild(WPARAM wParam, LPARAM) { DBVARIANT dbv; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) return 0; @@ -978,7 +978,7 @@ int __cdecl CIrcProto::OnMenuPreBuild(WPARAM wParam, LPARAM) int __cdecl CIrcProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL || !IsConnected()) return 0; diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp index a62a7fbc5d..feb85074f1 100644 --- a/protocols/IRCG/src/ui_utils.cpp +++ b/protocols/IRCG/src/ui_utils.cpp @@ -629,7 +629,7 @@ BOOL CCtrlClc::OnNotify(int, NMHDR *pnmh) return FALSE; } -void CCtrlClc::AddContact(HCONTACT hContact) +void CCtrlClc::AddContact(MCONTACT hContact) { SendMessage(m_hwnd, CLM_ADDCONTACT, (WPARAM)hContact, 0); } @@ -661,7 +661,7 @@ void CCtrlClc::Expand(HANDLE hItem, DWORD flags) { SendMessage(m_hwnd, CLM_EXPAND, (WPARAM)hItem, flags); } -HANDLE CCtrlClc::FindContact(HCONTACT hContact) +HANDLE CCtrlClc::FindContact(MCONTACT hContact) { return (HANDLE)SendMessage(m_hwnd, CLM_FINDCONTACT, (WPARAM)hContact, 0); } diff --git a/protocols/IRCG/src/ui_utils.h b/protocols/IRCG/src/ui_utils.h index c42ea6a668..ef70439f61 100644 --- a/protocols/IRCG/src/ui_utils.h +++ b/protocols/IRCG/src/ui_utils.h @@ -409,7 +409,7 @@ class CCtrlClc: public CCtrlBase public: CCtrlClc( CDlgBase* dlg, int ctrlId ); - void AddContact(HCONTACT hContact); + void AddContact(MCONTACT hContact); void AddGroup(HANDLE hGroup); void AutoRebuild(); void DeleteItem(HANDLE hItem); @@ -417,7 +417,7 @@ public: void EndEditLabel(bool save); void EnsureVisible(HANDLE hItem, bool partialOk); void Expand(HANDLE hItem, DWORD flags); - HANDLE FindContact(HCONTACT hContact); + HANDLE FindContact(MCONTACT hContact); HANDLE FindGroup(HANDLE hGroup); COLORREF GetBkColor(); bool GetCheck(HANDLE hItem); diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index dc4a5c8b14..246e6be8e1 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -26,13 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct UserDetailsDlgProcParam { - UserDetailsDlgProcParam(CIrcProto* _pro, HCONTACT _info) : + UserDetailsDlgProcParam(CIrcProto* _pro, MCONTACT _info) : ppro(_pro), hContact(_info) {} CIrcProto *ppro; - HCONTACT hContact; + MCONTACT hContact; }; #define STR_BASIC LPGEN("Faster! Searches the network for an exact match of the nickname only. The hostmask is optional and provides further security if used. Wildcards (? and *) are allowed.") @@ -45,7 +45,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM UserDetailsDlgProcParam *p = (UserDetailsDlgProcParam*)GetWindowLongPtr(m_hwnd, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - p = new UserDetailsDlgProcParam(NULL, (HCONTACT)lParam); + p = new UserDetailsDlgProcParam(NULL, (MCONTACT)lParam); SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LPARAM)p); break; @@ -188,7 +188,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM int __cdecl CIrcProto::OnInitUserInfo(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; char *szProto = GetContactProto(hContact); if (!hContact || !szProto || lstrcmpiA(szProto, m_szModuleName)) return 0; diff --git a/protocols/IcqOscarJ/src/UI/askauthentication.cpp b/protocols/IcqOscarJ/src/UI/askauthentication.cpp index 76e290f704..91fe8e75d2 100644 --- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp +++ b/protocols/IcqOscarJ/src/UI/askauthentication.cpp @@ -32,7 +32,7 @@ struct AskAuthParam { CIcqProto* ppro; - HCONTACT hContact; + MCONTACT hContact; }; static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -90,7 +90,7 @@ static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA INT_PTR CIcqProto::RequestAuthorization(WPARAM wParam, LPARAM lParam) { - AskAuthParam param = { this, (HCONTACT)wParam }; + AskAuthParam param = { this, (MCONTACT)wParam }; DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)¶m); return 0; } diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp index 1c0bcb67f4..793aa0d04d 100644 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp @@ -41,7 +41,7 @@ extern const char *nameXStatus[]; ///////////////////////////////////////////////////////////////////////////////////////// -static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HCONTACT hContact, char* szModule, char* szSetting, int special) +static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContact, char* szModule, char* szSetting, int special) { DBVARIANT dbv = {0}; char str[MAX_PATH]; @@ -221,7 +221,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; char* szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact == NULL) szProto = ppro->m_szModuleName; @@ -284,7 +284,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { - if ((!IsICQContact((HCONTACT)lParam)) && lParam) + if ((!IsICQContact((MCONTACT)lParam)) && lParam) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp index 91e464b561..8a61dc9f44 100644 --- a/protocols/IcqOscarJ/src/capabilities.cpp +++ b/protocols/IcqOscarJ/src/capabilities.cpp @@ -102,14 +102,14 @@ void NetLog_CapabilityChange(CIcqProto *ppro, const char *szChange, DWORD fdwCap // Deletes all oscar capabilities for a given contact -void CIcqProto::ClearAllContactCapabilities(HCONTACT hContact) +void CIcqProto::ClearAllContactCapabilities(MCONTACT hContact) { setDword(hContact, DBSETTING_CAPABILITIES, 0); } // Deletes one or many oscar capabilities for a given contact -void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +void CIcqProto::ClearContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -129,7 +129,7 @@ void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilitie // Sets one or many oscar capabilities for a given contact -void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +void CIcqProto::SetContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -149,7 +149,7 @@ void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) // Returns true if the given contact supports the requested capabilites -BOOL CIcqProto::CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities) +BOOL CIcqProto::CheckContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -218,7 +218,7 @@ DWORD GetCapabilitiesFromBuffer(BYTE *pBuffer, int nLength) // Scans a binary buffer for oscar capabilities and adds them to the contact. // You probably want to call ClearAllContactCapabilities() first. -void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength) +void CIcqProto::AddCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength) { // Get current capability flags DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0); @@ -241,7 +241,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int // Scans a binary buffer for oscar capabilities and adds them to the contact. // You probably want to call ClearAllContactCapabilities() first. -void CIcqProto::SetCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset) +void CIcqProto::SetCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset) { // Get current capability flags DWORD fdwContactCaps = bReset ? 0 : getDword(hContact, DBSETTING_CAPABILITIES, 0); diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp index f5e7999a77..1419a8f398 100644 --- a/protocols/IcqOscarJ/src/cookies.cpp +++ b/protocols/IcqOscarJ/src/cookies.cpp @@ -50,7 +50,7 @@ void CIcqProto::RemoveExpiredCookies() // Generate and allocate cookie -DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra) +DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, MCONTACT hContact, void *pvExtra) { icq_lock l(cookieMutex); @@ -96,7 +96,7 @@ int CIcqProto::GetCookieType(DWORD dwCookie) } -int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra) +int CIcqProto::FindCookie(DWORD dwCookie, MCONTACT *phContact, void **ppvExtra) { icq_lock l(cookieMutex); @@ -115,7 +115,7 @@ int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra) } -int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact) +int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, MCONTACT *phContact) { icq_lock l(cookieMutex); @@ -137,7 +137,7 @@ int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phCon } -int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void** ppvExtra) +int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, MCONTACT *phContact, void** ppvExtra) { icq_lock l(cookieMutex); @@ -161,7 +161,7 @@ int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContac } -int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra) +int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, MCONTACT *phContact, cookie_message_data **ppvExtra) { icq_lock l(cookieMutex); @@ -277,7 +277,7 @@ cookie_message_data* CIcqProto::CreateMessageCookie(WORD bMsgType, BYTE bAckType } -cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HCONTACT hContact, DWORD dwUin, int bUseSrvRelay) +cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, MCONTACT hContact, DWORD dwUin, int bUseSrvRelay) { BYTE bAckType; WORD wStatus = getContactStatus(hContact); diff --git a/protocols/IcqOscarJ/src/cookies.h b/protocols/IcqOscarJ/src/cookies.h index a6017d174c..a16f32b837 100644 --- a/protocols/IcqOscarJ/src/cookies.h +++ b/protocols/IcqOscarJ/src/cookies.h @@ -49,7 +49,7 @@ struct CIcqProto; struct icq_cookie_info { DWORD dwCookie; - HCONTACT hContact; + MCONTACT hContact; void *pvExtra; time_t dwTime; BYTE bType; @@ -114,7 +114,7 @@ struct cookie_search struct cookie_avatar { DWORD dwUin; - HCONTACT hContact; + MCONTACT hContact; unsigned int hashlen; BYTE *hash; unsigned int cbData; @@ -124,7 +124,7 @@ struct cookie_avatar struct cookie_reverse_connect: public cookie_message_data { - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; int type; void *ft; diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp index fa42c76c7b..32a5186511 100644 --- a/protocols/IcqOscarJ/src/directpackets.cpp +++ b/protocols/IcqOscarJ/src/directpackets.cpp @@ -75,7 +75,7 @@ void CIcqProto::icq_sendDirectMsgAck(directconnect* dc, WORD wCookie, BYTE bMsgT } -DWORD CIcqProto::icq_sendGetAwayMsgDirect(HCONTACT hContact, int type) +DWORD CIcqProto::icq_sendGetAwayMsgDirect(MCONTACT hContact, int type) { icq_packet packet; DWORD dwCookie; @@ -123,7 +123,7 @@ void CIcqProto::icq_sendAwayMsgReplyDirect(directconnect* dc, WORD wCookie, BYTE } -void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft) +void CIcqProto::icq_sendFileAcceptDirect(MCONTACT hContact, filetransfer* ft) { // v7 packet icq_packet packet; @@ -144,7 +144,7 @@ void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft) } -void CIcqProto::icq_sendFileDenyDirect(HCONTACT hContact, filetransfer *ft, const char *szReason) +void CIcqProto::icq_sendFileDenyDirect(MCONTACT hContact, filetransfer *ft, const char *szReason) { // v7 packet icq_packet packet; @@ -233,7 +233,7 @@ int CIcqProto::icq_sendFileSendDirectv8(filetransfer *ft, const char *pszFiles) } -DWORD CIcqProto::icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap) +DWORD CIcqProto::icq_SendDirectMessage(MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap) { icq_packet packet; DWORD dwCookie = AllocateCookie(CKT_MESSAGE, 0, hContact, (void*)pCookieData); @@ -257,7 +257,7 @@ DWORD CIcqProto::icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, return 0; // Failure } -void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType) +void CIcqProto::icq_sendXtrazRequestDirect(MCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType) { icq_packet packet; @@ -272,7 +272,7 @@ void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, ch SendDirectMessage(hContact, &packet); } -void CIcqProto::icq_sendXtrazResponseDirect(HCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType) +void CIcqProto::icq_sendXtrazResponseDirect(MCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType) { icq_packet packet; diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index a2f5ec6ac4..0e18163289 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -528,10 +528,10 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header } -char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume) +char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, MCONTACT *hContactResume) { char* szList; - HCONTACT hContact; + MCONTACT hContact; WORD wCurrentLen = 0; DWORD dwUIN; uid_str szUID; @@ -611,7 +611,7 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResum void CIcqProto::sendEntireListServ(WORD wFamily, WORD wSubtype, int listType) { - HCONTACT hResumeContact = NULL; + MCONTACT hResumeContact = NULL; do { // server doesn't seem to be able to cope with packets larger than 8k diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index af5d7a0fb7..65459c516a 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -47,7 +47,7 @@ void CIcqProto::handleLocationFam(BYTE *pBuffer, WORD wBufferLength, snac_header case ICQ_ERROR: { WORD wError; - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_fam15_data *pCookieData; @@ -124,17 +124,17 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie wLen -= 2; // Determine contact - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); // Ignore away status if the user is not already on our list - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == INVALID_CONTACT_ID) { #ifdef _DEBUG debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID)); #endif return; } - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData)) { debugLogA("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID)); return; diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 9b1f01444c..c3c8098b98 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -196,8 +196,8 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info) wLen -= 2; // Ignore status notification if the user is not already on our list - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + if (hContact == INVALID_CONTACT_ID) { #ifdef _DEBUG debugLogA("Ignoring user online (%s)", strUID(dwUIN, szUID)); @@ -618,10 +618,10 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) } // Determine contact - HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL); // Skip contacts that are not already on our list or are already offline - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { WORD wOldStatus = getContactStatus(hContact); @@ -666,7 +666,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen) } -void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain) +void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, oscar_tlv_chain *pChain) { DWORD dwStatusNoteTS = time(NULL); BYTE *pStatusNoteTS, *pStatusNote; diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index be7d453e55..b9c227d10b 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -200,7 +200,7 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef } -char* CIcqProto::convertMsgToUserSpecificUtf(HCONTACT hContact, const char *szMsg) +char* CIcqProto::convertMsgToUserSpecificUtf(MCONTACT hContact, const char *szMsg) { WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage); char *usMsg = NULL; @@ -268,7 +268,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char * PROTORECVEVENT pre = {0}; int bAdded; - HCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); while (pMessageTLV = pChain->getTLV(0x0101, wMsgPart)) { // Loop thru all message parts @@ -468,7 +468,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * if (CompareGUIDs(q1,q2,q3,q4, MCAP_SRV_RELAY_FMT)) { // we surely have at least 4 bytes for TLV chain - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 1) { @@ -504,7 +504,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * WORD wAckType = chain->getWord(0x0A, 1); // Update the saved DC info (if contact already exists) - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { DWORD dwIP, dwExternalIP; WORD wPort; @@ -575,8 +575,8 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * unpackLEDWord(&buf, &dwUin); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUIN(dwUin, NULL); + if (hContact == INVALID_CONTACT_ID) { debugLogA("Error: %s from unknown contact %u", "Reverse Connect Request", dwUin); } @@ -648,7 +648,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char * } -void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType) +void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType) { WORD wId; @@ -677,7 +677,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, unpackLEWord(&pDataBuf, &wVersion); wLen -= 2; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) setWord(hContact, "Version", wVersion); unpackDWord(&pDataBuf, &dwGuid1); // plugin type GUID @@ -886,7 +886,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, } -void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion) +void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion) { int nTypeId; WORD wFunction; @@ -1020,7 +1020,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hCo void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 0) { // received contacts @@ -1231,7 +1231,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha else if (wCommand == 2) { // acknowledgement DWORD dwCookie; - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (FindMessageCookie(dwID1, dwID2, &dwCookie, &hCookieContact, NULL)) { if (hCookieContact != hContact) debugLogA("Warning: Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact); @@ -1619,9 +1619,9 @@ void packPluginTypeId(icq_packet *packet, int nTypeID) } -void CIcqProto::handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags) +void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == INVALID_CONTACT_ID) { debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin); return; } @@ -1649,10 +1649,10 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD { if (bFlags == 3) { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) { @@ -1684,7 +1684,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD /* this function send all acks from handleMessageTypes */ -void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs) +void CIcqProto::sendMessageTypesAck(MCONTACT hContact, int bUnicode, message_ack_params *pArgs) { if (pArgs) { @@ -1709,7 +1709,7 @@ void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack /* pMsg points to the beginning of the message */ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, DWORD dwMsgID, DWORD dwMsgID2, WORD wCookie, WORD wVersion, int type, int flags, WORD wAckType, DWORD dwDataLen, WORD wMsgLen, char *pMsg, int nMsgFlags, message_ack_params *pAckParams) { - HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; + MCONTACT hContact = INVALID_CONTACT_ID; BOOL bThruDC = (nMsgFlags & MTF_DIRECT) == MTF_DIRECT; int bAdded; @@ -2205,12 +2205,12 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); buf += 2; // 3. unknown wLen -= 2; - HCONTACT hCookieContact; + MCONTACT hCookieContact; if (!FindMessageCookie(dwMsgID1, dwMsgID2, &dwCookie, &hCookieContact, &pCookieData)) { debugLogA("SNAC(4.B) Received an ack that I did not ask for from (%u)", dwUin); return; @@ -2307,7 +2307,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d // An ack of some kind int ackType; - if (hContact == NULL || hContact == (HCONTACT)INVALID_HANDLE_VALUE) { + if (hContact == NULL || hContact == INVALID_CONTACT_ID) { debugLogA("SNAC(4.B) Message from unknown contact (%u)", dwUin); ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe return; @@ -2522,7 +2522,7 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD { WORD wError; char *pszErrorMessage; - HCONTACT hContact; + MCONTACT hContact; cookie_message_data *pCookieData = NULL; int nMessageType; @@ -2690,7 +2690,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque // Sender if (!unpackUID(&buf, &wLen, &dwUin, &szUID)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (FindCookie((WORD)dwSequence, NULL, (void**)&pCookieData)) { @@ -2698,7 +2698,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque // server ack should be ignored here. if (pCookieData && (pCookieData->nAckType == ACKTYPE_SERVER)) { - if ((hContact != NULL) && (hContact != (HCONTACT)INVALID_HANDLE_VALUE)) + if ((hContact != NULL) && (hContact != INVALID_CONTACT_ID)) { int ackType; int ackRes = ACKRESULT_SUCCESS; @@ -2889,9 +2889,9 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR // Sender if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUid, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) return; + if (hContact == INVALID_CONTACT_ID) return; // Typing notification code unpackWord(&buf, &wNotification); @@ -2934,7 +2934,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR } -void CIcqProto::sendTypingNotification(HCONTACT hContact, WORD wMTNCode) +void CIcqProto::sendTypingNotification(MCONTACT hContact, WORD wMTNCode) { _ASSERTE((wMTNCode == MTN_FINISHED) || (wMTNCode == MTN_TYPED) || (wMTNCode == MTN_BEGUN) || (wMTNCode == MTN_WINDOW_CLOSED)); diff --git a/protocols/IcqOscarJ/src/fam_09bos.cpp b/protocols/IcqOscarJ/src/fam_09bos.cpp index 203ba13b00..98c0f58126 100644 --- a/protocols/IcqOscarJ/src/fam_09bos.cpp +++ b/protocols/IcqOscarJ/src/fam_09bos.cpp @@ -85,7 +85,7 @@ void CIcqProto::handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLen debugLogA("Warning: Malformed SRV_PRIVACY_RIGHTS_REPLY"); } -void CIcqProto::makeContactTemporaryVisible(HCONTACT hContact) +void CIcqProto::makeContactTemporaryVisible(MCONTACT hContact) { DWORD dwUin; uid_str szUid; diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index fe15da519c..a0d238cb99 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -772,9 +772,9 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) } -HCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded) +MCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded) { - HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; + MCONTACT hContact = INVALID_CONTACT_ID; if (!IsStringUIN(szRecordName)) { // probably AIM contact @@ -904,12 +904,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server case SSI_ITEM_BUDDY: { /* this is a contact */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { int bRegroup = 0; int bNicked = 0; @@ -1172,12 +1172,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on visible list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1211,12 +1211,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* Item on invisible list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1269,12 +1269,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server /* item on ignore list */ /* wItemId not related to contact ID */ /* pszRecordName is the UIN */ - HCONTACT hContact; + MCONTACT hContact; int bAdded; hContact = HContactFromRecordName(szRecordName, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact != INVALID_CONTACT_ID) { if (bAdded) { @@ -1471,9 +1471,9 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData) { - HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; + MCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY) + if (hContact != INVALID_CONTACT_ID && wItemType == SSI_ITEM_BUDDY) { // a contact was updated on server if (pItemData) { @@ -1586,9 +1586,9 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData) { - HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; + MCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL; - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY) + if (hContact != INVALID_CONTACT_ID && wItemType == SSI_ITEM_BUDDY) { // a contact was removed from our list if (getWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId) { @@ -1632,7 +1632,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen) if (wReasonLen > wLen) return; - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); PROTORECVEVENT pre = { 0 }; pre.timestamp = time(NULL); @@ -1720,7 +1720,7 @@ void CIcqProto::handleRecvAdded(unsigned char *buf, WORD wLen) return; } - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); cbBlob=sizeof(DWORD)*2+4; @@ -1782,8 +1782,8 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen) return; } - HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded); + if (hContact != INVALID_CONTACT_ID) szNick = NickFromHandle(hContact); if (wLen > 0) diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index bedd63885b..b120bc0fb0 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -88,7 +88,7 @@ void CIcqProto::handleExtensionError(BYTE *buf, WORD wPackLen) // more sofisticated detection, send ack if (wSubType == META_REQUEST_FULL_INFO) { - HCONTACT hContact; + MCONTACT hContact; cookie_fam15_data *pCookieData = NULL; int foundCookie = FindCookie(wCookie, &hContact, (void**)&pCookieData); @@ -578,7 +578,7 @@ UserInfoRecordItem rInterest[] = { }; -int CIcqProto::parseUserInfoRecord(HCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords) +int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords) { int nRecords = 0; @@ -648,7 +648,7 @@ void CIcqProto::handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WOR } cookie_directory_data *pCookieData; - HCONTACT hContact; + MCONTACT hContact; // check request cookie if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData) { @@ -843,7 +843,7 @@ static int calcAgeFromBirthDate(double dDate) } -void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType) +void CIcqProto::parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType) { oscar_tlv *pTLV; WORD wRecordCount; @@ -862,7 +862,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain dwUin = atoi(szUid); hContact = HContactFromUID(dwUin, szUid, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) { debugLogA("Error: Received details for unknown contact \"%s\"", szUid); SAFE_FREE(&szUid); @@ -1152,7 +1152,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO } cookie_directory_data *pCookieData; - HCONTACT hContact; + MCONTACT hContact; // check request cookie if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData) { diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index a8eba258f9..aa3ee36ba9 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -205,7 +205,7 @@ BYTE* calcMD5HashOfFile(const TCHAR *tszFile) } -int CIcqProto::IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen) +int CIcqProto::IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, int nHashLen) { DBVARIANT dbvSaved = {0}; @@ -451,7 +451,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY // handle Contact's avatar hash -void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus) +void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus) { int bJob = FALSE; BOOL avatarInfoPresent = FALSE; @@ -696,7 +696,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hCont // request avatar data from server -int CIcqProto::GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) +int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) { uid_str szUidData; char *pszUid = NULL; @@ -803,7 +803,7 @@ int CIcqProto::GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, // upload avatar data to server -int CIcqProto::SetAvatarData(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) +int CIcqProto::SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) { m_avatarsMutex->Enter(); @@ -958,7 +958,7 @@ void avatars_server_connection::shutdownConnection() Netlib_Shutdown(hConnection); } -DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) +DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file) { int i; DWORD dwNow = GetTickCount(); @@ -1055,7 +1055,7 @@ DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT hContact, DWORD d } -DWORD avatars_server_connection::sendUploadAvatarRequest(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) +DWORD avatars_server_connection::sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen) { cookie_avatar *ack = (cookie_avatar*)SAFE_MALLOC(sizeof(cookie_avatar)); if (!ack) return 0; // Failure: out of memory diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h index 4323ffda8b..899521929e 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.h +++ b/protocols/IcqOscarJ/src/icq_avatar.h @@ -69,7 +69,7 @@ protected: rates *m_rates; icq_critical_section *m_ratesMutex; - HCONTACT runContact[4]; + MCONTACT runContact[4]; DWORD runTime[4]; int runCount; void checkRequestQueue(); @@ -85,8 +85,8 @@ public: __inline BOOL isPending() { return !isLoggedIn; }; __inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; }; - DWORD sendGetAvatarRequest(HCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); - DWORD sendUploadAvatarRequest(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); + DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); + DWORD sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); }; __inline static void SAFE_DELETE(avatars_server_connection **p) { SAFE_DELETE((lockable_struct**)p); }; @@ -95,7 +95,7 @@ __inline static void SAFE_DELETE(avatars_server_connection **p) { SAFE_DELETE((l struct avatars_request : public MZeroedObject { int type; - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; uid_str szUid; BYTE *hash; diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 2ea61ae5e2..198bbd2ade 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -186,7 +186,7 @@ const char* cliQip = "QIP %s"; const char* cliIM2 = "IM2"; const char* cliSpamBot = "Spam Bot"; -const char* CIcqProto::detectUserClient(HCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, +const char* CIcqProto::detectUserClient(MCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, /* ICQ specific */ BYTE *caps, WORD wLen, /* Client capabilities */ BYTE *bClientId, /* Output: detected client-type */ diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index c54d389a53..f605d7605d 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -29,12 +29,12 @@ // ----------------------------------------------------------------------------- #include "icqoscar.h" -int CIcqProto::getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv) +int CIcqProto::getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv) { return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0); } -double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef) +double CIcqProto::getSettingDouble(MCONTACT hContact, const char *szSetting, double dDef) { DBVARIANT dbv = {DBVT_DELETED}; double dRes; @@ -51,12 +51,12 @@ double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, dou return dRes; } -DWORD CIcqProto::getContactUin(HCONTACT hContact) +DWORD CIcqProto::getContactUin(MCONTACT hContact) { return getDword(hContact, UNIQUEIDSETTING, 0); } -int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) +int CIcqProto::getContactUid(MCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) { DBVARIANT dbv = {DBVT_DELETED}; int iRes = 1; @@ -82,7 +82,7 @@ int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid) return iRes; } -char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szModule, const char *szSetting, char *szDef) +char* CIcqProto::getSettingStringUtf(MCONTACT hContact, const char *szModule, const char *szSetting, char *szDef) { DBVARIANT dbv = {DBVT_DELETED}; if ( db_get_utf(hContact, szModule, szSetting, &dbv)) { @@ -95,17 +95,17 @@ char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szModule, co return szRes; } -char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef) +char* CIcqProto::getSettingStringUtf(MCONTACT hContact, const char *szSetting, char *szDef) { return getSettingStringUtf(hContact, m_szModuleName, szSetting, szDef); } -WORD CIcqProto::getContactStatus(HCONTACT hContact) +WORD CIcqProto::getContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -int CIcqProto::getSettingStringStatic(HCONTACT hContact, const char *szSetting, char *dest, int dest_len) +int CIcqProto::getSettingStringStatic(MCONTACT hContact, const char *szSetting, char *dest, int dest_len) { if (!db_get_static(hContact, m_szModuleName, szSetting, dest, dest_len)) return 0; @@ -113,17 +113,17 @@ int CIcqProto::getSettingStringStatic(HCONTACT hContact, const char *szSetting, return db_get_static_utf(hContact, m_szModuleName, szSetting, dest, dest_len); } -int CIcqProto::setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue) +int CIcqProto::setSettingDouble(MCONTACT hContact, const char *szSetting, double dValue) { return setSettingBlob(hContact, szSetting, (BYTE*)&dValue, sizeof(double)); } -int CIcqProto::setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue) +int CIcqProto::setSettingBlob(MCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue) { return db_set_blob(hContact, m_szModuleName, szSetting, (void*)pValue, cbValue); } -int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden) +int CIcqProto::setContactHidden(MCONTACT hContact, BYTE bHidden) { int nResult = db_set_b(hContact, "CList", "Hidden", bHidden); if (!bHidden) // clear zero setting @@ -132,7 +132,7 @@ int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden) return nResult; } -void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi) +void CIcqProto::setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAnsi) { if (szStatusMsg && szStatusMsg[0]) { if (isAnsi) { @@ -171,14 +171,14 @@ void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAns else db_unset(hContact, "CList", "StatusMsg"); } -int CIcqProto::IsICQContact(HCONTACT hContact) +int CIcqProto::IsICQContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); return !strcmpnull(szProto, m_szModuleName); } -HANDLE CIcqProto::AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob) +HANDLE CIcqProto::AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = m_szModuleName; @@ -190,9 +190,9 @@ HANDLE CIcqProto::AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD fl return db_event_add(hContact, &dbei); } -HCONTACT CIcqProto::FindFirstContact() +MCONTACT CIcqProto::FindFirstContact() { - HCONTACT hContact = db_find_first(m_szModuleName); + MCONTACT hContact = db_find_first(m_szModuleName); if (IsICQContact(hContact)) return hContact; @@ -200,7 +200,7 @@ HCONTACT CIcqProto::FindFirstContact() return FindNextContact(hContact); } -HCONTACT CIcqProto::FindNextContact(HCONTACT hContact) +MCONTACT CIcqProto::FindNextContact(MCONTACT hContact) { hContact = db_find_next(hContact, m_szModuleName); while (hContact != NULL) @@ -212,7 +212,7 @@ HCONTACT CIcqProto::FindNextContact(HCONTACT hContact) return hContact; } -char* CIcqProto::getContactCListGroup(HCONTACT hContact) +char* CIcqProto::getContactCListGroup(MCONTACT hContact) { return getSettingStringUtf(hContact, "CList", "Group", NULL); } diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 095ad7734e..0369bdd8b9 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -34,7 +34,7 @@ struct directthreadstartinfo int type; // Only valid for outgoing connections int incoming; // 1=incoming, 0=outgoing HANDLE hConnection; // only valid for incoming connections, handle to the connection - HCONTACT hContact; // Only valid for outgoing connections + MCONTACT hContact; // Only valid for outgoing connections void* pvExtra; // Only valid for outgoing connections }; @@ -48,7 +48,7 @@ static char client_check_data[] = { "ICQ Service and Information may\0" }; -void CIcqProto::CloseContactDirectConns(HCONTACT hContact) +void CIcqProto::CloseContactDirectConns(MCONTACT hContact) { icq_lock l(directConnListMutex); @@ -116,7 +116,7 @@ int CIcqProto::sendDirectPacket(directconnect* dc, icq_packet* pkt) return nResult; } -directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int type) +directthreadstartinfo* CreateDTSI(MCONTACT hContact, HANDLE hConnection, int type) { directthreadstartinfo* dtsi = (directthreadstartinfo*)SAFE_MALLOC(sizeof(directthreadstartinfo)); dtsi->hContact = hContact; @@ -131,7 +131,7 @@ directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int typ // Check if we have an open and initialized DC with type // 'type' to the specified contact -BOOL CIcqProto::IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive) +BOOL CIcqProto::IsDirectConnectionOpen(MCONTACT hContact, int type, int bPassive) { BOOL bIsOpen = FALSE, bIsCreated = FALSE; @@ -182,7 +182,7 @@ void icq_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pE } // Opens direct connection of specified type to specified contact -void CIcqProto::OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra) +void CIcqProto::OpenDirectConnection(MCONTACT hContact, int type, void* pvExtra) { // Create a new connection directthreadstartinfo* dtsi = CreateDTSI(hContact, NULL, type); @@ -596,7 +596,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) DWORD dwUin; DWORD dwPort; DWORD dwCookie; - HCONTACT hContact; + MCONTACT hContact; if (wLen != 0x30) { @@ -639,7 +639,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) if (dc->dwRemoteUin || !dc->dwReqId) { // OMG! Licq sends on reverse connection empty uin hContact = HContactFromUIN(dc->dwRemoteUin, NULL); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) { NetLog_Direct("Error: Received PEER_INIT from %u not on my list", dwUin); CloseDirectConnection(dc); @@ -1009,7 +1009,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) } // This should be called only if connection already exists -int CIcqProto::SendDirectMessage(HCONTACT hContact, icq_packet *pkt) +int CIcqProto::SendDirectMessage(MCONTACT hContact, icq_packet *pkt) { icq_lock l(directConnListMutex); diff --git a/protocols/IcqOscarJ/src/icq_direct.h b/protocols/IcqOscarJ/src/icq_direct.h index 76ccd0d2dc..bb8c38d29f 100644 --- a/protocols/IcqOscarJ/src/icq_direct.h +++ b/protocols/IcqOscarJ/src/icq_direct.h @@ -39,7 +39,7 @@ struct filetransfer: public basic_filetransfer DWORD dwCookie; DWORD dwUin; DWORD dwRemotePort; - HCONTACT hContact; + MCONTACT hContact; char *szFilename; char *szDescription; char *szSavePath; @@ -68,7 +68,7 @@ struct filetransfer: public basic_filetransfer struct directconnect { - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; DWORD dwConnectionCookie; int type; diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp index d5a4ccdced..df34189cb0 100644 --- a/protocols/IcqOscarJ/src/icq_directmsg.cpp +++ b/protocols/IcqOscarJ/src/icq_directmsg.cpp @@ -165,7 +165,7 @@ void CIcqProto::handleDirectMessage(directconnect* dc, PBYTE buf, WORD wLen) } else { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) @@ -303,7 +303,7 @@ void CIcqProto::handleDirectGreetingMessage(directconnect* dc, PBYTE buf, WORD w } else if (typeId && wCommand == DIRECT_ACK) { - HCONTACT hCookieContact; + MCONTACT hCookieContact; cookie_message_data *pCookieData = NULL; if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index fa4c3942d1..eeb0f7313d 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -33,7 +33,7 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, { char* pszFileName = NULL; DWORD dwFileSize; - HCONTACT hCookieContact; + MCONTACT hCookieContact; WORD wPort; WORD wFilenameLength; filetransfer* ft; @@ -107,7 +107,7 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, OpenDirectConnection(ft->hContact, DIRECTCONN_FILE, ft); } -filetransfer* CIcqProto::CreateFileTransfer(HCONTACT hContact, DWORD dwUin, int nVersion) +filetransfer* CIcqProto::CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int nVersion) { filetransfer *ft = CreateIcqFileTransfer(); @@ -154,7 +154,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCoo wLen -= 4; int bAdded; - HCONTACT hContact = HContactFromUIN(dwUin, &bAdded); + MCONTACT hContact = HContactFromUIN(dwUin, &bAdded); // Initialize a filetransfer struct filetransfer *ft = CreateFileTransfer(hContact, dwUin, nVersion); @@ -191,7 +191,7 @@ void CIcqProto::handleDirectCancel(directconnect *dc, PBYTE buf, WORD wLen, WORD // ******************************************************************************* -void CIcqProto::icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft) +void CIcqProto::icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft) { DWORD dwCookie; diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 969607b6be..3771044872 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -55,7 +55,7 @@ void CIcqProto::icq_InitInfoUpdate(void) // Returns TRUE if user was queued // Returns FALSE if the list was full -BOOL CIcqProto::icq_QueueUser(HCONTACT hContact) +BOOL CIcqProto::icq_QueueUser(MCONTACT hContact) { if ( !infoUpdateMutex ) return FALSE; @@ -155,7 +155,7 @@ void CIcqProto::icq_RescanInfoUpdate() bInfoUpdateEnabled = 0; // freeze thread // Queue all outdated users - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact != NULL) { if (IsMetaInfoChanged(hContact)) diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index 5538103a41..f06e5eea20 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -39,7 +39,7 @@ static int sttCompareProtocols(const CIcqProto *p1, const CIcqProto *p2) LIST g_Instances(1, sttCompareProtocols); -static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact) +static CIcqProto* IcqGetInstanceByHContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); if (szProto == NULL) @@ -54,37 +54,37 @@ static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact) static INT_PTR IcqMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->RequestAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->GrantAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleRevokeAuth(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->RevokeAuthorization(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleAddServContact(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->AddServerContact(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleXStatusDetails(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->ShowXStatusDetails(wParam, lParam) : 0; } static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam) { - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OpenWebProfile(wParam, lParam) : 0; } @@ -97,7 +97,7 @@ static int IcqPrebuildContactMenu( WPARAM wParam, LPARAM lParam ) Menu_ShowItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], FALSE); Menu_ShowItem(g_hContactMenuItems[ICMI_OPEN_PROFILE], FALSE); - CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam); + CIcqProto* ppro = IcqGetInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->OnPreBuildContactMenu(wParam, lParam) : 0; } @@ -177,7 +177,7 @@ void g_MenuUninit(void) INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DWORD dwUin = getContactUin(hContact); char url[256]; mir_snprintf(url, sizeof(url), "http://www.icq.com/people/%d",dwUin); @@ -187,7 +187,7 @@ INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam) int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) return 0; diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index ba3572b61f..b34a8b780a 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -200,7 +200,7 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE; } -int CIcqProto::ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType) +int CIcqProto::ShowPopupMsg(MCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType) { if (bPopupService && getByte("PopupsEnabled", DEFAULT_POPUPS_ENABLED)) { diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 6754e296c8..bfe5e66277 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -291,7 +291,7 @@ int CIcqProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) ModuleLoad(0, 0); InitXStatusItems(FALSE); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact != NULL) { DWORD bXStatus = getContactXStatus(hContact); if (bXStatus > 0) @@ -316,7 +316,7 @@ int CIcqProto::OnPreShutdown(WPARAM wParam, LPARAM lParam) //////////////////////////////////////////////////////////////////////////////////////// // PS_AddToList - adds a contact to the contact list -HCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { if (psr) { if (psr->cbSize == sizeof(ICQSEARCHRESULT)) { @@ -354,7 +354,7 @@ HCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return 0; // Failure } -HCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DWORD uin = 0; uid_str uid = { 0 }; @@ -420,8 +420,8 @@ HCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDb int CIcqProto::Authorize(HANDLE hDbEvent) { if (icqOnline() && hDbEvent) { - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; DWORD uin; @@ -446,8 +446,8 @@ int CIcqProto::Authorize(HANDLE hDbEvent) int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) { if (icqOnline() && hDbEvent) { - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; DWORD uin; @@ -470,7 +470,7 @@ int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CIcqProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { setContactHidden(hContact, 0); ICQAddRecvEvent(NULL, EVENTTYPE_AUTHREQUEST, pre, pre->lParam, (PBYTE)pre->szMessage, 0); @@ -480,7 +480,7 @@ int __cdecl CIcqProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CIcqProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { if (!icqOnline()) return 1; @@ -515,7 +515,7 @@ HANDLE __cdecl CIcqProto::ChangeInfo(int iInfoType, void* pInfoData) //////////////////////////////////////////////////////////////////////////////////////// // PS_FileAllow - starts a file transfer -HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath) +HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath) { DWORD dwUin; uid_str szUid; @@ -558,7 +558,7 @@ HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const T //////////////////////////////////////////////////////////////////////////////////////// // PS_FileCancel - cancels a file transfer -int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { DWORD dwUin; uid_str szUid; @@ -588,7 +588,7 @@ int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // PS_FileDeny - denies a file transfer -int __cdecl CIcqProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason) +int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason) { int nReturnValue = 1; DWORD dwUin; @@ -657,7 +657,7 @@ int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact) { DWORD_PTR nReturn = 0; @@ -742,7 +742,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CIcqProto::GetInfo(HCONTACT hContact, int infoType) +int __cdecl CIcqProto::GetInfo(MCONTACT hContact, int infoType) { if (icqOnline()) { DWORD dwUin; @@ -923,7 +923,7 @@ HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage; int i; @@ -974,7 +974,7 @@ int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) +int __cdecl CIcqProto::RecvFile(MCONTACT hContact, PROTORECVFILET* evt) { return Proto_RecvFile(hContact, evt); } @@ -983,7 +983,7 @@ int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { DWORD cbBlob; DWORD flags = 0; @@ -1009,7 +1009,7 @@ int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CIcqProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -1018,7 +1018,7 @@ int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { if (hContact && hContactsList) { int i; @@ -1289,7 +1289,7 @@ int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) +HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) { if (!icqOnline()) return 0; @@ -1391,7 +1391,7 @@ HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription //////////////////////////////////////////////////////////////////////////////////////// // PS_SendMessage - sends a message -int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { if (hContact == NULL || pszSrc == NULL) return NULL; @@ -1581,7 +1581,7 @@ int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url) +int __cdecl CIcqProto::SendUrl(MCONTACT hContact, int flags, const char* url) { if (hContact == NULL || url == NULL) return 0; @@ -1646,7 +1646,7 @@ int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url) //////////////////////////////////////////////////////////////////////////////////////// // PS_SetApparentMode - sets the visibility status -int __cdecl CIcqProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CIcqProto::SetApparentMode(MCONTACT hContact, int mode) { DWORD uin; uid_str uid; @@ -1840,7 +1840,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus) struct status_message_thread_data { - HCONTACT hContact; + MCONTACT hContact; char *szMessage; HANDLE hProcess; }; @@ -1866,7 +1866,7 @@ void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData) //////////////////////////////////////////////////////////////////////////////////////// // PS_GetAwayMsg - returns a contact's away message -HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CIcqProto::GetAwayMsg(MCONTACT hContact) { DWORD dwUin; uid_str szUID; @@ -1949,7 +1949,7 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG - processes received status mode message -int __cdecl CIcqProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt) +int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt) { if (evt->flags & PREF_UTF) { setStatusMsgVar(hContact, evt->szMessage, false); @@ -2039,7 +2039,7 @@ INT_PTR CIcqProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // PS_UserIsTyping - sends a UTN notification -int __cdecl CIcqProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CIcqProto::UserIsTyping(MCONTACT hContact, int type) { if (hContact && icqOnline()) { if (CheckContactCapabilities(hContact, CAPF_TYPING)) { diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 44e23e627f..1f8e28dcdf 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -41,7 +41,7 @@ struct userinfo { DWORD dwUin; - HCONTACT hContact; + MCONTACT hContact; time_t queued; }; @@ -54,23 +54,23 @@ struct CIcqProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR *id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR *email); @@ -78,24 +78,24 @@ struct CIcqProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -127,7 +127,7 @@ struct CIcqProto : public PROTO INT_PTR __cdecl OnCreateAccMgrUI(WPARAM, LPARAM); //====| Events |====================================================================== - void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact); + void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONTACT hContact); int __cdecl OnIdleChanged(WPARAM, LPARAM); int __cdecl OnModernOptInit(WPARAM, LPARAM); int __cdecl OnModulesLoaded(WPARAM, LPARAM); @@ -138,8 +138,8 @@ struct CIcqProto : public PROTO int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM); int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM); int __cdecl OnReloadIcons(WPARAM, LPARAM); - void __cdecl OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT hContact); - void __cdecl OnRenameGroup( DBCONTACTWRITESETTING *cws, HCONTACT hContact); + void __cdecl OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact); + void __cdecl OnRenameGroup( DBCONTACTWRITESETTING *cws, MCONTACT hContact); int __cdecl OnUserInfoInit(WPARAM, LPARAM); int __cdecl OnPreBuildStatusMenu(WPARAM, LPARAM); @@ -182,22 +182,22 @@ struct CIcqProto : public PROTO //----| capabilities.cpp |------------------------------------------------------------ // Deletes all oscar capabilities for a given contact. - void ClearAllContactCapabilities(HCONTACT hContact); + void ClearAllContactCapabilities(MCONTACT hContact); // Deletes one or many oscar capabilities for a given contact. - void ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + void ClearContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Sets one or many oscar capabilities for a given contact. - void SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + void SetContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Returns true if the given contact supports the requested capabilites. - BOOL CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities); + BOOL CheckContactCapabilities(MCONTACT hContact, DWORD fdwCapabilities); // Scans a binary buffer for oscar capabilities and adds them to the contact. - void AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength); + void AddCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength); // Scans a binary buffer for oscar capabilities and sets them to the contact. - void SetCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset); + void SetCapabilitiesFromBuffer(MCONTACT hContact, BYTE *pBuffer, int nLength, BOOL bReset); //----| chan_01login.cpp |------------------------------------------------------------ void handleLoginChannel(BYTE *buf, WORD datalen, serverthread_info *info); @@ -231,7 +231,7 @@ struct CIcqProto : public PROTO LIST cookies; WORD wCookieSeq; - DWORD AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra); + DWORD AllocateCookie(BYTE bType, WORD wIdent, MCONTACT hContact, void *pvExtra); void FreeCookie(DWORD dwCookie); void FreeCookieByData(BYTE bType, void *pvExtra); void ReleaseCookie(DWORD dwCookie); @@ -239,32 +239,32 @@ struct CIcqProto : public PROTO int GetCookieType(DWORD dwCookie); - int FindCookie(DWORD wCookie, HCONTACT *phContact, void **ppvExtra); - int FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact); - int FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void **ppvExtra); - int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra); + int FindCookie(DWORD wCookie, MCONTACT *phContact, void **ppvExtra); + int FindCookieByData(void *pvExtra, DWORD *pdwCookie, MCONTACT *phContact); + int FindCookieByType(BYTE bType, DWORD *pdwCookie, MCONTACT *phContact, void **ppvExtra); + int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, MCONTACT *phContact, cookie_message_data **ppvExtra); void InitMessageCookie(cookie_message_data *pCookie); cookie_message_data* CreateMessageCookie(WORD bMsgType, BYTE bAckType); - cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HCONTACT hContact, DWORD dwUin, int bUseSrvRelay); + cookie_message_data* CreateMessageCookieData(BYTE bMsgType, MCONTACT hContact, DWORD dwUin, int bUseSrvRelay); void RemoveExpiredCookies(void); //----| directpackets.cpp |----------------------------------------------------------- void icq_sendDirectMsgAck(directconnect* dc, WORD wCookie, BYTE bMsgType, BYTE bMsgFlags, char* szCap); - DWORD icq_sendGetAwayMsgDirect(HCONTACT hContact, int type); + DWORD icq_sendGetAwayMsgDirect(MCONTACT hContact, int type); void icq_sendAwayMsgReplyDirect(directconnect *dc, WORD wCookie, BYTE msgType, const char** szMsg); - void icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer *ft); - void icq_sendFileDenyDirect(HCONTACT hContact, filetransfer *ft, const char *szReason); + void icq_sendFileAcceptDirect(MCONTACT hContact, filetransfer *ft); + void icq_sendFileDenyDirect(MCONTACT hContact, filetransfer *ft, const char *szReason); int icq_sendFileSendDirectv7(filetransfer *ft, const char *pszFiles); int icq_sendFileSendDirectv8(filetransfer *ft, const char *pszFiles); - DWORD icq_SendDirectMessage(HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); - void icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType); - void icq_sendXtrazResponseDirect(HCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType); + DWORD icq_SendDirectMessage(MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); + void icq_sendXtrazRequestDirect(MCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType); + void icq_sendXtrazResponseDirect(MCONTACT hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType); //----| fam_01service.cpp |----------------------------------------------------------- void handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header *pSnacHeader, serverthread_info *info); - char* buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume); + char* buildUinList(int subtype, WORD wMaxLen, MCONTACT *hContactResume); void sendEntireListServ(WORD wFamily, WORD wSubtype, int listType); void setUserInfo(void); void handleServUINSettings(int nPort, serverthread_info *info); @@ -278,7 +278,7 @@ struct CIcqProto : public PROTO void handleReplyBuddy(BYTE *buf, WORD wPackLen); void handleUserOffline(BYTE *buf, WORD wPackLen); void handleUserOnline(BYTE *buf, WORD wPackLen, serverthread_info *info); - void parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain); + void parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, oscar_tlv_chain *pChain); void handleNotifyRejected(BYTE *buf, WORD wPackLen); //----| fam_04message.cpp |----------------------------------------------------------- @@ -296,29 +296,29 @@ struct CIcqProto : public PROTO void handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); - void handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags); + void handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags); void handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleMissedMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleOffineMessagesReply(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef); void handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand); void handleRuntimeError(WORD wError); - void parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType); - void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion); + void parseServRelayData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType); + void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, MCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType, BYTE bFlags, WORD wStatus, WORD wCookie, WORD wVersion); HANDLE handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD wVersion, int type, WORD wMsgLen, PBYTE buf, BYTE bFlags, int nMsgFlags); void handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, DWORD dwMsgID, DWORD dwMsgID2, WORD wCookie, WORD wVersion, int type, int flags, WORD wAckType, DWORD dwDataLen, WORD wMsgLen, char *pMsg, int nMsgFlags, message_ack_params *pAckParams); - void sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs); - void sendTypingNotification(HCONTACT hContact, WORD wMTNCode); + void sendMessageTypesAck(MCONTACT hContact, int bUnicode, message_ack_params *pArgs); + void sendTypingNotification(MCONTACT hContact, WORD wMTNCode); int unpackPluginTypeId(BYTE **pBuffer, WORD *pwLen, int *pTypeId, WORD *pFunctionId, BOOL bThruDC); - char* convertMsgToUserSpecificUtf(HCONTACT hContact, const char *szMsg); + char* convertMsgToUserSpecificUtf(MCONTACT hContact, const char *szMsg); //----| fam_09bos.cpp |--------------------------------------------------------------- void handleBosFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader); void handlePrivacyRightsReply(unsigned char *pBuffer, WORD wBufferLength); - void makeContactTemporaryVisible(HCONTACT hContact); + void makeContactTemporaryVisible(MCONTACT hContact); //----| fam_0alookup.cpp |------------------------------------------------------------ void handleLookupFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader); @@ -347,7 +347,7 @@ struct CIcqProto : public PROTO void handleRecvAuthResponse(BYTE *buf, WORD wLen); void handleRecvAdded(BYTE *buf, WORD wLen); - HCONTACT HContactFromRecordName(const char *szRecordName, int *bAdded); + MCONTACT HContactFromRecordName(const char *szRecordName, int *bAdded); void processCListReply(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData); @@ -367,12 +367,12 @@ struct CIcqProto : public PROTO void handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags); void handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wFlags); - int parseUserInfoRecord(HCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords); + int parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords); void handleDirectoryQueryResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype, WORD wFlags); void handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype); - void parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); + void parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); void parseDirectorySearchData(oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType); void parseSearchReplies(unsigned char *databuf, WORD wPacketLen, WORD wCookie, WORD wReplySubtype, BYTE bResultCode); @@ -397,45 +397,45 @@ struct CIcqProto : public PROTO void __cdecl AvatarThread(avatars_server_connection *pInfo); void handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BYTE nDataLen); - void handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus); + void handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus); avatars_request *ReleaseAvatarRequestInQueue(avatars_request *request); TCHAR* GetOwnAvatarFileName(); void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, int cbLen); void GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, int cbLen); - int IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen); + int IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, int nHashLen); - int GetAvatarData(HCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); - int SetAvatarData(HCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); + int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file); + int SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, unsigned int datalen); void StartAvatarThread(HANDLE hConn, char* cookie, WORD cookieLen); void StopAvatarThread(); //----| icq_clients.cpp |------------------------------------------------------------- - const char* detectUserClient(HCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, BYTE *caps, WORD wLen, BYTE *bClientId, char *szClientBuf); + const char* detectUserClient(MCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, BYTE bDirectFlag, DWORD dwDirectCookie, DWORD dwWebPort, BYTE *caps, WORD wLen, BYTE *bClientId, char *szClientBuf); //----| icq_db.cpp |------------------------------------------------------------------ - HANDLE AddEvent(HCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob); - int IsICQContact(HCONTACT hContact); - - HCONTACT FindFirstContact(); - HCONTACT FindNextContact(HCONTACT hContact); - - int getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv); - double getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef); - int getSettingStringStatic(HCONTACT hContact, const char *szSetting, char *dest, int dest_len); - char* getSettingStringUtf(HCONTACT hContact, const char *szModule, const char *szSetting, char *szDef); - char* getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef); - int getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid); - DWORD getContactUin(HCONTACT hContact); - WORD getContactStatus(HCONTACT hContact); - char* getContactCListGroup(HCONTACT hContact); - - int setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue); - int setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue); - int setContactHidden(HCONTACT hContact, BYTE bHidden); - void setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi); + HANDLE AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob); + int IsICQContact(MCONTACT hContact); + + MCONTACT FindFirstContact(); + MCONTACT FindNextContact(MCONTACT hContact); + + int getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv); + double getSettingDouble(MCONTACT hContact, const char *szSetting, double dDef); + int getSettingStringStatic(MCONTACT hContact, const char *szSetting, char *dest, int dest_len); + char* getSettingStringUtf(MCONTACT hContact, const char *szModule, const char *szSetting, char *szDef); + char* getSettingStringUtf(MCONTACT hContact, const char *szSetting, char *szDef); + int getContactUid(MCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid); + DWORD getContactUin(MCONTACT hContact); + WORD getContactStatus(MCONTACT hContact); + char* getContactCListGroup(MCONTACT hContact); + + int setSettingDouble(MCONTACT hContact, const char *szSetting, double dValue); + int setSettingBlob(MCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue); + int setContactHidden(MCONTACT hContact, BYTE bHidden); + void setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAnsi); //----| icq_direct.cpp |-------------------------------------------------------------- icq_critical_section *directConnListMutex; @@ -453,29 +453,29 @@ struct CIcqProto : public PROTO void sendPeerFileInit(directconnect* dc); int sendDirectPacket(directconnect* dc, icq_packet* pkt); - void CloseContactDirectConns(HCONTACT hContact); + void CloseContactDirectConns(MCONTACT hContact); directconnect* FindFileTransferDC(filetransfer* ft); filetransfer* FindExpectedFileRecv(DWORD dwUin, DWORD dwTotalSize); - BOOL IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive); - void OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra); + BOOL IsDirectConnectionOpen(MCONTACT hContact, int type, int bPassive); + void OpenDirectConnection(MCONTACT hContact, int type, void* pvExtra); void CloseDirectConnection(directconnect *dc); - int SendDirectMessage(HCONTACT hContact, icq_packet *pkt); + int SendDirectMessage(MCONTACT hContact, icq_packet *pkt); //----| icq_directmsg.cpp |----------------------------------------------------------- void handleDirectMessage(directconnect* dc, PBYTE buf, WORD wLen); void handleDirectGreetingMessage(directconnect* dc, PBYTE buf, WORD wLen, WORD wCommand, WORD wCookie, BYTE bMsgType, BYTE bMsgFlags, WORD wStatus, WORD wFlags, char* pszText); //----| icq_filerequests.cpp |-------------------------------------------------------- - filetransfer* CreateFileTransfer(HCONTACT hContact, DWORD dwUin, int nVersion); + filetransfer* CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int nVersion); void handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, WORD wStatus, char* pszText); void handleFileRequest(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC); void handleDirectCancel(directconnect *dc, PBYTE buf, WORD wLen, WORD wCommand, DWORD dwCookie, WORD wMessageType, WORD wStatus, WORD wFlags, char* pszText); - void icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft); + void icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft); //----| icq_filetransfer.cpp |-------------------------------------------------------- - void icq_AcceptFileTransfer(HCONTACT hContact, filetransfer *ft); + void icq_AcceptFileTransfer(MCONTACT hContact, filetransfer *ft); void icq_sendFileResume(filetransfer *ft, int action, const char *szFilename); void icq_InitFileSend(filetransfer *ft); @@ -496,7 +496,7 @@ struct CIcqProto : public PROTO void __cdecl InfoUpdateThread(void*); void icq_InitInfoUpdate(void); // Queues all outdated users - BOOL icq_QueueUser(HCONTACT hContact); // Queue one UIN to the list for updating + BOOL icq_QueueUser(MCONTACT hContact); // Queue one UIN to the list for updating void icq_DequeueUser(DWORD dwUin); // Remove one UIN from the list void icq_RescanInfoUpdate(); // Add all outdated contacts to the list void icq_InfoUpdateCleanup(void); // Clean up on exit @@ -526,7 +526,7 @@ struct CIcqProto : public PROTO BOOL unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *ppszUID); //----| icq_popups.cpp |-------------------------------------------------------------- - int ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType); + int ShowPopupMsg(MCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType); //----| icq_proto.cpp |-------------------------------------------------------------- void __cdecl CheekySearchThread( void* ); @@ -605,25 +605,25 @@ struct CIcqProto : public PROTO int servlistPendingSize; servlistpendingitem** servlistPendingList; - int servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup); + int servlistPendingFindItem(int nType, MCONTACT hContact, const char *pszGroup); void servlistPendingAddItem(servlistpendingitem* pItem); - servlistpendingitem* servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup); + servlistpendingitem* servlistPendingRemoveItem(int nType, MCONTACT hContact, const char *pszGroup); - void servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags); + void servlistPendingAddContactOperation(MCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags); void servlistPendingAddGroupOperation(const char *pszGroup, LPARAM param, PENDING_GROUP_CALLBACK callback, DWORD flags); - int servlistPendingAddContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL); + int servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL); int servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = NULL); - void servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult); + void servlistPendingRemoveContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult); void servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult); void servlistPendingFlushOperations(); // server-list support functions int nJustAddedCount; int nJustAddedSize; - HCONTACT* pdwJustAddedList; + MCONTACT* pdwJustAddedList; - void AddJustAddedContact(HCONTACT hContact); - BOOL IsContactJustAdded(HCONTACT hContact); + void AddJustAddedContact(MCONTACT hContact); + BOOL IsContactJustAdded(MCONTACT hContact); void FlushJustAddedContacts(); WORD GenerateServerID(int bGroupType, int bFlags, int wCount = 0); @@ -649,18 +649,18 @@ struct CIcqProto : public PROTO void servlistCreateGroup(const char *szGroupPath, LPARAM param, PENDING_GROUP_CALLBACK callback); int __cdecl servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult); - int __cdecl servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult); - void servlistAddContact(HCONTACT hContact, const char *pszGroup); + int __cdecl servlistAddContact_Ready(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult); + void servlistAddContact(MCONTACT hContact, const char *pszGroup); - int __cdecl servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistRemoveContact(HCONTACT hContact); + int __cdecl servlistRemoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistRemoveContact(MCONTACT hContact); int __cdecl servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNewGroupID, LPARAM lParam, int nResult); - int __cdecl servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistMoveContact(HCONTACT hContact, const char *pszNewGroup); + int __cdecl servlistMoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistMoveContact(MCONTACT hContact, const char *pszNewGroup); - int __cdecl servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); - void servlistUpdateContact(HCONTACT hContact); + int __cdecl servlistUpdateContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult); + void servlistUpdateContact(MCONTACT hContact); int __cdecl servlistRenameGroup_Ready(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult); void servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGroup); @@ -671,20 +671,20 @@ struct CIcqProto : public PROTO void removeGroupPathLinks(WORD wGroupID); int getServListGroupLevel(WORD wGroupId); - void resetServContactAuthState(HCONTACT hContact, DWORD dwUin); + void resetServContactAuthState(MCONTACT hContact, DWORD dwUin); void FlushSrvGroupsCache(); int getCListGroupExists(const char *szGroup); - int moveContactToCListGroup(HCONTACT hContact, const char *szGroup); /// TODO: this should be DB function + int moveContactToCListGroup(MCONTACT hContact, const char *szGroup); /// TODO: this should be DB function DWORD icq_sendServerItem(DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wItemId, const char *szName, BYTE *pTLVs, int nTlvLength, WORD wItemType, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); - DWORD icq_sendServerContact(HCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); + DWORD icq_sendServerContact(MCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject); DWORD icq_sendSimpleItem(DWORD dwCookie, WORD wAction, DWORD dwUin, char* szUID, WORD wGroupId, WORD wItemId, WORD wItemType, DWORD dwOperation, DWORD dwTimeout); DWORD icq_sendServerGroup(DWORD dwCookie, WORD wAction, WORD wGroupId, const char *szName, void *pContent, int cbContent, DWORD dwOperationFlags); - DWORD icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType); - DWORD icq_removeServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); - DWORD icq_addServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); + DWORD icq_modifyServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType); + DWORD icq_removeServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); + DWORD icq_addServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType); int __cdecl ServListDbSettingChanged(WPARAM wParam, LPARAM lParam); int __cdecl ServListDbContactDeleted(WPARAM wParam, LPARAM lParam); @@ -697,11 +697,11 @@ struct CIcqProto : public PROTO void icq_setidle(int bAllow); void icq_setstatus(WORD wStatus, const char *szStatusNote = NULL); - DWORD icq_sendGetInfoServ(HCONTACT hContact, DWORD, int); - DWORD icq_sendGetAimProfileServ(HCONTACT hContact, char *szUid); - DWORD icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD, int, WORD); - DWORD icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion); - DWORD icq_sendGetAimAwayMsgServ(HCONTACT hContact, char *szUID, int type); + DWORD icq_sendGetInfoServ(MCONTACT hContact, DWORD, int); + DWORD icq_sendGetAimProfileServ(MCONTACT hContact, char *szUid); + DWORD icq_sendGetAwayMsgServ(MCONTACT hContact, DWORD, int, WORD); + DWORD icq_sendGetAwayMsgServExt(MCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion); + DWORD icq_sendGetAimAwayMsgServ(MCONTACT hContact, char *szUID, int type); void icq_sendSetAimAwayMsgServ(const char *szMsg); void icq_sendFileSendServv7(filetransfer* ft, const char *szFiles); @@ -719,7 +719,7 @@ struct CIcqProto : public PROTO void icq_sendGenericContact(DWORD dwUin, const char *szUid, WORD wFamily, WORD wSubType); void icq_sendNewContact(DWORD dwUin, const char *szUid); void icq_sendRemoveContact(DWORD dwUin, const char *szUid); - void icq_sendChangeVisInvis(HCONTACT hContact, DWORD dwUin, char* szUID, int list, int add); + void icq_sendChangeVisInvis(MCONTACT hContact, DWORD dwUin, char* szUID, int list, int add); void icq_sendEntireVisInvisList(int); void icq_sendAwayMsgReplyServ(DWORD, DWORD, DWORD, WORD, WORD, BYTE, char **); void icq_sendAwayMsgReplyServExt(DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char **szMsg); @@ -737,11 +737,11 @@ struct CIcqProto : public PROTO void sendOwnerInfoRequest(void); DWORD sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int nItems); - DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData); - DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16 - DWORD icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); - DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData); - DWORD icq_SendChannel4Message(DWORD dwUin, HCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData); + DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, MCONTACT hContact, char *pszText, cookie_message_data *pCookieData); + DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, MCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16 + DWORD icq_SendChannel2Message(DWORD dwUin, MCONTACT hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap); + DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, MCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData); + DWORD icq_SendChannel4Message(DWORD dwUin, MCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData); void icq_sendAdvancedMsgAck(DWORD, DWORD, DWORD, WORD, BYTE, BYTE); void icq_sendContactsAck(DWORD dwUin, char *szUid, DWORD dwMsgID1, DWORD dwMsgID2); @@ -766,10 +766,10 @@ struct CIcqProto : public PROTO void oft_sendFileRedirect(DWORD dwUin, char *szUid, oscar_filetransfer *ft, DWORD dwIP, WORD wPort, int bProxy); //---- | icq_svcs.cpp |---------------------------------------------------------------- - HCONTACT AddToListByUIN(DWORD dwUin, DWORD dwFlags); - HCONTACT AddToListByUID(const char *szUID, DWORD dwFlags); + MCONTACT AddToListByUIN(DWORD dwUin, DWORD dwFlags); + MCONTACT AddToListByUID(const char *szUID, DWORD dwFlags); - void ICQAddRecvEvent(HCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags); + void ICQAddRecvEvent(MCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags); INT_PTR __cdecl IcqAddCapability(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl IcqCheckCapability(WPARAM wParam, LPARAM lParam); @@ -788,22 +788,22 @@ struct CIcqProto : public PROTO HGENMENU hXStatusItems[XSTATUS_COUNT + 1]; void InitXStatusItems(BOOL bAllowStatus); - BYTE getContactXStatus(HCONTACT hContact); - DWORD sendXStatusDetailsRequest(HCONTACT hContact, int bForced); - DWORD requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay); + BYTE getContactXStatus(MCONTACT hContact); + DWORD sendXStatusDetailsRequest(MCONTACT hContact, int bForced); + DWORD requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay); HICON getXStatusIcon(int bStatus, UINT flags); void setXStatusEx(BYTE bXStatus, BYTE bQuiet); - void handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize); + void handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize); void updateServerCustomStatus(int fullUpdate); //----| icq_xtraz.cpp |--------------------------------------------------------------- void handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); - void handleXtrazNotifyResponse(DWORD dwUin, HCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen); + void handleXtrazNotifyResponse(DWORD dwUin, MCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen); void handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); void handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC); - DWORD SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced); + DWORD SendXtrazNotifyRequest(MCONTACT hContact, char* szQuery, char* szNotify, int bForced); void SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szResponse, int nResponseLen, BOOL bThruDC); //----| init.cpp |-------------------------------------------------------------------- @@ -821,12 +821,12 @@ struct CIcqProto : public PROTO filetransfer *CreateIcqFileTransfer(); void ReleaseFileTransfer(void *ft); void SafeReleaseFileTransfer(void **ft); - oscar_filetransfer* FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2); + oscar_filetransfer* FindOscarTransfer(MCONTACT hContact, DWORD dwID1, DWORD dwID2); oscar_listener* CreateOscarListener(oscar_filetransfer *ft, NETLIBNEWCONNECTIONPROC_V2 handler); void ReleaseOscarListener(oscar_listener **pListener); - void OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type); + void OpenOscarConnection(MCONTACT hContact, oscar_filetransfer *ft, int type); void CloseOscarConnection(oscar_connection *oc); int CreateOscarProxyConnection(oscar_connection *oc); @@ -837,10 +837,10 @@ struct CIcqProto : public PROTO void handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand); void handleRecvServResponseOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, void* ft); - HANDLE oftInitTransfer(HCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription); - HANDLE oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - DWORD oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); - DWORD oftFileCancel(HCONTACT hContact, HANDLE hTransfer); + HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription); + HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + DWORD oftFileCancel(MCONTACT hContact, HANDLE hTransfer); void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename); void sendOscarPacket(oscar_connection *oc, icq_packet *packet); @@ -864,17 +864,17 @@ struct CIcqProto : public PROTO int StringToListItemId(const char *szSetting,int def); //----| utilities.cpp |--------------------------------------------------------------- - char* ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg); + char* ConvertMsgToUserSpecificAnsi(MCONTACT hContact, const char* szMsg); char* GetUserStoredPassword(char *szBuffer, int cbSize); char* GetUserPassword(BOOL bAlways); WORD GetMyStatusFlags(); - DWORD ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg); + DWORD ReportGenericSendError(MCONTACT hContact, int nType, const char* szErrorMsg); void SetCurrentStatus(int nStatus); void __cdecl ProtocolAckThread(icq_ack_args* pArguments); - void SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage); + void SendProtoAck(MCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage); int NetLog_Direct(const char *fmt,...); int NetLog_Uni(BOOL bDC, const char *fmt,...); @@ -882,8 +882,8 @@ struct CIcqProto : public PROTO icq_critical_section *contactsCacheMutex; LIST contactsCache; - void AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid); - void DeleteFromContactsCache(HCONTACT hContact); + void AddToContactsCache(MCONTACT hContact, DWORD dwUin, const char *szUid); + void DeleteFromContactsCache(MCONTACT hContact); void InitContactsCache(); void UninitContactsCache(); @@ -892,38 +892,38 @@ struct CIcqProto : public PROTO HANDLE NetLib_BindPort(NETLIBNEWCONNECTIONPROC_V2 pFunc, void* lParam, WORD* pwPort, DWORD* pdwIntIP); - HCONTACT HandleFromCacheByUid(DWORD dwUin, const char *szUid); - HCONTACT HContactFromUIN(DWORD dwUin, int *Added); - HCONTACT HContactFromUID(DWORD dwUin, const char *szUid, int *Added); - HCONTACT HContactFromAuthEvent(HANDLE hEvent); + MCONTACT HandleFromCacheByUid(DWORD dwUin, const char *szUid); + MCONTACT HContactFromUIN(DWORD dwUin, int *Added); + MCONTACT HContactFromUID(DWORD dwUin, const char *szUid, int *Added); + MCONTACT HContactFromAuthEvent(HANDLE hEvent); void ResetSettingsOnListReload(); void ResetSettingsOnConnect(); void ResetSettingsOnLoad(); - int IsMetaInfoChanged(HCONTACT hContact); + int IsMetaInfoChanged(MCONTACT hContact); char *setStatusNoteText, *setStatusMoodData; void __cdecl SetStatusNoteThread(void *pArguments); int SetStatusNote(const char *szStatusNote, DWORD dwDelay, int bForced); int SetStatusMood(const char *szMoodData, DWORD dwDelay); - BOOL writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength); - BOOL writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength); - BOOL writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingString(MCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength); + BOOL writeDbInfoSettingWord(MCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingWordWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingByte(MCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength); + BOOL writeDbInfoSettingByteWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength); - void writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVDate(HCONTACT hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv); - void writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVStringUtf(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVWord(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVByte(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVDouble(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVDate(MCONTACT hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv); + void writeDbInfoSettingTLVBlob(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv); char** MirandaStatusToAwayMsg(int nStatus); - bool validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType); + bool validateStatusMessageRequest(MCONTACT hContact, WORD byMessageType); }; #endif diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h index 7583bf9cb7..60c7ad6769 100644 --- a/protocols/IcqOscarJ/src/icq_rates.h +++ b/protocols/IcqOscarJ/src/icq_rates.h @@ -108,7 +108,7 @@ public: virtual void execute(); - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; char *szUid; }; diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 3de47b821b..e5691b1215 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -192,7 +192,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) StopAvatarThread(); // Offline all contacts - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { DWORD dwUIN; diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index df7fdc753f..e103094c57 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -463,7 +463,7 @@ void CIcqProto::servlistProcessLogin() #define SPOF_AUTO_CREATE_ITEM 0x01 -int CIcqProto::servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup) +int CIcqProto::servlistPendingFindItem(int nType, MCONTACT hContact, const char *pszGroup) { if (servlistPendingList) for (int i = 0; i < servlistPendingCount; i++) @@ -489,7 +489,7 @@ void CIcqProto::servlistPendingAddItem(servlistpendingitem *pItem) } -servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup) +servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, MCONTACT hContact, const char *pszGroup) { // unregister pending item, trigger pending operations int iItem; servlistpendingitem *pItem = NULL; @@ -546,7 +546,7 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hC } -void CIcqProto::servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags) +void CIcqProto::servlistPendingAddContactOperation(MCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags) { // add postponed operation (add contact, update contact, regroup resume, etc.) // - after contact is added int iItem; @@ -599,7 +599,7 @@ void CIcqProto::servlistPendingAddGroupOperation(const char *pszGroup, LPARAM pa } -int CIcqProto::servlistPendingAddContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback) +int CIcqProto::servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback) { int iItem; servlistpendingitem *pItem = NULL; @@ -700,7 +700,7 @@ int CIcqProto::servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPAR } -void CIcqProto::servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult) +void CIcqProto::servlistPendingRemoveContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult) { #ifdef _DEBUG debugLogA("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact); @@ -800,14 +800,14 @@ void CIcqProto::servlistPendingFlushOperations() // used for adding new contacts to list - sync with visible items -void CIcqProto::AddJustAddedContact(HCONTACT hContact) +void CIcqProto::AddJustAddedContact(MCONTACT hContact) { icq_lock l(servlistMutex); if (nJustAddedCount >= nJustAddedSize) { nJustAddedSize += 10; - pdwJustAddedList = (HCONTACT*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(HCONTACT)); + pdwJustAddedList = (MCONTACT*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(MCONTACT)); } pdwJustAddedList[nJustAddedCount] = hContact; @@ -816,7 +816,7 @@ void CIcqProto::AddJustAddedContact(HCONTACT hContact) // was the contact added during this serv-list load -BOOL CIcqProto::IsContactJustAdded(HCONTACT hContact) +BOOL CIcqProto::IsContactJustAdded(MCONTACT hContact) { icq_lock l(servlistMutex); @@ -975,7 +975,7 @@ void CIcqProto::LoadServerIDs() nGroups = nServerIDListCount - nStart; - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { // search all our contacts, reserve their server IDs @@ -1147,7 +1147,7 @@ DWORD CIcqProto::icq_sendServerItem(DWORD dwCookie, WORD wAction, WORD wGroupId, } -DWORD CIcqProto::icq_sendServerContact(HCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject) +DWORD CIcqProto::icq_sendServerContact(MCONTACT hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject) { DWORD dwUin; uid_str szUid; @@ -1286,7 +1286,7 @@ DWORD CIcqProto::icq_sendServerGroup(DWORD dwCookie, WORD wAction, WORD wGroupId } -DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_modifyServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType) { cookie_servlist_action *ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action)); DWORD dwCookie; @@ -1306,13 +1306,13 @@ DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT hContact, DWORD dwUin, cha } -DWORD CIcqProto::icq_removeServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_removeServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) { return icq_modifyServerPrivacyItem(hContact, dwUin, szUid, ICQ_LISTS_REMOVEFROMLIST, SSA_PRIVACY_REMOVE, wItemId, wType); } -DWORD CIcqProto::icq_addServerPrivacyItem(HCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) +DWORD CIcqProto::icq_addServerPrivacyItem(MCONTACT hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType) { return icq_modifyServerPrivacyItem(hContact, dwUin, szUid, ICQ_LISTS_ADDTOLIST, SSA_PRIVACY_ADD, wItemId, wType); } @@ -1360,7 +1360,7 @@ void* CIcqProto::collectBuddyGroup(WORD wGroupID, int *count) { WORD* buf = NULL; int cnt = 0; - HCONTACT hContact; + MCONTACT hContact; WORD wItemID; hContact = FindFirstContact(); @@ -1395,7 +1395,7 @@ void* CIcqProto::collectGroups(int *count) WORD* buf = NULL; int cnt = 0; int i; - HCONTACT hContact; + MCONTACT hContact; WORD wGroupID; hContact = FindFirstContact(); @@ -1578,7 +1578,7 @@ int CIcqProto::getCListGroupExists(const char *szGroup) } -int CIcqProto::moveContactToCListGroup(HCONTACT hContact, const char *szGroup) +int CIcqProto::moveContactToCListGroup(MCONTACT hContact, const char *szGroup) { HANDLE hGroup = Clist_CreateGroup(0, ptrT( mir_utf8decodeT(szGroup))); @@ -2009,7 +2009,7 @@ int CIcqProto::servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, L // Need to be called when Pending Contact is active -int CIcqProto::servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult) +int CIcqProto::servlistAddContact_Ready(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult) { cookie_servlist_action* ack = (cookie_servlist_action*)lParam; @@ -2039,7 +2039,7 @@ int CIcqProto::servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD // Called when contact should be added to server list, if group does not exist, create one -void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup) +void CIcqProto::servlistAddContact(MCONTACT hContact, const char *pszGroup) { DWORD dwUin; uid_str szUid; @@ -2068,7 +2068,7 @@ void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup) } -int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistRemoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { WORD wGroupID; WORD wItemID; @@ -2115,7 +2115,7 @@ int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WO // Called when contact should be removed from server list, remove group if it remain empty -void CIcqProto::servlistRemoveContact(HCONTACT hContact) +void CIcqProto::servlistRemoveContact(MCONTACT hContact) { DWORD dwUin; uid_str szUid; @@ -2201,7 +2201,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew } -int CIcqProto::servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistMoveContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { cookie_servlist_action *ack = (cookie_servlist_action*)lParam; @@ -2233,7 +2233,7 @@ int CIcqProto::servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD // Called when contact should be moved from one group to another, create new, remove empty -void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup) +void CIcqProto::servlistMoveContact(MCONTACT hContact, const char *pszNewGroup) { DWORD dwUin; uid_str szUid; @@ -2277,7 +2277,7 @@ void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup) } -int CIcqProto::servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) +int CIcqProto::servlistUpdateContact_Ready(MCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult) { cookie_servlist_action *ack = (cookie_servlist_action*)lParam; @@ -2326,7 +2326,7 @@ int CIcqProto::servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WO // Is called when a contact' details has been changed locally to update // the server side details. -void CIcqProto::servlistUpdateContact(HCONTACT hContact) +void CIcqProto::servlistUpdateContact(MCONTACT hContact) { DWORD dwUin; uid_str szUid; @@ -2533,7 +2533,7 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId) }*/ -void CIcqProto::resetServContactAuthState(HCONTACT hContact, DWORD dwUin) +void CIcqProto::resetServContactAuthState(MCONTACT hContact, DWORD dwUin) { WORD wContactId = getWord(hContact, DBSETTING_SERVLIST_ID, 0); WORD wGroupId = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0); @@ -2593,14 +2593,14 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmpnull(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Update contact's details in server-list - servlistUpdateContact((HCONTACT)wParam); + servlistUpdateContact((MCONTACT)wParam); } // Has contact been moved to another group? if (!strcmpnull(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Read group from DB - char* szNewGroup = getContactCListGroup((HCONTACT)wParam); + char* szNewGroup = getContactCListGroup((MCONTACT)wParam); SAFE_FREE(&szNewGroup); } @@ -2610,7 +2610,7 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmpnull(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) { // Update contact's details in server-list - servlistUpdateContact((HCONTACT)wParam); + servlistUpdateContact((MCONTACT)wParam); } } @@ -2624,17 +2624,17 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) debugLogA("DB-Events: Contact %x deleted.", wParam); #endif - DeleteFromContactsCache((HCONTACT)wParam); + DeleteFromContactsCache((MCONTACT)wParam); if ( !icqOnline() && m_bSsiEnabled) { // contact was deleted only locally - retrieve full list on next connect - setWord((HCONTACT)wParam, "SrvRecordCount", 0); + setWord((MCONTACT)wParam, "SrvRecordCount", 0); } if ( !icqOnline() || !m_bSsiEnabled) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // we need all server contacts on local buddy list DWORD dwUIN; @@ -2674,7 +2674,7 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam) int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CLISTGROUPCHANGE *grpchg = (CLISTGROUPCHANGE*)lParam; if (!icqOnline() || !m_bSsiEnabled || bIsSyncingCL) diff --git a/protocols/IcqOscarJ/src/icq_servlist.h b/protocols/IcqOscarJ/src/icq_servlist.h index 3325a16538..8da1f32cf4 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.h +++ b/protocols/IcqOscarJ/src/icq_servlist.h @@ -53,12 +53,12 @@ struct CIcqProto; // callback prototypes for pending operation mechanism: typedef int (__cdecl CIcqProto::*PENDING_GROUP_CALLBACK)(const char* pszGroup, WORD wGroupId, LPARAM lParam, int nResult); -typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(HCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult); +typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(MCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult); // cookie struct for SSI actions struct cookie_servlist_action { - HCONTACT hContact; + MCONTACT hContact; char *szGroup; WORD wContactId; WORD wGroupId; @@ -159,7 +159,7 @@ struct servlistpendingoperation struct servlistpendingitem { int nType; - HCONTACT hContact; + MCONTACT hContact; char* szGroup; WORD wContactID; WORD wGroupID; diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index ac6b56a295..9f6a5d2080 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -62,7 +62,7 @@ static void UpdateAllContactsCheckmark(HWND hwndList, CIcqProto* ppro, HANDLE ph { int check = 1; - HCONTACT hContact = ppro->FindFirstContact(); + MCONTACT hContact = ppro->FindFirstContact(); while (hContact) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); @@ -87,7 +87,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) int bAll = 1; bListInit = 1; // lock CLC events - HCONTACT hContact = ppro->FindFirstContact(); + MCONTACT hContact = ppro->FindFirstContact(); while (hContact) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); @@ -112,7 +112,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) static void DeleteOtherContactsFromControl(HWND hCtrl, CIcqProto* ppro) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hCtrl, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem) if (!ppro->IsICQContact(hContact)) @@ -191,7 +191,7 @@ static DWORD sendUploadGroup(CIcqProto* ppro, WORD wAction, WORD wGroupId, char* return 0; } -static DWORD sendUploadBuddy(CIcqProto* ppro, HCONTACT hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType) +static DWORD sendUploadBuddy(CIcqProto* ppro, MCONTACT hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType) { DWORD dwCookie; cookie_servlist_action* ack; @@ -260,7 +260,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara static int currentSequence; static int currentAction; static int currentState; - static HCONTACT hCurrentContact; + static MCONTACT hCurrentContact; static int lastAckResult = 0; static WORD wNewContactId; static WORD wNewGroupId; @@ -511,7 +511,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara // and every time an ack from the server has been taken care of. case M_UPLOADMORE: { - HCONTACT hContact; + MCONTACT hContact; HANDLE hItem; DWORD dwUin; uid_str szUid; @@ -933,7 +933,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara case CLN_CHECKCHANGED: { NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam; - HCONTACT hContact; + MCONTACT hContact; HANDLE hItem; if (bListInit) break; diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 612b970c50..231293a139 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -42,7 +42,7 @@ int OnReloadIcons(WPARAM wParam, LPARAM lParam) return 0; } -BYTE CIcqProto::getContactXStatus(HCONTACT hContact) +BYTE CIcqProto::getContactXStatus(MCONTACT hContact) { if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 0; @@ -51,7 +51,7 @@ BYTE CIcqProto::getContactXStatus(HCONTACT hContact) return (bXStatus < 1 || bXStatus > XSTATUS_COUNT) ? 0 : bXStatus; } -DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced) +DWORD CIcqProto::sendXStatusDetailsRequest(MCONTACT hContact, int bForced) { DWORD dwCookie = 0; @@ -67,7 +67,7 @@ DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced) return dwCookie; } -DWORD CIcqProto::requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay) +DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) { if (!validateStatusMessageRequest(hContact, MTYPE_SCRIPT_NOTIFY)) return 0; // apply privacy rules @@ -169,7 +169,7 @@ HICON CIcqProto::getXStatusIcon(int bStatus, UINT flags) return (flags & LR_SHARED || !icon) ? icon : CopyIcon(icon); } -void setContactExtraIcon(HCONTACT hContact, int xstatus) +void setContactExtraIcon(MCONTACT hContact, int xstatus) { ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus-1] : NULL); } @@ -393,7 +393,7 @@ const int moodXStatus[XSTATUS_COUNT] = { 81, 84}; -void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize) +void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize) { int bChanged = FALSE; int nCustomStatusID = 0, nMoodID = 0; @@ -579,7 +579,7 @@ struct SetXStatusData CIcqProto* ppro; BYTE bAction; BYTE bXStatus; - HCONTACT hContact; + MCONTACT hContact; HANDLE hEvent; DWORD iEvent; int countdown; @@ -593,7 +593,7 @@ struct InitXStatusData BYTE bXStatus; char* szXStatusName; char* szXStatusMsg; - HCONTACT hContact; + MCONTACT hContact; }; #define HM_PROTOACK (WM_USER+10) @@ -912,7 +912,7 @@ INT_PTR CIcqProto::ShowXStatusDetails(WPARAM wParam, LPARAM lParam) InitXStatusData init; init.ppro = this; init.bAction = 1; // retrieve - init.hContact = (HCONTACT)wParam; + init.hContact = (MCONTACT)wParam; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SETXSTATUS), NULL, SetXStatusDlgProc, (LPARAM)&init); return 0; @@ -971,7 +971,7 @@ INT_PTR CIcqProto::SetXStatusEx(WPARAM wParam, LPARAM lParam) INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam) { CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 1; @@ -1088,7 +1088,7 @@ INT_PTR CIcqProto::GetXStatusIcon(WPARAM wParam, LPARAM lParam) INT_PTR CIcqProto::RequestXStatusDetails(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bXStatusEnabled) return 0; @@ -1105,7 +1105,7 @@ INT_PTR CIcqProto::RequestAdvStatusIconIdx(WPARAM wParam, LPARAM lParam) if (!m_bXStatusEnabled && !m_bMoodsEnabled) return -1; - BYTE bXStatus = getContactXStatus((HCONTACT)wParam); + BYTE bXStatus = getContactXStatus((MCONTACT)wParam); if (bXStatus) { if (!bXStatusCListIconsValid[bXStatus-1]) { // adding icon int idx = hXStatusCListIcons[bXStatus-1]; diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 68bf447e3f..ff4d2a543f 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -35,7 +35,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w char *szNotify = strstrnull(szMsg, ""); char *szQuery = strstrnull(szMsg, ""); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (hContact) // user sent us xtraz, he supports it SetContactCapabilities(hContact, CAPF_XTRAZ); @@ -174,7 +174,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w } -void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen) +void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, MCONTACT hContact, WORD wCookie, char* szMsg, int nMsgLen) { char *szMem, *szRes, *szEnd; int nResLen; @@ -294,7 +294,7 @@ static char* getXmlPidItem(const char* szData, int nLen) void CIcqProto::handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC) { - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (hContact) // user sent us xtraz, he supports it SetContactCapabilities(hContact, CAPF_XTRAZ); @@ -310,7 +310,7 @@ void CIcqProto::handleXtrazInvitation(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WO void CIcqProto::handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, int nMsgLen, BOOL bThruDC) { - HCONTACT hContact; + MCONTACT hContact; char* szPluginID; hContact = HContactFromUIN(dwUin, NULL); @@ -367,7 +367,7 @@ void CIcqProto::handleXtrazData(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCo // Functions really sending Xtraz stuff -DWORD CIcqProto::SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced) +DWORD CIcqProto::SendXtrazNotifyRequest(MCONTACT hContact, char* szQuery, char* szNotify, int bForced) { char *szQueryBody; char *szNotifyBody; @@ -409,9 +409,9 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, char *szResBody = MangleXml(szResponse, nResponseLen); int nBodyLen = strlennull(szResBody) + 21; char *szBody = (char*)_alloca(nBodyLen); - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) { + if (hContact != INVALID_CONTACT_ID && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) { SAFE_FREE(&szResBody); return; // Contact does not support xtraz, do not send anything } diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index d8b59e2ff4..69df16b526 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -38,12 +38,12 @@ INT_PTR CIcqProto::AddServerContact(WPARAM wParam, LPARAM lParam) if (!m_bSsiEnabled) return 0; // Does this contact have a UID? - if (!getContactUid((HCONTACT)wParam, &dwUin, &szUid) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0)) + if (!getContactUid((MCONTACT)wParam, &dwUin, &szUid) && !getWord((MCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((MCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0)) { /// TODO: remove possible 0x6A TLV in contact server-list data!!! // Read group from DB - char *pszGroup = getContactCListGroup((HCONTACT)wParam); + char *pszGroup = getContactCListGroup((MCONTACT)wParam); - servlistAddContact((HCONTACT)wParam, pszGroup); + servlistAddContact((MCONTACT)wParam, pszGroup); SAFE_FREE((void**)&pszGroup); } return 0; @@ -88,7 +88,7 @@ INT_PTR CIcqProto::GetInfoSetting(WPARAM wParam, LPARAM lParam) { DBCONTACTGETSETTING *cgs = (DBCONTACTGETSETTING*)lParam; BYTE type = cgs->pValue->type; - INT_PTR rc = db_get_s((HCONTACT)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0); + INT_PTR rc = db_get_s((MCONTACT)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0); if (rc) return rc; @@ -458,13 +458,13 @@ INT_PTR CIcqProto::GrantAuthorization(WPARAM wParam, LPARAM lParam) DWORD dwUin; uid_str szUid; - if (getContactUid((HCONTACT)wParam, &dwUin, &szUid)) + if (getContactUid((MCONTACT)wParam, &dwUin, &szUid)) return 0; // Invalid contact // send without reason, do we need any ? icq_sendGrantAuthServ(dwUin, szUid, NULL); // auth granted, remove contact menu item - delSetting((HCONTACT)wParam, "Grant"); + delSetting((MCONTACT)wParam, "Grant"); } return 0; @@ -494,7 +494,7 @@ INT_PTR CIcqProto::RevokeAuthorization(WPARAM wParam, LPARAM lParam) DWORD dwUin; uid_str szUid; - if (getContactUid((HCONTACT)wParam, &dwUin, &szUid)) + if (getContactUid((MCONTACT)wParam, &dwUin, &szUid)) return 0; // Invalid contact if (MessageBox(NULL, TranslateT("Are you sure you want to revoke user's authorization?\nThis will remove you from his/her list on some clients."), TranslateT("Confirmation"), MB_ICONQUESTION | MB_YESNO) != IDYES) @@ -633,10 +633,10 @@ INT_PTR CIcqProto::SetPassword(WPARAM wParam, LPARAM lParam) // TODO: Adding needs some more work in general -HCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) +MCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) { int bAdded; - HCONTACT hContact = HContactFromUIN(dwUin, &bAdded); + MCONTACT hContact = HContactFromUIN(dwUin, &bAdded); if (hContact) { if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0)) @@ -652,10 +652,10 @@ HCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) } -HCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) +MCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) { int bAdded; - HCONTACT hContact = HContactFromUID(0, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(0, szUID, &bAdded); if (hContact) { if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0)) @@ -673,7 +673,7 @@ HCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) ///////////////////////////////////////////////////////////////////////////////////////// -void CIcqProto::ICQAddRecvEvent(HCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags) +void CIcqProto::ICQAddRecvEvent(MCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags) { if (pre->flags & PREF_CREATEREAD) flags |= DBEF_READ; @@ -714,7 +714,7 @@ INT_PTR __cdecl CIcqProto::IcqCheckCapability(WPARAM wParam, LPARAM lParam) { int res = 0; DBVARIANT dbvariant; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)lParam; db_get(hContact, m_szModuleName, "CapBuf", &dbvariant); diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index b9d112dff3..5643c5ceae 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -33,7 +33,7 @@ struct oscarthreadstartinfo { int type; int incoming; - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; DWORD dwRemoteIP; oscar_filetransfer *ft; @@ -171,7 +171,7 @@ int CIcqProto::IsValidOscarTransfer(void *ft) } -oscar_filetransfer* CIcqProto::FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2) +oscar_filetransfer* CIcqProto::FindOscarTransfer(MCONTACT hContact, DWORD dwID1, DWORD dwID2) { icq_lock l(oftMutex); @@ -377,7 +377,7 @@ void CIcqProto::ReleaseOscarListener(oscar_listener **pListener) void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (wCommand == 0) { // this is OFT request @@ -559,7 +559,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz } } int bAdded; - HCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); + MCONTACT hContact = HContactFromUID(dwUin, szUID, &bAdded); ft->hContact = hContact; ft->fileId = -1; @@ -838,7 +838,7 @@ static char *oftGetFileContainer(oscar_filetransfer* oft, const char** files, in } -HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc) +HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc) { int i, filesCount; struct _stati64 statbuf; @@ -992,7 +992,7 @@ HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, c } -HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) +HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) { oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1025,7 +1025,7 @@ HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR } -DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason) +DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason) { oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1054,7 +1054,7 @@ DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *s } -DWORD CIcqProto::oftFileCancel(HCONTACT hContact, HANDLE hTransfer) +DWORD CIcqProto::oftFileCancel(MCONTACT hContact, HANDLE hTransfer) { oscar_filetransfer* ft = (oscar_filetransfer*)hTransfer; DWORD dwUin; @@ -1231,7 +1231,7 @@ void CIcqProto::CloseOscarConnection(oscar_connection *oc) ///////////////////////////////////////////////////////////////////////////////////////// -void CIcqProto::OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type) +void CIcqProto::OpenOscarConnection(MCONTACT hContact, oscar_filetransfer *ft, int type) { oscarthreadstartinfo *otsi = (oscarthreadstartinfo*)SAFE_MALLOC(sizeof(oscarthreadstartinfo)); diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.h b/protocols/IcqOscarJ/src/oscar_filetransfer.h index bf4162b50b..36a7c738de 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.h +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.h @@ -62,7 +62,7 @@ char *FindFilePathContainer(const char **files, int iFile, char *szContainer); struct oscar_filetransfer: public basic_filetransfer { - HCONTACT hContact; + MCONTACT hContact; int flags; // combination of OFTF_* int containerCount; char **file_containers; @@ -123,7 +123,7 @@ void SafeReleaseFileTransfer(void **ft); struct oscar_connection { - HCONTACT hContact; + MCONTACT hContact; HANDLE hConnection; int status; DWORD dwUin; diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index eb36b3277c..a502a09005 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -310,7 +310,7 @@ void CIcqProto::icq_setstatus(WORD wStatus, const char *szStatusNote) } -DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, MCONTACT hContact, char *pszText, cookie_message_data *pCookieData) { icq_packet packet; WORD wPacketLength; @@ -355,7 +355,7 @@ DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hCon } -DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, MCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData) { icq_packet packet; WORD wMessageLen; @@ -405,7 +405,7 @@ DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hCo } -DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap) +DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, MCONTACT hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap) { icq_packet packet; @@ -433,7 +433,7 @@ DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT hContact, const c } -DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, MCONTACT hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData) { icq_packet packet; @@ -462,7 +462,7 @@ DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT hCo } -DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData) +DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, MCONTACT hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData) { icq_packet packet; WORD wPacketLength; @@ -552,7 +552,7 @@ DWORD CIcqProto::sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int } -DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual) +DWORD CIcqProto::icq_sendGetInfoServ(MCONTACT hContact, DWORD dwUin, int bManual) { icq_packet packet; DWORD dwCookie = 0; @@ -607,7 +607,7 @@ DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual } -DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid) +DWORD CIcqProto::icq_sendGetAimProfileServ(MCONTACT hContact, char* szUid) { icq_packet packet; BYTE bUIDlen = strlennull(szUid); @@ -632,7 +632,7 @@ DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid) } -DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type, WORD wVersion) +DWORD CIcqProto::icq_sendGetAwayMsgServ(MCONTACT hContact, DWORD dwUin, int type, WORD wVersion) { icq_packet packet; @@ -650,7 +650,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type } -DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion) +DWORD CIcqProto::icq_sendGetAwayMsgServExt(MCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion) { icq_packet packet; @@ -684,7 +684,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char } -DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HCONTACT hContact, char *szUID, int type) +DWORD CIcqProto::icq_sendGetAimAwayMsgServ(MCONTACT hContact, char *szUID, int type) { icq_packet packet; BYTE bUIDlen = strlennull(szUID); @@ -988,7 +988,7 @@ void CIcqProto::icq_sendFileDenyServ(DWORD dwUin, filetransfer *ft, const char * void CIcqProto::icq_sendAwayMsgReplyServ(DWORD dwUin, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char** szMsg) { - HCONTACT hContact = HContactFromUIN(dwUin, NULL); + MCONTACT hContact = HContactFromUIN(dwUin, NULL); if (validateStatusMessageRequest(hContact, msgType)) { NotifyEventHooks(m_modeMsgsEvent, (WPARAM)msgType, (LPARAM)dwUin); @@ -1032,7 +1032,7 @@ void CIcqProto::icq_sendAwayMsgReplyServ(DWORD dwUin, DWORD dwMsgID1, DWORD dwMs void CIcqProto::icq_sendAwayMsgReplyServExt(DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wCookie, WORD wVersion, BYTE msgType, char **szMsg) { - HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); + MCONTACT hContact = HContactFromUID(dwUin, szUID, NULL); if (validateStatusMessageRequest(hContact, msgType)) { NotifyEventHooks(m_modeMsgsEvent, (WPARAM)msgType, (LPARAM)dwUin); @@ -1551,7 +1551,7 @@ void CIcqProto::icq_sendRemoveContact(DWORD dwUin, const char *szUid) // list==0: visible list // list==1: invisible list -void CIcqProto::icq_sendChangeVisInvis(HCONTACT hContact, DWORD dwUin, char* szUID, int list, int add) +void CIcqProto::icq_sendChangeVisInvis(MCONTACT hContact, DWORD dwUin, char* szUID, int list, int add) { // TODO: This needs grouping & rate management // Tell server to change our server-side contact visbility list if (m_bSsiEnabled) { diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 2c38bcd74a..deafab4806 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -340,7 +340,7 @@ BOOL CIcqProto::IsOnSpammerList(DWORD dwUIN) // ICQ contacts cache -void CIcqProto::AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid) +void CIcqProto::AddToContactsCache(MCONTACT hContact, DWORD dwUin, const char *szUid) { if (!hContact || (!dwUin && !szUid)) return; @@ -372,7 +372,7 @@ void CIcqProto::InitContactsCache() // build cache icq_lock l(contactsCacheMutex); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { DWORD dwUin; @@ -411,7 +411,7 @@ void CIcqProto::UninitContactsCache(void) } -void CIcqProto::DeleteFromContactsCache(HCONTACT hContact) +void CIcqProto::DeleteFromContactsCache(MCONTACT hContact) { icq_lock l(contactsCacheMutex); @@ -432,7 +432,7 @@ void CIcqProto::DeleteFromContactsCache(HCONTACT hContact) } -HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) +MCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) { icq_contacts_cache cache_item = { NULL, dwUin, szUid }; @@ -446,11 +446,11 @@ HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid) } -HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) +MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) { if (Added) *Added = 0; - HCONTACT hContact = HandleFromCacheByUid(dwUin, NULL); + MCONTACT hContact = HandleFromCacheByUid(dwUin, NULL); if (hContact) return hContact; @@ -469,17 +469,17 @@ HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) //not present: add if (Added) { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (!hContact) { debugLogA("Failed to create ICQ contact %u", dwUin); - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0) { // For some reason we failed to register the protocol to this contact CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); debugLogA("Failed to register ICQ contact %u", dwUin); - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } setDword(hContact, UNIQUEIDSETTING, dwUin); @@ -505,11 +505,11 @@ HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (getContactUin(NULL) == dwUin) return NULL; - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } -HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) +MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) { if (dwUin) return HContactFromUIN(dwUin, Added); @@ -517,9 +517,9 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) if (Added) *Added = 0; if (!m_bAimEnabled) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; - HCONTACT hContact = HandleFromCacheByUid(dwUin, szUid); + MCONTACT hContact = HandleFromCacheByUid(dwUin, szUid); if (hContact) return hContact; hContact = FindFirstContact(); @@ -540,7 +540,7 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) //not present: add if (Added) { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); setString(hContact, UNIQUEIDSETTING, szUid); @@ -560,11 +560,11 @@ HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) return hContact; } - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; } -HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) +MCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; DWORD body[3]; @@ -573,28 +573,28 @@ HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body; if (db_event_get(hEvent, &dbei)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (strcmpnull(dbei.szModule, m_szModuleName)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; return DbGetAuthEventContact(&dbei); } -char *NickFromHandle(HCONTACT hContact) +char *NickFromHandle(MCONTACT hContact) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return null_strdup(Translate("")); return null_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0)); } -char *NickFromHandleUtf(HCONTACT hContact) +char *NickFromHandleUtf(MCONTACT hContact) { - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return ICQTranslateUtf(LPGEN("")); return tchar_to_utf8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); @@ -888,7 +888,7 @@ void CIcqProto::ResetSettingsOnListReload() setWord("SrvRecordCount", 0); delSetting(DBSETTING_SERVLIST_UNHANDLED); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { // All these values will be restored during the serv-list receive @@ -912,7 +912,7 @@ void CIcqProto::ResetSettingsOnConnect() setByte("SrvVisibility", 0); setDword("IdleTS", 0); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { setDword(hContact, "LogonTS", 0); @@ -933,7 +933,7 @@ void CIcqProto::ResetSettingsOnLoad() setDword("IdleTS", 0); setDword("LogonTS", 0); - HCONTACT hContact = FindFirstContact(); + MCONTACT hContact = FindFirstContact(); while (hContact) { setDword(hContact, "LogonTS", 0); @@ -989,7 +989,7 @@ void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments) SAFE_FREE((void**)&pArguments); } -void CIcqProto::SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage) +void CIcqProto::SendProtoAck(MCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage) { icq_ack_args* pArgs = (icq_ack_args*)SAFE_MALLOC(sizeof(icq_ack_args)); // This will be freed in the new thread pArgs->hContact = hContact; @@ -1010,7 +1010,7 @@ void CIcqProto::SetCurrentStatus(int nStatus) } -int CIcqProto::IsMetaInfoChanged(HCONTACT hContact) +int CIcqProto::IsMetaInfoChanged(MCONTACT hContact) { DBVARIANT infoToken = { DBVT_DELETED }; int res = 0; @@ -1250,7 +1250,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay) } -void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVStringUtf(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { oscar_tlv *pTLV = chain->getTLV(wTlv, 1); @@ -1265,7 +1265,7 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *sz } -void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVWord(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { int num = chain->getNumber(wTlv, 1); if (num > 0) @@ -1275,7 +1275,7 @@ void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetti } -void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVByte(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { int num = chain->getNumber(wTlv, 1); @@ -1286,7 +1286,7 @@ void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetti } -void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVDouble(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { double num = chain->getDouble(wTlv, 1); if (num > 0) @@ -1295,7 +1295,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSet delSetting(hContact, szSetting); } -void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVDate(MCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv) { double time = chain->getDouble(wTlv, 1); @@ -1320,7 +1320,7 @@ void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSetti } -void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) +void CIcqProto::writeDbInfoSettingTLVBlob(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv) { oscar_tlv *pTLV = chain->getTLV(wTlv, 1); @@ -1331,7 +1331,7 @@ void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetti } -BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingString(MCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1364,7 +1364,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSettin return TRUE; } -BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingWord(MCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1381,7 +1381,7 @@ BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, return TRUE; } -BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingWordWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) { if (*pwLength < 2) return FALSE; @@ -1400,7 +1400,7 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *s return TRUE; } -BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingByte(MCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength) { if (*pwLength < 1) return FALSE; @@ -1417,7 +1417,7 @@ BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting return TRUE; } -BOOL CIcqProto::writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) +BOOL CIcqProto::writeDbInfoSettingByteWithTable(MCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength) { if (*pwLength < 1) return FALSE; @@ -1450,12 +1450,12 @@ char* time2text(time_t time) } -bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType) +bool CIcqProto::validateStatusMessageRequest(MCONTACT hContact, WORD byMessageType) { // Privacy control if (getByte("StatusMsgReplyCList", 0)) { // Don't send statusmessage to unknown contacts - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + if (hContact == INVALID_CONTACT_ID) return false; // Don't send statusmessage to temporary contacts or hidden contacts @@ -1472,7 +1472,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy } // Dont send messages to people you are hiding from - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && + if (hContact != INVALID_CONTACT_ID && getWord(hContact, "ApparentMode", 0) == ID_STATUS_OFFLINE) { return false; } @@ -1487,7 +1487,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy return false; } - if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && m_iStatus == ID_STATUS_INVISIBLE && + if (hContact != INVALID_CONTACT_ID && m_iStatus == ID_STATUS_INVISIBLE && getWord(hContact, "ApparentMode", 0) != ID_STATUS_ONLINE) { if (!getByte(hContact, "TemporaryVisible", 0)) { // Allow request to temporary visible contacts return false; @@ -1904,7 +1904,7 @@ int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uTy return res; } -char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg) +char* CIcqProto::ConvertMsgToUserSpecificAnsi(MCONTACT hContact, const char* szMsg) { // this takes utf-8 encoded message WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage); char* szAnsi = NULL; @@ -1917,7 +1917,7 @@ char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szM } // just broadcast generic send error with dummy cookie and return that cookie -DWORD CIcqProto::ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg) +DWORD CIcqProto::ReportGenericSendError(MCONTACT hContact, int nType, const char* szErrorMsg) { DWORD dwCookie = GenerateCookie(0); SendProtoAck(hContact, dwCookie, ACKRESULT_FAILED, nType, Translate(szErrorMsg)); diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h index c229feac2a..b9f063ee74 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -33,7 +33,7 @@ struct icq_ack_args { - HCONTACT hContact; + MCONTACT hContact; int nAckType; int nAckResult; HANDLE hSequence; @@ -42,7 +42,7 @@ struct icq_ack_args struct icq_contacts_cache { - HCONTACT hContact; + MCONTACT hContact; DWORD dwUin; const char *szUid; }; @@ -66,8 +66,8 @@ void SetGatewayIndex(HANDLE hConn, DWORD dwIndex); DWORD GetGatewayIndex(HANDLE hConn); void FreeGatewayIndex(HANDLE hConn); -char *NickFromHandle(HCONTACT hContact); -char *NickFromHandleUtf(HCONTACT hContact); +char *NickFromHandle(MCONTACT hContact); +char *NickFromHandleUtf(MCONTACT hContact); char *strUID(DWORD dwUIN, char *pszUID); int __fastcall strlennull(const char *string); @@ -181,7 +181,7 @@ int ListBoxAddStringUtf(HWND hList, const char *szString); int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uType); void InitXStatusIcons(); -void setContactExtraIcon(HCONTACT hContact, int xstatus); +void setContactExtraIcon(MCONTACT hContact, int xstatus); int OnReloadIcons(WPARAM wParam, LPARAM lParam); #endif /* __UTILITIES_H */ diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index bf7839a11e..04634dce2c 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -363,7 +363,7 @@ struct ThreadData // for nick names resolving int resolveID; - HCONTACT resolveContact; + MCONTACT resolveContact; // features & registration HWND reg_hwndDlg; @@ -760,7 +760,7 @@ void strdel(char* parBuffer, int len); //---- jabber_userinfo.cpp -------------------------------------------------------------- -void JabberUserInfoUpdate(HCONTACT hContact); +void JabberUserInfoUpdate(MCONTACT hContact); //---- jabber_iq_handlers.cpp BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE); diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index f3777d0ff9..2e0df413f3 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -510,7 +510,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; int res = -1; if ((hContact != NULL || lParam != 0) && m_bJabberOnline) { diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index fa057d002b..208076acf3 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -56,13 +56,13 @@ int CJabberProto::CompareJIDs(LPCTSTR jid1, LPCTSTR jid2) return JabberCompareJids(jid1, jid2); } -HCONTACT CJabberProto::ContactFromJID(LPCTSTR jid) +MCONTACT CJabberProto::ContactFromJID(LPCTSTR jid) { if (jid == NULL) return NULL; return HContactFromJID(jid); } -LPTSTR CJabberProto::ContactToJID(HCONTACT hContact) +LPTSTR CJabberProto::ContactToJID(MCONTACT hContact) { return getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"); } diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 11c972ca3b..ae4e61ad05 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -32,7 +32,7 @@ void CJabberProto::EnableArchive(bool bEnable) << XCHILDNS( _T("auto"), JABBER_FEAT_ARCHIVE) << XATTR(_T("save"), (bEnable) ? _T("true") : _T("false"))); } -void CJabberProto::RetrieveMessageArchive(HCONTACT hContact, JABBER_LIST_ITEM *pItem) +void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *pItem) { if (pItem->bHistoryRead) return; @@ -60,7 +60,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*) if (!list || lstrcmp( xmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE)) return; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; time_t tmLast = 0; for (int nodeIdx = 1; ; nodeIdx++) { @@ -95,11 +95,11 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*) ///////////////////////////////////////////////////////////////////////////////////////// static DWORD dwPreviousTimeStamp = -1; -static HCONTACT hPreviousContact = (HCONTACT)INVALID_HANDLE_VALUE; +static MCONTACT hPreviousContact = INVALID_CONTACT_ID; static HANDLE hPreviousDbEvent = NULL; // Returns TRUE if the event already exist in the database -BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO& dbei) +BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) { HANDLE hExistingDbEvent; DWORD dwEventTimeStamp; @@ -240,7 +240,7 @@ BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO& dbei) } } // reset last event - hPreviousContact = (HCONTACT)INVALID_HANDLE_VALUE; + hPreviousContact = INVALID_CONTACT_ID; return FALSE; } @@ -258,7 +258,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*) if (!start || !with) return; - HCONTACT hContact = HContactFromJID(with); + MCONTACT hContact = HContactFromJID(with); time_t tmStart = str2time(start); if (hContact == 0 || tmStart == 0) return; diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 4e1ce74aa6..f11323d14a 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -132,7 +132,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) gcw.ptszID = item->jid; CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw); - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (hContact != NULL) { if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) if (bookmark->name) { @@ -600,7 +600,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) mir_sntprintf(sttRJidBuf, SIZEOF(sttRJidBuf), TranslateT("Real &JID: %s"), him->m_tszRealJid); if (TCHAR *tmp = _tcschr(sttRJidBuf, _T('/'))) *tmp = 0; - if (HCONTACT hContact = HContactFromJID(him->m_tszRealJid)) { + if (MCONTACT hContact = HContactFromJID(him->m_tszRealJid)) { gcmi->Item[3].uType = MENU_HMENU; gcmi->Item[3].dwID = CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0); sttShowGcMenuItems(gcmi, sttRJidItems, 0); @@ -662,7 +662,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase void FilterList(CCtrlClc *) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *proto = GetContactProto(hContact); if (lstrcmpA(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact)) if (HANDLE hItem = m_clc.FindContact(hContact)) @@ -740,7 +740,7 @@ public: m_txtNewJid.GetText(buf, SIZEOF(buf)); m_txtNewJid.SetTextA(""); - HCONTACT hContact = m_proto->HContactFromJID(buf); + MCONTACT hContact = m_proto->HContactFromJID(buf); if (hContact) { int hItem = SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); @@ -776,7 +776,7 @@ public: HWND hwndList = GetDlgItem(m_hwnd, IDC_CLIST); // invite users from roster - for (HCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) { if (m_proto->isChatRoom(hContact)) continue; @@ -1003,7 +1003,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if ((gch->dwData >= CLISTMENUIDMIN) && (gch->dwData <= CLISTMENUIDMAX)) { if (him->m_tszRealJid && *him->m_tszRealJid) - if (HCONTACT hContact = ppro->HContactFromJID(him->m_tszRealJid)) + if (MCONTACT hContact = ppro->HContactFromJID(him->m_tszRealJid)) CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(gch->dwData, MPCF_CONTACTMENU), (LPARAM)hContact); return; } @@ -1039,7 +1039,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid); ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority); - HCONTACT hContact = (HCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); + MCONTACT hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); } break; @@ -1202,7 +1202,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* case IDM_RJID_VCARD: if (him->m_tszRealJid && *him->m_tszRealJid) { - HCONTACT hContact; + MCONTACT hContact; JABBER_SEARCH_RESULT jsr = { 0 }; jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT); mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid); @@ -1211,7 +1211,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid); ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority); - hContact = (HCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); + hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); } break; @@ -1305,7 +1305,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g item = ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID); if (item != NULL) { item->type = _T("conference"); - HCONTACT hContact = ppro->HContactFromJID(item->jid); + MCONTACT hContact = ppro->HContactFromJID(item->jid); item->name = pcli->pfnGetContactDisplayName(hContact, 0); ppro->AddEditBookmark(item); } @@ -1328,7 +1328,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g case IDM_PRESENCE_NA: case IDM_PRESENCE_DND: case IDM_PRESENCE_FREE4CHAT: - if (HCONTACT h = ppro->HContactFromJID(item->jid)) + if (MCONTACT h = ppro->HContactFromJID(item->jid)) ppro->OnMenuHandleDirectPresence((WPARAM)h, 0, gch->dwData); break; @@ -1369,7 +1369,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co { TCHAR szFullJid[JABBER_MAX_JID_LEN]; mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), item->jid, nick); - HCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, TRUE, FALSE); + MCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, TRUE, FALSE); if (hContact != NULL) { pResourceStatus r(item->findResource(nick)); if (r) diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 1453e9f40f..b4722a2b2b 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -406,7 +406,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) { if ((item=ListGetItemPtrFromIndex(i)) != NULL) { if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription!=SUB_NONE) { - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (hContact != NULL) setByte(hContact, "IsTransport", TRUE); @@ -1237,7 +1237,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM if (!items[i].feature) { if (items[i].title) { - HCONTACT hContact; + MCONTACT hContact; if ((items[i].action == SD_ACT_USERMENU) && (hContact = HContactFromJID(pNode->GetJid()))) { HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0); AppendMenu(hMenu, MF_STRING|MF_POPUP, (UINT_PTR)hContactMenu, TranslateTS(items[i].title)); @@ -1397,7 +1397,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_USERMENU: { - HCONTACT hContact = HContactFromJID(pNode->GetJid()); + MCONTACT hContact = HContactFromJID(pNode->GetJid()); if (!hContact) { hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), TRUE, FALSE); JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid()); @@ -1413,12 +1413,12 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_VCARD: { TCHAR *jid = pNode->GetJid(); - HCONTACT hContact = HContactFromJID(pNode->GetJid()); + MCONTACT hContact = HContactFromJID(pNode->GetJid()); if (!hContact) { JABBER_SEARCH_RESULT jsr={0}; mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), jid); jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT); - hContact = (HCONTACT)CallProtoService(m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); + hContact = (MCONTACT)CallProtoService(m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr); } if (ListGetItemPtr(LIST_VCARD_TEMP, pNode->GetJid()) == NULL) { JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid()); @@ -1432,7 +1432,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_ROSTER: { - HCONTACT hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE); + MCONTACT hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE); db_unset(hContact, "CList", "NotOnList"); JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid()); item->bUseResource = TRUE; @@ -1453,7 +1453,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM default: if ((res >= CLISTMENUIDMIN) && (res <= CLISTMENUIDMAX)) { - HCONTACT hContact = HContactFromJID(pNode->GetJid()); + MCONTACT hContact = HContactFromJID(pNode->GetJid()); if (hContact) CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(res, MPCF_CONTACTMENU), (LPARAM)hContact); } diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index f9795c7ac9..4fb8a4a3c1 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -36,7 +36,7 @@ int CJabberProto::OnContactDeleted(WPARAM wParam, LPARAM) if (!m_bJabberOnline) // should never happen return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ptrT jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid")); if (jid == NULL) return 0; @@ -75,7 +75,7 @@ static TCHAR* sttSettingToTchar(DBCONTACTWRITESETTING *cws) return NULL; } -void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HCONTACT hContact) +void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hContact) { JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid"))); if (item == NULL) @@ -106,7 +106,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HCONTACT hC } } -void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT hContact) +void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact) { JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT( getTStringA(hContact, "jid"))); if (item == NULL) @@ -126,7 +126,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT } } -void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact) +void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONTACT hContact) { if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) return; @@ -159,7 +159,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONT int __cdecl CJabberProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL || !m_bJabberOnline) return 0; diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index c36d2cdc77..bbf4cae4f7 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -185,7 +185,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ptrT jid( getTStringA(hContact, "ChatRoomID")); if (jid == NULL) return 0; @@ -210,7 +210,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ptrT jid(getTStringA(hContact, "ChatRoomID")); if (jid != NULL) { if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) { @@ -791,7 +791,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol if (!lstrcmp(item->nick, oldNick)) { replaceStrT(item->nick, newNick); - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (hContact != NULL) setTString(hContact, "MyNick", newNick); } @@ -931,7 +931,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (r && bRoleChanged) GcLogShowInformation(item, r, INFO_ROLE); // update clist status - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact != NULL) setWord(hContact, "Status", status); @@ -992,7 +992,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) GcLogUpdateMemberStatus(item, resource, nick, str, GC_EVENT_PART, statusNode); ListRemoveResource(LIST_CHATROOM, from); - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact != NULL) setWord(hContact, "Status", ID_STATUS_OFFLINE); } diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 8c36b3d02b..53491363bd 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -384,7 +384,7 @@ int CJabberProto::OnReloadIcons(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // Prototype for Jabber and other protocols to return index of Advanced status -// wParam - HCONTACT of called protocol +// wParam - MCONTACT of called protocol // lParam - should be 0 (reserverd for futher usage) // return value: -1 - no Advanced status // : other - index of icons in clcimagelist. @@ -393,7 +393,7 @@ int CJabberProto::OnReloadIcons(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return -1; @@ -415,7 +415,7 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // Transport check functions -BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact) +BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, MCONTACT hContact) { // check if transport is already set if (!jid || !hContact) @@ -455,7 +455,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hConta void CJabberProto::CheckAllContactsAreTransported() { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT jid( getTStringA(hContact, "jid")); if (jid) DBCheckIsTransportedContact(jid, hContact); diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h index 3eece1ec6e..cd229247ca 100644 --- a/protocols/JabberG/src/jabber_iq.h +++ b/protocols/JabberG/src/jabber_iq.h @@ -70,7 +70,7 @@ public: TCHAR *m_szChildTagXmlns; TCHAR *m_szChildTagName; HXML m_pChildNode; - HCONTACT m_hContact; + MCONTACT m_hContact; TCHAR *m_szTo; TCHAR *m_szId; @@ -117,7 +117,7 @@ public: __forceinline TCHAR* GetIdStr() { return m_szId; } - __forceinline HCONTACT GetHContact() + __forceinline MCONTACT GetHContact() { return m_hContact; } __forceinline HXML GetChildNode() diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index bd360cd167..d783fb189c 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -525,7 +525,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) } JABBER_LIST_ITEM *item; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; const TCHAR *jid, *str, *name; TCHAR *nick; diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 04f05dd3e8..acb1ce6fe6 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -313,7 +313,7 @@ void CJabberProto::OnIqResultSession(HXML iqNode, CJabberIqInfo *pInfo) OnLoggedIn(); } -void CJabberProto::GroupchatJoinByHContact(HCONTACT hContact, bool autojoin) +void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin) { ptrT roomjid( getTStringA(hContact, "ChatRoomID")); if (roomjid == NULL) @@ -425,7 +425,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) } } - HCONTACT hContact = HContactFromJID(jid); + MCONTACT hContact = HContactFromJID(jid); if (hContact == NULL) { // Received roster has a new JID. // Add the jid (with empty resource) to Miranda contact list. @@ -496,8 +496,8 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) // Delete orphaned contacts (if roster sync is enabled) if (m_options.RosterSync == TRUE) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) { - HCONTACT hNext = db_find_next(hContact, m_szModuleName); + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; ) { + MCONTACT hNext = db_find_next(hContact, m_szModuleName); ptrT jid( getTStringA(hContact, "jid")); if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) { debugLogA("Syncing roster: preparing to delete %S (hContact=0x%x)", jid, hContact); @@ -515,7 +515,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (m_options.AutoJoinConferences) for (i=0; i < chatRooms.getCount(); i++) - GroupchatJoinByHContact((HCONTACT)chatRooms[i], true); + GroupchatJoinByHContact((MCONTACT)chatRooms[i], true); //UI_SAFE_NOTIFY(m_pDlgJabberJoinGroupchat, WM_JABBER_CHECK_ONLINE); //UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_CHECK_ONLINE); @@ -565,7 +565,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) if ((from = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return; if (!lstrcmp(type, _T("result"))) { - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact != NULL) setByte(hContact, "IsTransport", TRUE); @@ -583,7 +583,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) ///////////////////////////////////////////////////////////////////////////////////////// // JabberIqResultGetVcard - processes the server-side v-card -void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT hContact, bool &hasPhoto) +void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, MCONTACT hContact, bool &hasPhoto) { debugLogA("JabberIqResultGetVcardPhoto: %d", hasPhoto); if (hasPhoto) @@ -661,7 +661,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) { HXML vCardNode, m, n, o; const TCHAR *type, *jid; - HCONTACT hContact; + MCONTACT hContact; TCHAR text[128]; DBVARIANT dbv; @@ -1284,7 +1284,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*) if (from == NULL) return; - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact == NULL) return; @@ -1324,7 +1324,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*) const TCHAR *from = xmlGetAttrValue(iqNode, _T("from")); if (from == NULL) return; - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact == NULL) return; @@ -1363,7 +1363,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo) if (from == NULL) return; - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact == NULL) return; @@ -1396,7 +1396,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo) } -void CJabberProto::OnIqResultGotAvatar(HCONTACT hContact, HXML n, const TCHAR *mimeType) +void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType) { unsigned resultLen; ptrA body((char*)mir_base64_decode( _T2A(xmlGetText(n)), &resultLen)); diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index eaddb149eb..081da8675f 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -212,9 +212,9 @@ struct JABBER_LIST_ITEM : public MZeroedObject struct JABBER_HTTP_AVATARS { char * Url; - HCONTACT hContact; + MCONTACT hContact; - JABBER_HTTP_AVATARS(const TCHAR *tUrl, HCONTACT thContact) + JABBER_HTTP_AVATARS(const TCHAR *tUrl, MCONTACT thContact) : Url(mir_t2a(tUrl)), hContact(thContact) {} ~JABBER_HTTP_AVATARS() { mir_free(Url); } diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index b644efbbd8..c816f155e1 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -73,7 +73,7 @@ static INT_PTR JabberMenuChooseService(WPARAM wParam, LPARAM lParam) return 0; } -static CJabberProto* JabberGetInstanceByHContact(HCONTACT hContact) +static CJabberProto* JabberGetInstanceByHContact(MCONTACT hContact) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -88,73 +88,73 @@ static CJabberProto* JabberGetInstanceByHContact(HCONTACT hContact) static INT_PTR JabberMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuHandleRequestAuth(wParam, lParam) : 0; } static INT_PTR JabberMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuHandleGrantAuth(wParam, lParam) : 0; } static INT_PTR JabberMenuRevokeAuth(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuRevokeAuth(wParam, lParam) : 0; } static INT_PTR JabberMenuConvertChatContact(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuConvertChatContact(wParam, lParam) : 0; } static INT_PTR JabberMenuRosterAdd(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuRosterAdd(wParam, lParam) : 0; } static INT_PTR JabberMenuBookmarkAdd(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuBookmarkAdd(wParam, lParam) : 0; } static INT_PTR JabberMenuTransportLogin(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuTransportLogin(wParam, lParam) : 0; } static INT_PTR JabberMenuTransportResolve(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuTransportResolve(wParam, lParam) : 0; } static INT_PTR JabberContactMenuRunCommands(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->ContactMenuRunCommands(wParam, lParam) : 0; } static INT_PTR JabberMenuSendNote(WPARAM wParam, LPARAM lParam) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuSendNote(wParam, lParam) : 0; } static INT_PTR JabberMenuHandleResource(WPARAM wParam, LPARAM lParam, LPARAM lRes) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuHandleResource(wParam, lParam, lRes) : 0; } static INT_PTR JabberMenuHandleDirectPresence(WPARAM wParam, LPARAM lParam, LPARAM lRes) { - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnMenuHandleDirectPresence(wParam, lParam, lRes) : 0; } @@ -173,7 +173,7 @@ static int JabberPrebuildContactMenu(WPARAM wParam, LPARAM lParam) Menu_ShowItem(g_hMenuResourcesRoot, FALSE); Menu_ShowItem(g_hMenuDirectPresence[0], FALSE); - CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam); + CJabberProto *ppro = JabberGetInstanceByHContact((MCONTACT)wParam); return(ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0; } @@ -347,7 +347,7 @@ void g_MenuUninit(void) int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) return 0; @@ -479,7 +479,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; BYTE bIsChatRoom = isChatRoom(hContact); const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid"; @@ -494,7 +494,7 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return 0; // we do not add ourself to the roster. (buggy situation - should not happen) @@ -524,7 +524,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && m_bJabberOnline) { ptrT jid(getTStringA(hContact, "jid")); if (jid != NULL) @@ -535,7 +535,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && m_bJabberOnline) { ptrT jid(getTStringA(hContact, "jid")); if (jid != NULL) @@ -546,7 +546,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && m_bJabberOnline) { ptrT jid(getTStringA(hContact, "jid")); if (jid != NULL) @@ -557,7 +557,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!getByte(hContact, "IsTransport", 0)) return 0; @@ -573,7 +573,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!getByte(hContact, "IsTransport", 0)) return 0; @@ -585,7 +585,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return 0; // we do not add ourself to the roster. (buggy situation - should not happen) @@ -977,7 +977,7 @@ void CJabberProto::MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item) if (item->list != LIST_ROSTER) return; - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (!hContact) return; @@ -1043,7 +1043,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam) if (lstrcmpA(sicd->szModule, m_szModuleName)) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return 0; @@ -1097,7 +1097,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM if (!m_bJabberOnline || !wParam) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ptrT tszJid(getTStringA(hContact, "jid")); if (tszJid == NULL) return 0; @@ -1129,7 +1129,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM wParam, LPARAM l if (!m_bJabberOnline || !wParam) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; TCHAR *jid, text[1024]; ptrT tszJid(getTStringA(hContact, "jid")); diff --git a/protocols/JabberG/src/jabber_message_manager.h b/protocols/JabberG/src/jabber_message_manager.h index e2bc848e2b..ab12cf7ca7 100644 --- a/protocols/JabberG/src/jabber_message_manager.h +++ b/protocols/JabberG/src/jabber_message_manager.h @@ -57,7 +57,7 @@ public: LPCTSTR m_szChildTagXmlns; LPCTSTR m_szChildTagName; HXML m_hChildNode; - HCONTACT m_hContact; + MCONTACT m_hContact; LPCTSTR m_szTo; LPCTSTR m_szId; @@ -77,7 +77,7 @@ public: __forceinline LPCTSTR GetIdStr() { return m_szId; } - __forceinline HCONTACT GetHContact() + __forceinline MCONTACT GetHContact() { return m_hContact; } __forceinline HXML GetChildNode() diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 04af56aec0..e3b56f08b5 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -70,7 +70,7 @@ int JabberCompareJids(const TCHAR *jid1, const TCHAR *jid2) void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick) { - HCONTACT hContact = DBCreateContact(jid, nick, TRUE, TRUE); + MCONTACT hContact = DBCreateContact(jid, nick, TRUE, TRUE); delSetting(hContact, "Hidden"); char* szJid = mir_utf8encodeT(jid); @@ -103,7 +103,7 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick) /////////////////////////////////////////////////////////////////////////////// // JabberDBCreateContact() -HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource) +MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource) { if (jid == NULL || jid[0]=='\0') return NULL; @@ -120,7 +120,7 @@ HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL // We can't use JabberHContactFromJID() here because of the stripResource option size_t len = _tcslen(s); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT jid( getTStringA(hContact, "jid")); if (jid == NULL) continue; @@ -130,7 +130,7 @@ HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL return hContact; } - HCONTACT hNewContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName); setTString(hNewContact, "jid", s); if (nick != NULL && *nick != '\0') @@ -144,7 +144,7 @@ HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL return hNewContact; } -BOOL CJabberProto::AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType) +BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType) { if (!hContact) return FALSE; @@ -179,7 +179,7 @@ BOOL CJabberProto::AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType) /////////////////////////////////////////////////////////////////////////////// // JabberGetAvatarFileName() - gets a file name for the avatar image -void CJabberProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen) +void CJabberProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName); @@ -219,7 +219,7 @@ void CJabberProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t c void CJabberProto::ResolveTransportNicks(const TCHAR *jid) { // Set all contacts to offline - HCONTACT hContact = m_ThreadInfo->resolveContact; + MCONTACT hContact = m_ThreadInfo->resolveContact; if (hContact == NULL) hContact = db_find_first(m_szModuleName); @@ -320,7 +320,7 @@ static sttCapsNodeToName_Map[] = void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item) { - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (!hContact) return; @@ -396,7 +396,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res) } -void CJabberProto::UpdateMirVer(HCONTACT hContact, pResourceStatus &resource) +void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource) { CMString tszMirVer; FormatMirVer(resource, tszMirVer); @@ -415,7 +415,7 @@ void CJabberProto::UpdateMirVer(HCONTACT hContact, pResourceStatus &resource) setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid); } -void CJabberProto::UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item) +void CJabberProto::UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item) { switch (item->subscription) { case SUB_TO: @@ -445,7 +445,7 @@ void CJabberProto::UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *i } } -void CJabberProto::SetContactOfflineStatus(HCONTACT hContact) +void CJabberProto::SetContactOfflineStatus(MCONTACT hContact) { if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) setWord(hContact, "Status", ID_STATUS_OFFLINE); @@ -482,7 +482,7 @@ void CJabberProto::InitPopups(void) Skin_ReleaseIcon(ppc.hIcon); } -void CJabberProto::MsgPopup(HCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle) +void CJabberProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle) { if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) { char name[256]; diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index db49f4d08e..9a9f88f1b0 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -813,7 +813,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM) { if (wParam) { - CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA((HCONTACT)wParam, "jid"))); + CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA((MCONTACT)wParam, "jid"))); CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote); pDlg->Show(); } diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index d6720c5a84..a1978f2c89 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -858,7 +858,7 @@ public: JABBER_LIST_ITEM *item = m_proto->ListGetItemPtrFromIndex(index); if (item != NULL) { if (_tcschr(item->jid, '@') == NULL) { - HCONTACT hContact = m_proto->HContactFromJID(item->jid); + MCONTACT hContact = m_proto->HContactFromJID(item->jid); if (hContact != NULL) { if (bChecked) { if (item->getTemp()->m_iStatus != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) { @@ -1039,7 +1039,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) } // now it is require to process whole contact list to add not in roster contacts - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT tszJid( getTStringA(hContact, "jid")); if (tszJid == NULL) continue; diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index f5cb1785c9..e3ecbe6c74 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -418,7 +418,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0); { - for (HCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) { ptrT jid( m_proto->getTStringA(hContact, "jid")); if (jid != NULL) SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid); @@ -1153,7 +1153,7 @@ void CJabberDlgPrivacyLists::DrawRulesList(LPDRAWITEMSTRUCT lpdis) DrawNextRulePart(lpdis->hDC, clLine1, pRule->GetValue(), &rc); DrawNextRulePart(lpdis->hDC, clLine2, TranslateT("'"), &rc); - if (HCONTACT hContact = m_proto->HContactFromJID(pRule->GetValue())) { + if (MCONTACT hContact = m_proto->HContactFromJID(pRule->GetValue())) { TCHAR *szName = pcli->pfnGetContactDisplayName(hContact, 0); if (szName) { DrawNextRulePart(lpdis->hDC, clLine2, TranslateT(" (nickname: "), &rc); @@ -1300,7 +1300,7 @@ void CJabberDlgPrivacyLists::CListResetOptions(HWND) void CJabberDlgPrivacyLists::CListFilter(HWND) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *proto = GetContactProto(hContact); if (!proto || lstrcmpA(proto, m_proto->m_szModuleName)) if (HANDLE hItem = m_clcClist.FindContact(hContact)) @@ -1322,7 +1322,7 @@ void CJabberDlgPrivacyLists::CListSetupIcons(HWND, HANDLE hItem, int iSlot, DWOR HANDLE CJabberDlgPrivacyLists::CListAddContact(HWND hwndList, TCHAR *jid) { - HCONTACT hContact = m_proto->HContactFromJID(jid); + MCONTACT hContact = m_proto->HContactFromJID(jid); if (hContact) return m_clcClist.FindContact(hContact); @@ -1357,7 +1357,7 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) CListResetIcons(hwndList, hItem, bHideIcons); } - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = m_clcClist.FindContact(hContact); if (hItem) CListResetIcons(hwndList, hItem, bHideIcons); @@ -1455,7 +1455,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) pList->AddRule(Jid, szJid, FALSE, dwOrder++, dwPackets); } - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { hItem = m_clcClist.FindContact(hContact); ptrT jid( m_proto->getTStringA(hContact, "jid")); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index fc34abf429..b380fa7276 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -257,7 +257,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) ConvertPasswords(); // Set all contacts to offline - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { SetContactOfflineStatus(hContact); if (!getByte(hContact, "IsTransport", 0)) @@ -314,9 +314,9 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) //////////////////////////////////////////////////////////////////////////////////////// // JabberAddToList - adds a contact to the contact list -HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) +MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) { - HCONTACT hContact; + MCONTACT hContact; TCHAR *jid, *nick; debugLogA("AddToListByJID jid = %S", newJid); @@ -325,7 +325,7 @@ HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) // not already there: add jid = mir_tstrdup(newJid); debugLogA("Add new jid to contact jid = %S", jid); - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); setTString(hContact, "jid", jid); if ((nick=JabberNickFromJID(newJid)) == NULL) @@ -358,7 +358,7 @@ HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) return hContact; } -HCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { if (psr->cbSize != sizeof(JABBER_SEARCH_RESULT) && psr->id == NULL) return NULL; @@ -368,7 +368,7 @@ HCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddToListByJID(jid, flags); } -HCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent) +MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent) { debugLogA("AddToListByEvent"); @@ -398,7 +398,7 @@ HCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HAN char *jid = lastName + strlen(lastName) + 1; TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid); - HCONTACT hContact = (HCONTACT)AddToListByJID(newJid, flags); + MCONTACT hContact = (MCONTACT)AddToListByJID(newJid, flags); mir_free(newJid); return hContact; } @@ -440,7 +440,7 @@ int CJabberProto::Authorize(HANDLE hDbEvent) if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) { debugLogA("Try adding contact automatically jid = %S", jid); - if (HCONTACT hContact = AddToListByJID(newJid, 0)) { + if (MCONTACT hContact = AddToListByJID(newJid, 0)) { // Trigger actual add by removing the "NotOnList" added by AddToListByJID() // See AddToListByJID() and JabberDbSettingChanged(). db_unset(hContact, "CList", "NotOnList"); @@ -492,7 +492,7 @@ int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CJabberProto::AuthRecv(HCONTACT, PROTORECVEVENT*) +int __cdecl CJabberProto::AuthRecv(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -500,7 +500,7 @@ int __cdecl CJabberProto::AuthRecv(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CJabberProto::AuthRequest(HCONTACT, const TCHAR*) +int __cdecl CJabberProto::AuthRequest(MCONTACT, const TCHAR*) { return 1; } @@ -516,7 +516,7 @@ HANDLE __cdecl CJabberProto::ChangeInfo(int /*iInfoType*/, void*) //////////////////////////////////////////////////////////////////////////////////////// // JabberFileAllow - starts a file transfer -HANDLE __cdecl CJabberProto::FileAllow(HCONTACT /*hContact*/, HANDLE hTransfer, const TCHAR *szPath) +HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const TCHAR *szPath) { if (!m_bJabberOnline) return 0; @@ -544,7 +544,7 @@ HANDLE __cdecl CJabberProto::FileAllow(HCONTACT /*hContact*/, HANDLE hTransfer, //////////////////////////////////////////////////////////////////////////////////////// // JabberFileCancel - cancels a file transfer -int __cdecl CJabberProto::FileCancel(HCONTACT, HANDLE hTransfer) +int __cdecl CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer) { filetransfer *ft = (filetransfer*)hTransfer; HANDLE hEvent; @@ -572,7 +572,7 @@ int __cdecl CJabberProto::FileCancel(HCONTACT, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // JabberFileDeny - denies a file transfer -int __cdecl CJabberProto::FileDeny(HCONTACT, HANDLE hTransfer, const TCHAR *) +int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR *) { if (!m_bJabberOnline) return 1; @@ -616,7 +616,7 @@ int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const TCHAR //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact) { switch(type) { case PFLAGNUM_1: @@ -644,7 +644,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CJabberProto::GetInfo(HCONTACT hContact, int /*infoType*/) +int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) { if (!m_bJabberOnline || isChatRoom(hContact)) return 1; @@ -858,7 +858,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CJabberProto::RecvContacts(HCONTACT, PROTORECVEVENT*) +int __cdecl CJabberProto::RecvContacts(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -866,7 +866,7 @@ int __cdecl CJabberProto::RecvContacts(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CJabberProto::RecvFile(HCONTACT hContact, PROTORECVFILET *evt) +int __cdecl CJabberProto::RecvFile(MCONTACT hContact, PROTORECVFILET *evt) { return Proto_RecvFile(hContact, evt); } @@ -874,7 +874,7 @@ int __cdecl CJabberProto::RecvFile(HCONTACT hContact, PROTORECVFILET *evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CJabberProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *evt) +int __cdecl CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) { ptrA szResUtf( mir_utf8encodeT((LPCTSTR)evt->lParam)); evt->pCustomData = szResUtf; @@ -886,7 +886,7 @@ int __cdecl CJabberProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CJabberProto::RecvUrl(HCONTACT, PROTORECVEVENT*) +int __cdecl CJabberProto::RecvUrl(MCONTACT, PROTORECVEVENT*) { return 1; } @@ -894,7 +894,7 @@ int __cdecl CJabberProto::RecvUrl(HCONTACT, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CJabberProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { if (!m_bJabberOnline) return 0; @@ -924,7 +924,7 @@ int __cdecl CJabberProto::SendContacts(HCONTACT hContact, int flags, int nContac //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CJabberProto::SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR** ppszFiles) +HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR** ppszFiles) { if (!m_bJabberOnline) return 0; @@ -1011,10 +1011,10 @@ HANDLE __cdecl CJabberProto::SendFile(HCONTACT hContact, const TCHAR *szDescript struct TFakeAckParams { - inline TFakeAckParams(HCONTACT _hContact, const char* _msg, int _msgid = 0) + inline TFakeAckParams(MCONTACT _hContact, const char* _msg, int _msgid = 0) : hContact(_hContact), msg(_msg), msgid(_msgid) {} - HCONTACT hContact; + MCONTACT hContact; const char *msg; int msgid; }; @@ -1034,7 +1034,7 @@ void __cdecl CJabberProto::SendMessageAckThread(void* param) static char PGP_PROLOG[] = "-----BEGIN PGP MESSAGE-----\r\n\r\n"; static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n"; -int __cdecl CJabberProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { TCHAR szClientJid[JABBER_MAX_JID_LEN]; if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, SIZEOF(szClientJid))) { @@ -1134,7 +1134,7 @@ int __cdecl CJabberProto::SendMsg(HCONTACT hContact, int flags, const char* pszS //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CJabberProto::SendUrl(HCONTACT, int /*flags*/, const char* /*url*/) +int __cdecl CJabberProto::SendUrl(MCONTACT, int /*flags*/, const char* /*url*/) { return 1; } @@ -1142,7 +1142,7 @@ int __cdecl CJabberProto::SendUrl(HCONTACT, int /*flags*/, const char* /*url*/) //////////////////////////////////////////////////////////////////////////////////////// // JabberSetApparentMode - sets the visibility status -int __cdecl CJabberProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode) { if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE) return 1; @@ -1224,7 +1224,7 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus) void __cdecl CJabberProto::GetAwayMsgThread(void *param) { - HCONTACT hContact = (HCONTACT)param; + MCONTACT hContact = (MCONTACT)param; ptrT jid( getTStringA(hContact, "jid")); if (jid != NULL) { @@ -1272,7 +1272,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0); } -HANDLE __cdecl CJabberProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact) { debugLogA("GetAwayMsg called, hContact=%08X", hContact); @@ -1283,7 +1283,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CJabberProto::RecvAwayMsg(HCONTACT, int /*statusMode*/, PROTORECVEVENT*) +int __cdecl CJabberProto::RecvAwayMsg(MCONTACT, int /*statusMode*/, PROTORECVEVENT*) { return 1; } @@ -1344,7 +1344,7 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg) ///////////////////////////////////////////////////////////////////////////////////////// // JabberUserIsTyping - sends a UTN notification -int __cdecl CJabberProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type) { if (!m_bJabberOnline) return 0; @@ -1426,7 +1426,7 @@ void CJabberProto::InfoFrame_OnSetup(CJabberInfoFrame_Event*) void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt) { if (evt->m_event == CJabberInfoFrame_Event::CLICK) { - HCONTACT hContact = (HCONTACT)evt->m_pUserData; + MCONTACT hContact = (MCONTACT)evt->m_pUserData; HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0); POINT pt; GetCursorPos(&pt); diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 80b206ce71..84533eb9da 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -82,23 +82,23 @@ struct CJabberProto : public PROTO, public IJabberInterface // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const TCHAR *id); virtual HANDLE __cdecl SearchByEmail(const TCHAR *email); @@ -106,24 +106,24 @@ struct CJabberProto : public PROTO, public IJabberInterface virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -132,7 +132,7 @@ struct CJabberProto : public PROTO, public IJabberInterface INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam); //====| Events |====================================================================== - void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, HCONTACT hContact); + void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, MCONTACT hContact); int __cdecl OnContactDeleted(WPARAM, LPARAM); int __cdecl OnDbSettingChanged(WPARAM, LPARAM); int __cdecl OnIdleChanged(WPARAM, LPARAM); @@ -145,8 +145,8 @@ struct CJabberProto : public PROTO, public IJabberInterface int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM); int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM); int __cdecl OnReloadIcons(WPARAM, LPARAM); - void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, HCONTACT hContact); - void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, HCONTACT hContact); + void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, MCONTACT hContact); + void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, MCONTACT hContact); int __cdecl OnUserInfoInit(WPARAM, LPARAM); int __cdecl JabberGcEventHook(WPARAM, LPARAM); @@ -294,7 +294,7 @@ struct CJabberProto : public PROTO, public IJabberInterface //---- jabber_archive.c -------------------------------------------------------------- void EnableArchive(bool bEnable); - void RetrieveMessageArchive(HCONTACT hContact, JABBER_LIST_ITEM *pItem); + void RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *pItem); void OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*); void OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*); @@ -451,7 +451,7 @@ struct CJabberProto : public PROTO, public IJabberInterface int LoadAdvancedIcons(int iID); int GetTransportProtoID(TCHAR* TransportDomain); int GetTransportStatusIconIndex(int iID, int Status); - BOOL DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact); + BOOL DBCheckIsTransportedContact(const TCHAR *jid, MCONTACT hContact); void CheckAllContactsAreTransported(void); INT_PTR __cdecl JGetAdvancedStatusIcon(WPARAM wParam, LPARAM lParam); @@ -472,7 +472,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo *pInfo); void OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo *pInfo); void OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo); - void OnIqResultGotAvatar(HCONTACT hContact, HXML n, const TCHAR *mimeType); + void OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType); void OnIqResultGetMuc(HXML iqNode, CJabberIqInfo *pInfo); void OnIqResultGetRegister(HXML iqNode, CJabberIqInfo *pInfo); void OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo); @@ -528,7 +528,7 @@ struct CJabberProto : public PROTO, public IJabberInterface //---- jabber_iqid.cpp --------------------------------------------------------------- - void GroupchatJoinByHContact(HCONTACT hContact, bool autojoin=false); + void GroupchatJoinByHContact(MCONTACT hContact, bool autojoin=false); //---- jabber_message_handlers.cpp --------------------------------------------------- @@ -560,7 +560,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType); void OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo *pInfo); - void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT hContact, bool &hasPhoto); + void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, MCONTACT hContact, bool &hasPhoto); void SetBookmarkRequest (XmlNodeIq& iqId); //---- jabber_menu.cpp --------------------------------------------------------------- @@ -584,7 +584,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void MenuInit(void); void MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item); - void AuthWorker(HCONTACT hContact, char* authReqType); + void AuthWorker(MCONTACT hContact, char* authReqType); void UpdatePriorityMenu(short priority); @@ -599,18 +599,18 @@ struct CJabberProto : public PROTO, public IJabberInterface void AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName); void DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick); - BOOL AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType); - HCONTACT DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource); - void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen); + BOOL AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType); + MCONTACT DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource); + void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen); void ResolveTransportNicks(const TCHAR *jid); void SetServerStatus(int iNewStatus); void FormatMirVer(pResourceStatus &resource, CMString&); void UpdateMirVer(JABBER_LIST_ITEM *item); - void UpdateMirVer(HCONTACT hContact, pResourceStatus &resource); - void UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item); - void SetContactOfflineStatus(HCONTACT hContact); + void UpdateMirVer(MCONTACT hContact, pResourceStatus &resource); + void UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item); + void SetContactOfflineStatus(MCONTACT hContact); void InitPopups(void); - void MsgPopup(HCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle); + void MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle); //---- jabber_opt.cpp ---------------------------------------------------------------- @@ -653,7 +653,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void __cdecl GetAwayMsgThread(void* hContact); void __cdecl SendMessageAckThread(void* hContact); - HCONTACT AddToListByJID(const TCHAR *newJid, DWORD flags); + MCONTACT AddToListByJID(const TCHAR *newJid, DWORD flags); void WindowSubscribe(HWND hwnd); void WindowUnsubscribe(HWND hwnd); void WindowNotify(UINT msg, bool async = false); @@ -739,7 +739,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void OnProcessProtocol(HXML node, ThreadData *info); void UpdateJidDbSettings(const TCHAR *jid); - HCONTACT CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem); + MCONTACT CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem); void PerformRegistration(ThreadData* info); void PerformIqAuth(ThreadData* info); @@ -759,8 +759,8 @@ struct CJabberProto : public PROTO, public IJabberInterface //---- jabber_util.c ----------------------------------------------------------------- pResourceStatus ResourceInfoFromJID(const TCHAR *jid); - HCONTACT HContactFromJID(const TCHAR *jid, BOOL bStripResource = 3); - HCONTACT ChatRoomHContactFromJID(const TCHAR *jid); + MCONTACT HContactFromJID(const TCHAR *jid, BOOL bStripResource = 3); + MCONTACT ChatRoomHContactFromJID(const TCHAR *jid); void SendVisibleInvisiblePresence(BOOL invisible); void SendPresenceTo(int status, const TCHAR* to, HXML extra, const TCHAR *msg = NULL); void SendPresence(int m_iStatus, bool bSendToAll); @@ -768,7 +768,7 @@ struct CJabberProto : public PROTO, public IJabberInterface void RebuildInfoFrame(void); // returns buf or NULL on error - TCHAR* GetClientJID(HCONTACT hContact, TCHAR *dest, size_t destLen); + TCHAR* GetClientJID(MCONTACT hContact, TCHAR *dest, size_t destLen); TCHAR* GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen); void ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount=JABBER_DEFAULT_RECENT_COUNT); @@ -819,16 +819,16 @@ struct CJabberProto : public PROTO, public IJabberInterface HICON GetXStatusIcon(int bStatus, UINT flags); void RegisterAdvStatusSlot(const char *pszSlot); - void ResetAdvStatus(HCONTACT hContact, const char *pszSlot); - void WriteAdvStatus(HCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText); - char* ReadAdvStatusA(HCONTACT hContact, const char *pszSlot, const char *pszValue); - TCHAR* ReadAdvStatusT(HCONTACT hContact, const char *pszSlot, const char *pszValue); + void ResetAdvStatus(MCONTACT hContact, const char *pszSlot); + void WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText); + char* ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const char *pszValue); + TCHAR* ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue); BOOL SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource, TCHAR* szTitle, TCHAR* szTrack, TCHAR* szUri); void XStatusInit(void); - void SetContactTune(HCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack); + void SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack); void InfoFrame_OnUserMood(CJabberInfoFrame_Event *evt); void InfoFrame_OnUserActivity(CJabberInfoFrame_Event *evt); @@ -857,8 +857,8 @@ public: DWORD STDMETHODCALLTYPE GetJabberVersion() const; // Returns Jabber plugin version. int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2); // Strips resource names from given JIDs and returns result of comparison for these JIDs. - HCONTACT STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID. - LPTSTR STDMETHODCALLTYPE ContactToJID(HCONTACT hContact); // Returns JID of hContact. You must free the result using mir_free(). + MCONTACT STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID. + LPTSTR STDMETHODCALLTYPE ContactToJID(MCONTACT hContact); // Returns JID of hContact. You must free the result using mir_free(). LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid); // Returns best resource name for given JID. You must free the result using mir_free(). LPTSTR STDMETHODCALLTYPE GetResourceList(LPCTSTR jid); // Returns all resource names for a given JID in format "resource1\0resource2\0resource3\0\0" (all resources are separated by \0 character and the whole string is terminated with two \0 characters). You must free the string using mir_free(). char* STDMETHODCALLTYPE GetModuleName() const; // Returns Jabber module name. diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 5df492cb82..a4cbc67229 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -466,7 +466,7 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe int CJabberProto::RcGetUnreadEventsCount() { int nEventsSent = 0; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT jid( getTStringA(hContact, "jid")); if (jid == NULL) continue; @@ -552,7 +552,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0; int nEventsSent = 0; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT tszJid( getTStringA(hContact, "jid")); if (tszJid == NULL) continue; diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index 985030607f..1d633787eb 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -41,7 +41,7 @@ void __forceinline sttCryptString(char *str) } } -static TCHAR* JSetStringCrypt(LPCSTR szModule, HCONTACT hContact, char *valueName) +static TCHAR* JSetStringCrypt(LPCSTR szModule, MCONTACT hContact, char *valueName) { DBVARIANT dbv; if (db_get_s(hContact, szModule, valueName, &dbv)) @@ -62,7 +62,7 @@ void CJabberProto::ConvertPasswords() setTString("Password", passw); delSetting("LoginPassword"); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if ((passw = JSetStringCrypt(m_szModuleName, hContact, "LoginPassword")) == NULL) continue; diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 6741a69007..d1e828ea2c 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -449,7 +449,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) return 1; TCHAR *szMsgBody = NULL; - HCONTACT hContact = HContactFromJID(szJid, TRUE); + MCONTACT hContact = HContactFromJID(szJid, TRUE); if (hContact == NULL) hContact = DBCreateContact(szJid, szJid, TRUE, TRUE); if (hContact == NULL) @@ -520,7 +520,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) if (!ServiceExists(MS_FILE_SENDFILE)) return 1; - HCONTACT hContact = HContactFromJID(szJid, TRUE); + MCONTACT hContact = HContactFromJID(szJid, TRUE); if (hContact == NULL) hContact = DBCreateContact(szJid, szJid, TRUE, TRUE); if (hContact == NULL) @@ -538,7 +538,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM wParam, LPARAM) if (!m_bJabberOnline) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; ptrT jid( getTStringA(hContact, "jid")); if (jid == NULL) return 0; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index eed8b47784..41c7238f64 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -559,7 +559,7 @@ recvRest: ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); // Set all contacts to offline - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) SetContactOfflineStatus(hContact); mir_free(m_szJabberJID); @@ -995,7 +995,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) m_pepServices.ProcessEvent(from, eventNode); - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (!hContact) return; @@ -1030,7 +1030,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) } // returns 0, if error or no events -DWORD JabberGetLastContactMessageTime(HCONTACT hContact) +DWORD JabberGetLastContactMessageTime(MCONTACT hContact) { // TODO: time cache can improve performance HANDLE hDbEvent = db_event_last(hContact); @@ -1051,9 +1051,9 @@ DWORD JabberGetLastContactMessageTime(HCONTACT hContact) return dwTime; } -HCONTACT CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem) +MCONTACT CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; if (chatItem) { const TCHAR *p = _tcschr(szJid, '/'); if (p != NULL && p[1] != '\0') @@ -1101,7 +1101,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) if (m_messageManager.HandleMessagePermanent(node, info)) return; - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, from); if (chatItem) { HXML xCaptcha = xmlGetChild(node, "captcha"); @@ -1353,12 +1353,12 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) const TCHAR *group = xmlGetText(xmlGetChild(iNode, _T("group"))); if (action && jid && _tcsstr(jid, chkJID)) { if (!_tcscmp(action, _T("add"))) { - HCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE); + MCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE); if (group) db_set_ts(hContact, "CList", "Group", group); } else if (!_tcscmp(action, _T("delete"))) { - HCONTACT hContact = HContactFromJID(jid); + MCONTACT hContact = HContactFromJID(jid); if (hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); } @@ -1462,7 +1462,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) r->m_tszCapsNode = mir_tstrdup(szNode); r->m_tszCapsVer = mir_tstrdup(szVer); r->m_tszCapsExt = mir_tstrdup(szExt); - HCONTACT hContact = HContactFromJID(from); + MCONTACT hContact = HContactFromJID(from); if (hContact) UpdateMirVer(hContact, r); } @@ -1477,7 +1477,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid); if (item == NULL) return; - HCONTACT hContact = HContactFromJID(jid); + MCONTACT hContact = HContactFromJID(jid); if (hContact == NULL) return; @@ -1535,7 +1535,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) { - HCONTACT hContact; + MCONTACT hContact; HXML showNode; JABBER_LIST_ITEM *item; LPCTSTR from, show; diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index adb80356f6..68eaaf10c0 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -74,7 +74,7 @@ struct UserInfoStringBuf struct JabberUserInfoDlgData { - HCONTACT hContact; + MCONTACT hContact; CJabberProto *ppro; JABBER_LIST_ITEM *item; int resourcesCount; @@ -311,7 +311,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda core version"), r->m_tszXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++)); } -static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, HCONTACT hContact, TCHAR *szTitle, char *pszSlot) +static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, MCONTACT hContact, TCHAR *szTitle, char *pszSlot) { char *szAdvStatusIcon = ppro->ReadAdvStatusA(hContact, pszSlot, ADVSTATUS_VAL_ICON); TCHAR *szAdvStatusTitle = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TITLE); @@ -340,7 +340,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, ppro->LoadIconEx("main"), _T("JID"), item->jid, sttInfoLineId(0, INFOLINE_NAME), true); TCHAR buf[256]; - if (HCONTACT hContact = ppro->HContactFromJID(item->jid)) { + if (MCONTACT hContact = ppro->HContactFromJID(item->jid)) { sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_MOOD), hContact, TranslateT("Mood"), ADVSTATUS_MOOD); sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_ACTIVITY), hContact, TranslateT("Activity"), ADVSTATUS_ACTIVITY); sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_TUNE), hContact, TranslateT("Tune"), ADVSTATUS_TUNE); @@ -445,7 +445,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa dat->resourcesCount = -1; if (CallService(MS_DB_CONTACT_IS, (WPARAM)lParam, 0)) - dat->hContact = (HCONTACT)lParam; + dat->hContact = (MCONTACT)lParam; else if (!IsBadReadPtr((void*)lParam, sizeof(JABBER_LIST_ITEM))) { dat->hContact = NULL; dat->item = (JABBER_LIST_ITEM *)lParam; @@ -550,7 +550,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa switch (((LPNMHDR)lParam)->code) { case PSN_INFOCHANGED: { - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; SendMessage(hwndDlg, WM_JABBER_REFRESH, 0, (LPARAM)hContact); } break; @@ -589,7 +589,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa struct USER_PHOTO_INFO { - HCONTACT hContact; + MCONTACT hContact; HBITMAP hBitmap; CJabberProto *ppro; }; @@ -605,7 +605,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP // lParam is hContact TranslateDialogDefault(hwndDlg); photoInfo = (USER_PHOTO_INFO *) mir_alloc(sizeof(USER_PHOTO_INFO)); - photoInfo->hContact = (HCONTACT)lParam; + photoInfo->hContact = (MCONTACT)lParam; photoInfo->ppro = NULL; photoInfo->hBitmap = NULL; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) photoInfo); @@ -800,7 +800,7 @@ int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName)) return 0; - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; if (hContact == NULL) { // Show our vcard OnUserInfoInit_VCard(wParam, lParam); @@ -844,7 +844,7 @@ void JabberUserInfoUninit() ///////////////////////////////////////////////////////////////////////////////////////// // JabberUserInfoUpdate -void JabberUserInfoUpdate(HCONTACT hContact) +void JabberUserInfoUpdate(MCONTACT hContact) { if (!hContact) WindowList_BroadcastAsync(hUserInfoList, WM_JABBER_REFRESH, 0, 0); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 9a881deafb..a93186ee14 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -32,14 +32,14 @@ int CJabberProto::SerialNext(void) } /////////////////////////////////////////////////////////////////////////////// -// JabberChatRoomHContactFromJID - looks for the char room HCONTACT with required JID +// JabberChatRoomHContactFromJID - looks for the char room MCONTACT with required JID -HCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid) +MCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid) { if (jid == NULL) return NULL; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrT dbJid( getTStringA(hContact, "ChatRoomID")); if (dbJid == NULL) if ((dbJid = getTStringA(hContact, "jid")) == NULL) @@ -53,16 +53,16 @@ HCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid) } /////////////////////////////////////////////////////////////////////////////// -// JabberHContactFromJID - looks for the HCONTACT with required JID +// JabberHContactFromJID - looks for the MCONTACT with required JID -HCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, BOOL bStripResource) +MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, BOOL bStripResource) { if (jid == NULL) return NULL; JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { bool bIsChat = isChatRoom(hContact); ptrT dbJid( getTStringA(hContact, bIsChat ? "ChatRoomID" : "jid")); @@ -513,7 +513,7 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible) if (item == NULL) continue; - HCONTACT hContact = HContactFromJID(item->jid); + MCONTACT hContact = HContactFromJID(item->jid); if (hContact == NULL) continue; @@ -727,7 +727,7 @@ int __stdcall JabberGetPacketID(HXML n) /////////////////////////////////////////////////////////////////////////////// // JabberGetClientJID - adds a resource postfix to a JID -TCHAR* CJabberProto::GetClientJID(HCONTACT hContact, TCHAR *dest, size_t destLen) +TCHAR* CJabberProto::GetClientJID(MCONTACT hContact, TCHAR *dest, size_t destLen) { if (hContact == NULL) return NULL; @@ -932,7 +932,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) { if ((item=ppro->ListGetItemPtrFromIndex(i)) != NULL) { if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription!=SUB_NONE) { - HCONTACT hContact = ppro->HContactFromJID(item->jid); + MCONTACT hContact = ppro->HContactFromJID(item->jid); if (hContact == NULL) continue; char name[128]; diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 28d8b2a416..4843701d63 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -616,7 +616,7 @@ CPepMood::~CPepMood() void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode) { - HCONTACT hContact = NULL, hSelfContact = NULL; + MCONTACT hContact = NULL, hSelfContact = NULL; if (!m_proto->IsMyOwnJID(from)) { hContact = m_proto->HContactFromJID(from); if (!hContact) return; @@ -659,19 +659,19 @@ void CPepMood::CreateData(HXML n) moodNode << XCHILD(_T("text"), m_text); } -void CPepMood::ResetExtraIcon(HCONTACT hContact) +void CPepMood::ResetExtraIcon(MCONTACT hContact) { char *szMood = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_MOOD, "id"); SetExtraIcon(hContact, szMood); mir_free(szMood); } -void CPepMood::SetExtraIcon(HCONTACT hContact, char *szMood) +void CPepMood::SetExtraIcon(MCONTACT hContact, char *szMood) { ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibHandle(szMood)); } -void CPepMood::SetMood(HCONTACT hContact, const TCHAR *szMood, const TCHAR *szText) +void CPepMood::SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szText) { int mood = -1; if (szMood) { @@ -994,7 +994,7 @@ CPepActivity::~CPepActivity() void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode) { - HCONTACT hContact = NULL, hSelfContact = NULL; + MCONTACT hContact = NULL, hSelfContact = NULL; if (!m_proto->IsMyOwnJID(from)) { hContact = m_proto->HContactFromJID(from); if (!hContact) return; @@ -1051,19 +1051,19 @@ void CPepActivity::CreateData(HXML n) activityNode << XCHILD(_T("text"), m_text); } -void CPepActivity::ResetExtraIcon(HCONTACT hContact) +void CPepActivity::ResetExtraIcon(MCONTACT hContact) { char *szActivity = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_ACTIVITY, "id"); SetExtraIcon(hContact, szActivity); mir_free(szActivity); } -void CPepActivity::SetExtraIcon(HCONTACT hContact, char *szActivity) +void CPepActivity::SetExtraIcon(MCONTACT hContact, char *szActivity) { ExtraIcon_SetIcon(hExtraActivity, hContact, szActivity == NULL ? NULL : g_ActivityIcons.GetIcolibHandle(szActivity)); } -void CPepActivity::SetActivity(HCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText) +void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText) { int activity = -1; if (szFirst || szSecond) { @@ -1194,7 +1194,7 @@ BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource return TRUE; } -void CJabberProto::SetContactTune(HCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack) +void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack) { if (!szArtist && !szTitle) { delSetting(hContact, "ListeningTo"); @@ -1342,7 +1342,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pepMood == NULL) return 1; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // fill status member if (pData->flags & CSSF_MASK_STATUS) @@ -1451,7 +1451,7 @@ void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot) db_set_resident(szSetting, "text"); } -void CJabberProto::ResetAdvStatus(HCONTACT hContact, const char *pszSlot) +void CJabberProto::ResetAdvStatus(MCONTACT hContact, const char *pszSlot) { char szSetting[128]; mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot); @@ -1467,7 +1467,7 @@ void CJabberProto::ResetAdvStatus(HCONTACT hContact, const char *pszSlot) db_unset(hContact, "AdvStatus", szSetting); } -void CJabberProto::WriteAdvStatus(HCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText) +void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText) { char szSetting[128]; @@ -1490,14 +1490,14 @@ void CJabberProto::WriteAdvStatus(HCONTACT hContact, const char *pszSlot, const } } -char* CJabberProto::ReadAdvStatusA(HCONTACT hContact, const char *pszSlot, const char *pszValue) +char* CJabberProto::ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const char *pszValue) { char szSetting[128]; mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue); return db_get_sa(hContact, "AdvStatus", szSetting); } -TCHAR* CJabberProto::ReadAdvStatusT(HCONTACT hContact, const char *pszSlot, const char *pszValue) +TCHAR* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue) { char szSetting[128]; mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue); diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h index f0ebf5429a..cbe77aae6f 100644 --- a/protocols/JabberG/src/jabber_xstatus.h +++ b/protocols/JabberG/src/jabber_xstatus.h @@ -45,7 +45,7 @@ public: virtual void InitGui() {} virtual void RebuildMenu() {} - virtual void ResetExtraIcon(HCONTACT) {} + virtual void ResetExtraIcon(MCONTACT) {} virtual bool LaunchSetGui() { return false; } protected: @@ -88,7 +88,7 @@ public: (*this)[i].RebuildMenu(); } - void ResetExtraIcon(HCONTACT hContact) + void ResetExtraIcon(MCONTACT hContact) { for (int i=0; i < getCount(); i++) (*this)[i].ResetExtraIcon(hContact); @@ -152,7 +152,7 @@ public: CPepMood(CJabberProto *proto); ~CPepMood(); void ProcessItems(const TCHAR *from, HXML items); - void ResetExtraIcon(HCONTACT hContact); + void ResetExtraIcon(MCONTACT hContact); public: TCHAR *m_text; @@ -161,9 +161,9 @@ public: protected: void CreateData(HXML); void ShowSetDialog(BYTE bQuiet); - void SetExtraIcon(HCONTACT hContact, char *szMood); + void SetExtraIcon(MCONTACT hContact, char *szMood); - void SetMood(HCONTACT hContact, const TCHAR *szMood, const TCHAR *szText); + void SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szText); }; class CPepActivity: public CPepGuiService @@ -173,7 +173,7 @@ public: CPepActivity(CJabberProto *proto); ~CPepActivity(); void ProcessItems(const TCHAR *from, HXML items); - void ResetExtraIcon(HCONTACT hContact); + void ResetExtraIcon(MCONTACT hContact); protected: TCHAR *m_text; @@ -181,9 +181,9 @@ protected: void CreateData(HXML); void ShowSetDialog(BYTE bQuiet); - void SetExtraIcon(HCONTACT hContact, char *szActivity); + void SetExtraIcon(MCONTACT hContact, char *szActivity); - void SetActivity(HCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText); + void SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText); }; #endif // _JABBER_XSTATUS_H_ diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index d48e881578..45303df0bc 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -601,7 +601,7 @@ BOOL CCtrlClc::OnNotify(int, NMHDR *pnmh) return FALSE; } -void CCtrlClc::AddContact(HCONTACT hContact) +void CCtrlClc::AddContact(MCONTACT hContact) { SendMessage(m_hwnd, CLM_ADDCONTACT, (WPARAM)hContact, 0); } @@ -633,7 +633,7 @@ void CCtrlClc::Expand(HANDLE hItem, DWORD flags) { SendMessage(m_hwnd, CLM_EXPAND, (WPARAM)hItem, flags); } -HANDLE CCtrlClc::FindContact(HCONTACT hContact) +HANDLE CCtrlClc::FindContact(MCONTACT hContact) { return (HANDLE)SendMessage(m_hwnd, CLM_FINDCONTACT, (WPARAM)hContact, 0); } diff --git a/protocols/JabberG/src/ui_utils.h b/protocols/JabberG/src/ui_utils.h index 7e0b4792ad..2bc6b2d0e6 100644 --- a/protocols/JabberG/src/ui_utils.h +++ b/protocols/JabberG/src/ui_utils.h @@ -458,7 +458,7 @@ class CCtrlClc: public CCtrlBase public: CCtrlClc(CDlgBase* dlg, int ctrlId); - void AddContact(HCONTACT hContact); + void AddContact(MCONTACT hContact); void AddGroup(HANDLE hGroup); void AutoRebuild(); void DeleteItem(HANDLE hItem); @@ -466,7 +466,7 @@ public: void EndEditLabel(bool save); void EnsureVisible(HANDLE hItem, bool partialOk); void Expand(HANDLE hItem, DWORD flags); - HANDLE FindContact(HCONTACT hContact); + HANDLE FindContact(MCONTACT hContact); HANDLE FindGroup(HANDLE hGroup); COLORREF GetBkColor(); bool GetCheck(HANDLE hItem); diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 59063cbba3..c76e9cc70c 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -146,16 +146,16 @@ __forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringW &sVar) { buf.get ///////////////////////////////////////////////////////////////////////////// -bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); -bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); -bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); -bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); +bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); +bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); -bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value); -bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value); +bool DB_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value); +bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value); -bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetContactSettingBlob(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize); #include "MraConstans.h" #include "MraProto.h" @@ -227,16 +227,16 @@ CMStringW DecodeXML(const CMStringW &lptszMessage); CMStringW EncodeXML(const CMStringW &lptszMessage); bool IsHTTPSProxyUsed(HANDLE m_hNetlibUser); -bool IsContactMraProto(HCONTACT hContact); +bool IsContactMraProto(MCONTACT hContact); bool IsEMailMR(const CMStringA& szEmail); bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail); bool IsPhone(LPSTR lpszString, size_t dwStringSize); -bool IsContactPhone(HCONTACT hContact, LPSTR lpszPhone, size_t dwPhoneSize); +bool IsContactPhone(MCONTACT hContact, LPSTR lpszPhone, size_t dwPhoneSize); HANDLE MraHContactFromPhone(LPSTR lpszPhone, size_t dwPhoneSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded); void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled); bool MraRequestXStatusDetails(DWORD dwXStatus); -bool MraSendReplyBlogStatus(HCONTACT hContact); +bool MraSendReplyBlogStatus(MCONTACT hContact); DWORD GetYears(CONST PSYSTEMTIME pcstSystemTime); DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwFileNameLen, LPWSTR lpszRetFilePathName, DWORD dwRetFilePathLen, DWORD *pdwRetFilePathLen); DWORD MemFillRandom(LPVOID lpBuff, size_t dwBuffSize); diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 9ae3ee41dc..da45ef5852 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -30,7 +30,7 @@ struct MRA_AVATARS_QUEUE_ITEM : public FIFO_MT_ITEM { DWORD dwAvatarsQueueID; DWORD dwFlags; - HCONTACT hContact; + MCONTACT hContact; }; #define FILETIME_SECOND ((DWORDLONG)10000000) @@ -137,7 +137,7 @@ void CMraProto::MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle) mir_free(pmraaqAvatarsQueue); } -DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID) +DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID) { if (!hAvatarsQueueHandle) return ERROR_INVALID_HANDLE; @@ -453,7 +453,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE m_hConnection, DWORD dwRequestType, LPCST return 0; } -bool CMraProto::MraAvatarsGetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) +bool CMraProto::MraAvatarsGetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) { if (lpszValueName && pstTime) { INTERNET_TIME itAvatarLastModifiedTimeLocal; @@ -468,7 +468,7 @@ bool CMraProto::MraAvatarsGetContactTime(HCONTACT hContact, LPSTR lpszValueName, } -void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) +void CMraProto::MraAvatarsSetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) { if (!lpszValueName) return; @@ -486,7 +486,7 @@ void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, delSetting(hContact, lpszValueName); } -DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res) +DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, MCONTACT hContact, DWORD dwFormat, CMStringW &res) { res.Empty(); if (hAvatarsQueueHandle == NULL) @@ -523,7 +523,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hCon return ERROR_INSUFFICIENT_BUFFER; } -DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath) +DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath) { DWORD dwRetCode = GAIR_NOAVATAR; @@ -570,7 +570,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFl return dwRetCode; } -DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwSourceID) +DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwSourceID) { DWORD dwRetCode = GAIR_NOAVATAR; @@ -662,7 +662,7 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara } -DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HCONTACT hContact) +DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, MCONTACT hContact) { if (hAvatarsQueueHandle == NULL) return ERROR_INVALID_HANDLE; diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 4c95f5ec38..209d14c71c 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -27,7 +27,7 @@ bool CMraProto::MraChatRegister() return TRUE; } -INT_PTR CMraProto::MraChatSessionNew(HCONTACT hContact) +INT_PTR CMraProto::MraChatSessionNew(MCONTACT hContact) { if (bChatExists) if (hContact) { @@ -63,7 +63,7 @@ INT_PTR CMraProto::MraChatSessionNew(HCONTACT hContact) return 1; } -void CMraProto::MraChatSessionDestroy(HCONTACT hContact) +void CMraProto::MraChatSessionDestroy(MCONTACT hContact) { if (!bChatExists || hContact == NULL) return; @@ -79,7 +79,7 @@ void CMraProto::MraChatSessionDestroy(HCONTACT hContact) CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce); } -INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime) { if (!bChatExists) return 1; @@ -111,7 +111,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, gce.ptszNick = wszNick; } else { - HCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL); + MCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL); wszUID = lpszUID; if (hContactSender) gce.ptszNick = GetContactNameW(hContactSender); @@ -122,7 +122,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce); } -INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionInvite(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (!hContactChatSession) return 1; @@ -132,7 +132,7 @@ INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMSt return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime); } -INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (!hContactChatSession) return 1; @@ -142,7 +142,7 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime); } -INT_PTR CMraProto::MraChatSessionJoinUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionJoinUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (hContactChatSession) return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], _T(""), 0, dwTime); @@ -150,7 +150,7 @@ INT_PTR CMraProto::MraChatSessionJoinUser(HCONTACT hContactChatSession, const CM return 1; } -INT_PTR CMraProto::MraChatSessionLeftUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionLeftUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (hContactChatSession) return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, NULL, 0, dwTime); @@ -158,7 +158,7 @@ INT_PTR CMraProto::MraChatSessionLeftUser(HCONTACT hContactChatSession, const CM return 1; } -INT_PTR CMraProto::MraChatSessionSetIviter(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) +INT_PTR CMraProto::MraChatSessionSetIviter(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) { if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty()) return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0); @@ -166,7 +166,7 @@ INT_PTR CMraProto::MraChatSessionSetIviter(HCONTACT hContactChatSession, const C return 1; } -INT_PTR CMraProto::MraChatSessionSetOwner(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) +INT_PTR CMraProto::MraChatSessionSetOwner(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) { if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty()) return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0); @@ -175,7 +175,7 @@ INT_PTR CMraProto::MraChatSessionSetOwner(HCONTACT hContactChatSession, const CM } -INT_PTR CMraProto::MraChatSessionMessageAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionMessageAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime) { if (hContactChatSession) return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, lpwszMessage, 0, dwTime); @@ -195,7 +195,7 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam) if (gch->ptszText && lstrlen(gch->ptszText)) { size_t dwMessageSize = lstrlenW(gch->ptszText); CMStringA szEmail = gch->pDest->ptszID; - HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); + MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND); DWORD dwFlags = 0; @@ -236,7 +236,7 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam) void CMraProto::MraChatSendPrivateMessage(LPSTR lpszEMail) { BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded); if (bAdded) db_set_b(hContact, "CList", "Hidden", 1); diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index 3f4ec7213f..418f5cf060 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -27,7 +27,7 @@ struct MRA_FILES_QUEUE_ITEM : public LIST_MT_ITEM CMraProto *ppro; DWORD dwIDRequest; DWORD dwFlags; - HCONTACT hContact; + MCONTACT hContact; DWORDLONG dwFilesCount; DWORDLONG dwFilesTotalSize; MRA_FILES_QUEUE_FILE *pmfqfFiles; @@ -622,7 +622,7 @@ void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, vo ///////////////////////////////////////////////////////////////////////////////////////// // Receive files -DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses) +DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses) { if (!hFilesQueueHandle || !dwIDRequest) return ERROR_INVALID_HANDLE; @@ -919,7 +919,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) ///////////////////////////////////////////////////////////////////////////////////////// // Send files -DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest) +DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest) { if (!hFilesQueueHandle) return ERROR_INVALID_HANDLE; diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 29da89b58f..94fe71dc8e 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -198,7 +198,7 @@ LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM l return DefWindowProc(hWndDlg, msg, wParam, lParam); } -void CMraProto::MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) +void CMraProto::MraPopupShowFromContactW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) { WCHAR szTitle[MAX_CONTACTNAME]; CMStringW szNick, szEmail; @@ -212,7 +212,7 @@ void CMraProto::MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage); } -void CMraProto::MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage) +void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage) { if (getByte("PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED)) if (GetBit(getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType)) diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index f6ea74dbff..0bb77b16bd 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -93,7 +93,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMraProto::OnGroupChanged); // âńĺő â offline // ňę unsaved values ńîőđŕí˙ţňń˙ čő íóćíî číčöčŕëčçčđîâŕňü - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0); // unsaved values @@ -126,13 +126,13 @@ int CMraProto::OnPreShutdown(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -HCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags) +MCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags) { if (!plpsEMail) return NULL; BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded); if (hContact == NULL) return NULL; @@ -153,7 +153,7 @@ HCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTST return hContact; } -HCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) +MCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) { if (psr->cbSize != sizeof(PROTOSEARCHRESULT)) return 0; @@ -161,7 +161,7 @@ HCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return AddToListByEmail(psr->email, psr->nick, psr->firstName, psr->lastName, flags); } -HCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); @@ -186,9 +186,9 @@ HCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) HANDLE CMraProto::ChangeInfo(int, void*) { return NULL; } int CMraProto::FileResume(HANDLE, int*, const TCHAR**) { return 1; } -int CMraProto::RecvAwayMsg(HCONTACT, int, PROTORECVEVENT*) { return 1; } -int CMraProto::RecvUrl(HCONTACT, PROTORECVEVENT*) { return 1; } -int CMraProto::SendUrl(HCONTACT, int, const char*) { return 1; } +int CMraProto::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*) { return 1; } +int CMraProto::RecvUrl(MCONTACT, PROTORECVEVENT*) { return 1; } +int CMraProto::SendUrl(MCONTACT, int, const char*) { return 1; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -234,20 +234,20 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason) return 0; } -int CMraProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int CMraProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { Proto_AuthRecv(m_szModuleName, pre); return 0; } -int CMraProto::AuthRequest(HCONTACT hContact, const TCHAR *lptszMessage) +int CMraProto::AuthRequest(MCONTACT hContact, const TCHAR *lptszMessage) { return 1; } ///////////////////////////////////////////////////////////////////////////////////////// -HANDLE CMraProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) +HANDLE CMraProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) { if (szPath != NULL) if ( MraFilesQueueAccept(hFilesQueueHandle, (DWORD)hTransfer, szPath, lstrlen(szPath)) == NO_ERROR) @@ -256,7 +256,7 @@ HANDLE CMraProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *sz return NULL; } -int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int CMraProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { if (hContact && hTransfer) { MraFilesQueueCancel(hFilesQueueHandle, (DWORD)hTransfer, TRUE); @@ -266,14 +266,14 @@ int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) return 1; } -int CMraProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR*) +int CMraProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*) { return FileCancel(hContact, hTransfer); } ///////////////////////////////////////////////////////////////////////////////////////// -DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR CMraProto::GetCaps(int type, MCONTACT hContact) { switch ( type ) { case PFLAGNUM_1: @@ -310,7 +310,7 @@ DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact) } } -int CMraProto::GetInfo(HCONTACT hContact, int infoType) +int CMraProto::GetInfo(MCONTACT hContact, int infoType) { return MraUpdateContactInfo(hContact) != 0; } @@ -347,7 +347,7 @@ HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) +int CMraProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = m_szModuleName; @@ -360,19 +360,19 @@ int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) return 0; } -int CMraProto::RecvFile(HCONTACT hContact, PROTORECVFILET *pre) +int CMraProto::RecvFile(MCONTACT hContact, PROTORECVFILET *pre) { return Proto_RecvFile(hContact, pre); } -int CMraProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int CMraProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { return Proto_RecvMessage(hContact, pre); } ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int CMraProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { INT_PTR iRet = 0; @@ -398,7 +398,7 @@ int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTAC return iRet; } -HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) +HANDLE CMraProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) { INT_PTR iRet = 0; @@ -410,7 +410,7 @@ HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR* return (HANDLE)iRet; } -int CMraProto::SendMsg(HCONTACT hContact, int flags, const char *lpszMessage) +int CMraProto::SendMsg(MCONTACT hContact, int flags, const char *lpszMessage) { if (!m_bLoggedIn) { ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline."); @@ -450,7 +450,7 @@ int CMraProto::SendMsg(HCONTACT hContact, int flags, const char *lpszMessage) ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::SetApparentMode(HCONTACT hContact, int mode) +int CMraProto::SetApparentMode(MCONTACT hContact, int mode) { if (!m_bLoggedIn || !hContact) return 1; @@ -509,7 +509,7 @@ int CMraProto::SetStatus(int iNewStatus) // âńĺő â offline, ňîëüęî ĺńëč ěű áűâŕëč ďîäęëţ÷ĺíű if (dwOldStatusMode > ID_STATUS_OFFLINE) - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0); Netlib_CloseHandle(m_hConnection); @@ -547,7 +547,7 @@ int CMraProto::SetStatus(int iNewStatus) return 0; } -HANDLE CMraProto::GetAwayMsg(HCONTACT hContact) +HANDLE CMraProto::GetAwayMsg(MCONTACT hContact) { if (!m_bLoggedIn || ! hContact) return 0; @@ -589,7 +589,7 @@ int CMraProto::SetAwayMsg(int m_iStatus, const TCHAR* msg) return 0; } -int CMraProto::UserIsTyping(HCONTACT hContact, int type) +int CMraProto::UserIsTyping(MCONTACT hContact, int type) { if (!m_bLoggedIn || !hContact || type == PROTOTYPE_SELFTYPING_OFF) return 1; diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 3ac3f5cfc9..9377aafc9b 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -38,23 +38,23 @@ struct CMraProto : public PROTO // PROTO_INTERFACE // ==================================================================================== - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDBEvent); virtual int __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const TCHAR* id); virtual HANDLE __cdecl SearchByEmail(const TCHAR* email); @@ -62,56 +62,56 @@ struct CMraProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode); - void MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage); - void MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage); + void MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage); + void MraPopupShowFromContactW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage); __forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) { MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); } - __forceinline bool mraGetStaticStringA(HCONTACT Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { + __forceinline bool mraGetStaticStringA(MCONTACT Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { return DB_GetStaticStringA(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); } - __forceinline bool mraGetStaticStringW(HCONTACT Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { + __forceinline bool mraGetStaticStringW(MCONTACT Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { return DB_GetStaticStringW(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); } - __forceinline bool mraGetStringA(HCONTACT Contact, const char *ValueName, CMStringA &Ret) { + __forceinline bool mraGetStringA(MCONTACT Contact, const char *ValueName, CMStringA &Ret) { return DB_GetStringA(Contact, m_szModuleName, ValueName, Ret); } - __forceinline bool mraGetStringW(HCONTACT Contact, const char *ValueName, CMStringW &Ret) { + __forceinline bool mraGetStringW(MCONTACT Contact, const char *ValueName, CMStringW &Ret) { return DB_GetStringW(Contact, m_szModuleName, ValueName, Ret); } - __forceinline bool mraSetStringA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) { + __forceinline bool mraSetStringA(MCONTACT Contact, const char *valueName, const CMStringA &parValue) { return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) { + __forceinline bool mraSetStringW(MCONTACT Contact, const char *valueName, const CMStringW &parValue) { return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringExA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) { + __forceinline bool mraSetStringExA(MCONTACT Contact, const char *valueName, const CMStringA &parValue) { return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringExW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) { + __forceinline bool mraSetStringExW(MCONTACT Contact, const char *valueName, const CMStringW &parValue) { return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraWriteContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) { + __forceinline bool mraWriteContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) { return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize) != 0; } - __forceinline bool mraGetContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { + __forceinline bool mraGetContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); } // ====| Services |==================================================================== @@ -196,56 +196,56 @@ struct CMraProto : public PROTO CRITICAL_SECTION csCriticalSectionSend; - HCONTACT AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags); + MCONTACT AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags); - DWORD MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize); + DWORD MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize); DWORD MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF); DWORD MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID); - DWORD MraAddContact(HCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0); - DWORD MraModifyContact(HCONTACT hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0); + DWORD MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0); + DWORD MraModifyContact(MCONTACT hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0); DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL); - DWORD MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszGroup); + DWORD MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszGroup); DWORD MraAuthorize(const CMStringA &szEmail); DWORD MraChangeStatus(DWORD dwStatus, const CMStringA &szStatusUri, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc, DWORD dwFutureFlags); DWORD MraFileTransfer(const CMStringA &szEmail, DWORD dwIdRequest, DWORD dwFilesTotalSize, const CMStringW &lpwszFiles, const CMStringA &szAddresses); DWORD MraFileTransferAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIdRequest, LPBYTE lpbDescription, size_t dwDescriptionSize); - HANDLE MraWPRequestW(HCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline); - HANDLE MraWPRequestByEMail(HCONTACT hContact, DWORD dwAckType, CMStringA &szEmail); + HANDLE MraWPRequestW(MCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline); + HANDLE MraWPRequestByEMail(MCONTACT hContact, DWORD dwAckType, CMStringA &szEmail); DWORD MraGame(const CMStringA &szEmail, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, const CMStringA &lpszData); DWORD MraLogin2W(CMStringA &szLogin, CMStringA &szPassword, DWORD dwStatus, CMStringA &szStatusUri, CMStringW &wszStatusTitle, CMStringW &wszStatusDesc, DWORD dwFutureFlags, CMStringA &szUserAgentFormatted, CMStringA &szUserAgent); - DWORD MraSMSW(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage); + DWORD MraSMSW(MCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage); DWORD MraProxy(const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID); DWORD MraProxyAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID); DWORD MraChangeUserBlogStatus(DWORD dwFlags, const CMStringW &wszText, DWORDLONG dwBlogStatusID); DWORD MraSendPacket(HANDLE m_hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize); DWORD MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize); - DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize); + DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize); DWORD MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc); - void MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList); + void MraAddrListStoreToContact(MCONTACT hContact, MRA_ADDR_LIST *pmalAddrList); - DWORD GetContactFlags(HCONTACT hContact); - DWORD SetContactFlags(HCONTACT hContact, DWORD dwContactFlag); - DWORD GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones); - DWORD SetContactBasicInfoW(HCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones); + DWORD GetContactFlags(MCONTACT hContact); + DWORD SetContactFlags(MCONTACT hContact, DWORD dwContactFlag); + DWORD GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones); + DWORD SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones); - DWORD GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly); - bool GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff); + DWORD GetContactEMailCount(MCONTACT hContact, BOOL bMRAOnly); + bool GetContactFirstEMail(MCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff); - bool IsContactMra(HCONTACT hContact); + bool IsContactMra(MCONTACT hContact); bool IsEMailMy(const CMStringA &szEmail); bool IsEMailChatAgent(const CMStringA &szEmail); - bool IsContactChatAgent(HCONTACT hContact); + bool IsContactChatAgent(MCONTACT hContact); - HCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded); - bool MraUpdateContactInfo(HCONTACT hContact); + MCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded); + bool MraUpdateContactInfo(MCONTACT hContact); DWORD MraSetXStatusInternal(DWORD dwXStatus); - DWORD MraGetContactStatus(HCONTACT hContact); - DWORD MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus); - DWORD MraContactCapabilitiesGet(HCONTACT hContact); - void MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags); + DWORD MraGetContactStatus(MCONTACT hContact); + DWORD MraSetContactStatus(MCONTACT hContact, DWORD dwNewStatus); + DWORD MraContactCapabilitiesGet(MCONTACT hContact); + void MraContactCapabilitiesSet(MCONTACT hContact, DWORD dwFutureFlags); void MraUpdateEmailStatus(const CMStringA &szFrom, const CMStringA &szSubject, DWORD dwDate, DWORD dwUIDL); DWORD MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMessageRTF); @@ -278,19 +278,19 @@ struct CMraProto : public PROTO DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &plpsFrom, CMStringA &plpsText, CMStringA &plpsRFTText, CMStringA &plpsMultiChatData); - void SetExtraIcons(HCONTACT hContact); + void SetExtraIcons(MCONTACT hContact); void InitMenus(void); HGENMENU CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult); - DWORD ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam); - CMStringA CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason); + DWORD ProtoBroadcastAckAsync(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam); + CMStringA CreateBlobFromContact(MCONTACT hContact, const CMStringW &wszRequestReason); bool GetPassDB(CMStringA& pass); bool MraRequestXStatusDetails(DWORD dwXStatus); - bool MraSendReplyBlogStatus(HCONTACT hContact); - DWORD MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType); + bool MraSendReplyBlogStatus(MCONTACT hContact); + DWORD MraSelectEMailDlgShow(MCONTACT hContact, DWORD dwType); DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection); @@ -300,8 +300,8 @@ struct CMraProto : public PROTO void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue); size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort); - DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses); - DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest); + DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses); + DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest); DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline); DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest); DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, const CMStringA &szAddresses); @@ -316,30 +316,30 @@ struct CMraProto : public PROTO bool bChatExists; void MraChatDllError(); bool MraChatRegister(); - INT_PTR MraChatSessionNew(HCONTACT hContactChatSession); - void MraChatSessionDestroy(HCONTACT hContactChatSession); + INT_PTR MraChatSessionNew(MCONTACT hContactChatSession); + void MraChatSessionDestroy(MCONTACT hContactChatSession); void MraChatSendPrivateMessage(LPSTR lpwszEMail); - INT_PTR MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime); - INT_PTR MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); - INT_PTR MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); - INT_PTR MraChatSessionJoinUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); - INT_PTR MraChatSessionLeftUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); - INT_PTR MraChatSessionSetIviter(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); - INT_PTR MraChatSessionSetOwner(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); - INT_PTR MraChatSessionMessageAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &wszMessage, DWORD dwTime); + INT_PTR MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime); + INT_PTR MraChatSessionInvite(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionJoinUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionLeftUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionSetIviter(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); + INT_PTR MraChatSessionSetOwner(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); + INT_PTR MraChatSessionMessageAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &wszMessage, DWORD dwTime); DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle); void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle); void MraAvatarsQueueSuspend(HANDLE hAvatarsQueueHandle); void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle); - DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID); - bool MraAvatarsGetContactTime (HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); - void MraAvatarsSetContactTime (HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); - DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res); - DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath); - DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwSourceID); - DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HCONTACT hContact); + DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID); + bool MraAvatarsGetContactTime (MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); + void MraAvatarsSetContactTime (MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); + DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, MCONTACT hContact, DWORD dwFormat, CMStringW &res); + DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath); + DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwSourceID); + DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, MCONTACT hContact); void __cdecl MraAvatarsThreadProc(LPVOID lpParameter); }; diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index fc889d5058..bfe205f2e0 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -4,11 +4,11 @@ struct MraSelectEMailDlgData { CMraProto *ppro; - HCONTACT hContact; + MCONTACT hContact; DWORD dwType; }; -void AddContactEMailToListParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList) +void AddContactEMailToListParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList) { CMStringA szEmail; if (DB_GetStringA(hContact, lpszModule, lpszValueName, szEmail)) { @@ -139,7 +139,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam return FALSE; } -DWORD CMraProto::MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType) +DWORD CMraProto::MraSelectEMailDlgShow(MCONTACT hContact, DWORD dwType) { MraSelectEMailDlgData *dat = (MraSelectEMailDlgData*)mir_calloc(sizeof(MraSelectEMailDlgData)); if (dat) { diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index e673e2e4b8..27bd038607 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -71,7 +71,7 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// -DWORD CMraProto::MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize) +DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize) { debugLogA("Sending message: flags %08x, to '%S', message '%S'\n", dwFlags, szEmail, lpwszMessage); @@ -184,7 +184,7 @@ DWORD CMraProto::MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID) } // Adds new contact -DWORD CMraProto::MraAddContact(HCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage) +DWORD CMraProto::MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage) { if (szEmail.GetLength() <= 4 && !(dwContactFlag & CONTACT_FLAG_GROUP)) return 0; @@ -213,7 +213,7 @@ DWORD CMraProto::MraAddContact(HCONTACT hContact, DWORD dwContactFlag, DWORD dwG } // change contact -DWORD CMraProto::MraModifyContact(HCONTACT hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones) +DWORD CMraProto::MraModifyContact(MCONTACT hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones) { CMStringA szEmail, szPhones; CMStringW wszNick, wszCustomName; @@ -312,7 +312,7 @@ DWORD CMraProto::MraFileTransferAck(DWORD dwStatus, const CMStringA &szEmail, DW } // Ďîčńę ęîíňŕęňŕ -HANDLE CMraProto::MraWPRequestW(HCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline) +HANDLE CMraProto::MraWPRequestW(MCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline) { OutBuffer buf; CMStringA tmp; @@ -381,7 +381,7 @@ HANDLE CMraProto::MraWPRequestW(HCONTACT hContact, DWORD dwAckType, DWORD dwRequ } // Ďîčńę ęîíňŕęňŕ ďî EMail -HANDLE CMraProto::MraWPRequestByEMail(HCONTACT hContact, DWORD dwAckType, CMStringA &szEmail) +HANDLE CMraProto::MraWPRequestByEMail(MCONTACT hContact, DWORD dwAckType, CMStringA &szEmail) { if (szEmail.GetLength() <= 4) return 0; @@ -439,7 +439,7 @@ DWORD CMraProto::MraLogin2W(CMStringA &szLogin, CMStringA &szPassword, DWORD dwS } // Îňďđŕâęŕ SMS -DWORD CMraProto::MraSMSW(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage) +DWORD CMraProto::MraSMSW(MCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage) { CMStringA szPhoneLocal = "+" + CopyNumber(lpszPhone); @@ -523,7 +523,7 @@ DWORD CMraProto::MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize) } -DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize) +DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize) { DWORD dwRet = InterlockedIncrement((LONG volatile*)&dwCMDNum); if ( !MraSendQueueAdd(hSendQueueHandle, dwRet, dwFlags, hContact, dwAckType, lpbDataQueue, dwDataQueueSize)) { diff --git a/protocols/MRA/src/MraSendQueue.cpp b/protocols/MRA/src/MraSendQueue.cpp index 08146fe8b2..41a90c55bc 100644 --- a/protocols/MRA/src/MraSendQueue.cpp +++ b/protocols/MRA/src/MraSendQueue.cpp @@ -14,7 +14,7 @@ struct MRA_SEND_QUEUE_ITEM : public LIST_MT_ITEM // external DWORD dwCMDNum; DWORD dwFlags; - HCONTACT hContact; + MCONTACT hContact; DWORD dwAckType; LPBYTE lpbData; size_t dwDataSize; @@ -59,7 +59,7 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle) } -DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize) +DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize) { if (!hSendQueueHandle || !dwCMDNum) return ERROR_INVALID_HANDLE; @@ -108,7 +108,7 @@ DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum) return ERROR_NOT_FOUND; } -DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) +DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, MCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) { if (!hSendQueueHandle) return ERROR_INVALID_HANDLE; @@ -135,7 +135,7 @@ DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, return ERROR_NOT_FOUND; } -DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) +DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, MCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) { if (!hSendQueueHandle) return ERROR_INVALID_HANDLE; diff --git a/protocols/MRA/src/MraSendQueue.h b/protocols/MRA/src/MraSendQueue.h index e75038cfd9..cb3a62b4e3 100644 --- a/protocols/MRA/src/MraSendQueue.h +++ b/protocols/MRA/src/MraSendQueue.h @@ -7,10 +7,10 @@ DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phSendQueueHandle); void MraSendQueueDestroy(HANDLE hSendQueueHandle); -DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize); +DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize); DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum); -DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize); -DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize); +DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, MCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize); +DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, MCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize); #endif // !defined(AFX_MRA_SENDQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 5864886814..7d52e201ac 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -13,7 +13,7 @@ struct SetXStatusData struct SetBlogStatusData { CMraProto *ppro; - HCONTACT hContact; + MCONTACT hContact; }; #define RECURSION_DATA_STACK_ITEMS_MIN 128 @@ -157,7 +157,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList) return res; } -void CMraProto::MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList) +void CMraProto::MraAddrListStoreToContact(MCONTACT hContact, MRA_ADDR_LIST *pmalAddrList) { if (!hContact || !pmalAddrList) return; @@ -181,7 +181,7 @@ void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList) } } -bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { bool bRet = false; size_t dwReadedStringLen, dwRetBuffSizeLocal; @@ -209,7 +209,7 @@ bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN } // sizes in wchars -bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { bool bRet = false; size_t dwReadedStringLen; @@ -235,7 +235,7 @@ bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN return bRet; } -bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res) +bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res) { char *szRes = db_get_sa(hContact, lpszModule, lpszValueName); if (szRes) { @@ -249,7 +249,7 @@ bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, C } -bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res) +bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res) { WCHAR *szRes = db_get_wsa(hContact, lpszModule, lpszValueName); if (szRes) { @@ -262,7 +262,7 @@ bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, C return false; } -bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue) +bool DB_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue) { if (szValue.IsEmpty()) { db_unset(hContact, lpszModule, lpszValueName); @@ -272,7 +272,7 @@ bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, return db_set_s(hContact, lpszModule, lpszValueName, szValue) != 0; } -bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue) +bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue) { if (szValue.IsEmpty()) { db_unset(hContact, lpszModule, lpszValueName); @@ -282,7 +282,7 @@ bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, return db_set_ws(hContact, lpszModule, lpszValueName, szValue) != 0; } -bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetContactSettingBlob(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { bool bRet = false; DBVARIANT dbv; @@ -303,7 +303,7 @@ bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszV return bRet; } -DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName) +DWORD CMraProto::MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName) { MraGroupItem *p = NULL; @@ -335,7 +335,7 @@ DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTS return p->m_id; } -DWORD CMraProto::GetContactFlags(HCONTACT hContact) +DWORD CMraProto::GetContactFlags(MCONTACT hContact) { DWORD dwRet = 0; @@ -366,7 +366,7 @@ DWORD CMraProto::GetContactFlags(HCONTACT hContact) return(dwRet); } -DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag) +DWORD CMraProto::SetContactFlags(MCONTACT hContact, DWORD dwContactFlag) { if (!IsContactMra(hContact)) return ERROR_INVALID_HANDLE; @@ -398,7 +398,7 @@ DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag) return 0; } -DWORD CMraProto::GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones) +DWORD CMraProto::GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones) { if (!IsContactMra(hContact)) return ERROR_INVALID_HANDLE; @@ -434,7 +434,7 @@ DWORD CMraProto::GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pd return 0; } -DWORD CMraProto::SetContactBasicInfoW(HCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones) +DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones) { if (!IsContactMra(hContact)) return ERROR_INVALID_HANDLE; @@ -496,12 +496,12 @@ DWORD CMraProto::SetContactBasicInfoW(HCONTACT hContact, DWORD dwSetInfoFlags, D return 0; } -HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded) +MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded) { if (szEmail.IsEmpty()) return NULL; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; bool bFound = false; //check not already on list @@ -541,7 +541,7 @@ HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe } } else { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); } @@ -563,7 +563,7 @@ HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe return hContact; } -bool CMraProto::MraUpdateContactInfo(HCONTACT hContact) +bool CMraProto::MraUpdateContactInfo(MCONTACT hContact) { if (m_bLoggedIn && hContact) if (IsContactMra(hContact)) { @@ -577,22 +577,22 @@ bool CMraProto::MraUpdateContactInfo(HCONTACT hContact) return false; } -DWORD CMraProto::MraContactCapabilitiesGet(HCONTACT hContact) +DWORD CMraProto::MraContactCapabilitiesGet(MCONTACT hContact) { return getDword(hContact, DBSETTING_CAPABILITIES, 0); } -void CMraProto::MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags) +void CMraProto::MraContactCapabilitiesSet(MCONTACT hContact, DWORD dwFutureFlags) { setDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags); } -DWORD CMraProto::MraGetContactStatus(HCONTACT hContact) +DWORD CMraProto::MraGetContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -DWORD CMraProto::MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus) +DWORD CMraProto::MraSetContactStatus(MCONTACT hContact, DWORD dwNewStatus) { DWORD dwOldStatus = MraGetContactStatus(hContact); @@ -641,7 +641,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (m_dwEmailMessagesUnread) { CMStringA szEmail; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; TCHAR szMailBoxStatus[MAX_SECONDLINE]; mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal); @@ -709,13 +709,13 @@ bool IsHTTPSProxyUsed(HANDLE m_hNetlibUser) } // îďđĺäĺë˙ĺň ďđčíŕäëĺćíîńňü ęîíňŕęňŕ äŕííîé ęîďčč ďëŕăčíŕ -bool CMraProto::IsContactMra(HCONTACT hContact) +bool CMraProto::IsContactMra(MCONTACT hContact) { return CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0; } // îďđĺäĺë˙ĺňń˙ ˙âë˙ĺňń˙ ëč ęîíňŕęň ęîíňŕęňîě MRA ďđîňîęîëŕ, íĺ çŕâčńčěî îň ňîăî ęŕęîěó ďëŕăčíó îí ďđčíŕäëĺćčň -bool IsContactMraProto(HCONTACT hContact) +bool IsContactMraProto(MCONTACT hContact) { LPSTR lpszProto = GetContactProto(hContact); if (lpszProto) { @@ -751,7 +751,7 @@ bool CMraProto::IsEMailChatAgent(const CMStringA &szEmail) return false; } -bool CMraProto::IsContactChatAgent(HCONTACT hContact) +bool CMraProto::IsContactChatAgent(MCONTACT hContact) { if (hContact == NULL) return false; @@ -791,7 +791,7 @@ bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail) return false; } -DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName) +DWORD GetContactEMailCountParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName) { DWORD dwRet = 0; CMStringA szEmail; @@ -815,7 +815,7 @@ DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu return dwRet; } -DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly) +DWORD CMraProto::GetContactEMailCount(MCONTACT hContact, BOOL bMRAOnly) { LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName; @@ -828,7 +828,7 @@ DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly) return dwRet; } -bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res) +bool GetContactFirstEMailParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res) { CMStringA szEmail; @@ -853,7 +853,7 @@ bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModul return false; } -bool CMraProto::GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &res) +bool CMraProto::GetContactFirstEMail(MCONTACT hContact, BOOL bMRAOnly, CMStringA &res) { LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName; @@ -891,7 +891,7 @@ static void FakeThread(void* param) mir_free(param); } -DWORD CMraProto::ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) +DWORD CMraProto::ProtoBroadcastAckAsync(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) { ACKDATA *ack = (ACKDATA*)::mir_calloc(sizeof(ACKDATA)); ack->cbSize = sizeof(ACKDATA); @@ -905,7 +905,7 @@ DWORD CMraProto::ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult return 0; } -CMStringA CMraProto::CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason) +CMStringA CMraProto::CreateBlobFromContact(MCONTACT hContact, const CMStringW &wszRequestReason) { CMStringA res('\0', 8), tmp; DWORD *p = (DWORD*)res.c_str(); @@ -1206,7 +1206,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w return iRet; } -bool CMraProto::MraSendReplyBlogStatus(HCONTACT hContact) +bool CMraProto::MraSendReplyBlogStatus(MCONTACT hContact) { SetBlogStatusData* dat = (SetBlogStatusData*)mir_calloc(sizeof(SetBlogStatusData)); dat->ppro = this; diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index ba91e2e660..d6584728d4 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -43,7 +43,7 @@ INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam) { if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { CMStringA szEmail; if (mraGetStringA(hContact, "e-mail", szEmail)) MraWPRequestByEMail(hContact, ACKTYPE_GETINFO, szEmail); @@ -55,7 +55,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam) { if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { CMStringA szEmail; if (mraGetStringA(hContact, "e-mail", szEmail)) if (!IsEMailChatAgent(szEmail)) @@ -68,7 +68,7 @@ INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam) { if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DWORD dwContactSeverFlags; if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL) == NO_ERROR) if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1) @@ -80,7 +80,7 @@ INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return 0; @@ -110,7 +110,7 @@ INT_PTR CMraProto::MraGrantAuthorization(WPARAM wParam, LPARAM lParam) // send without reason, do we need any ? CMStringA szEmail; - if (mraGetStringA((HCONTACT)wParam, "e-mail", szEmail)) + if (mraGetStringA((MCONTACT)wParam, "e-mail", szEmail)) MraAuthorize(szEmail); return 0; @@ -121,17 +121,17 @@ INT_PTR CMraProto::MraSendPostcard(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailCount = GetContactEMailCount((HCONTACT)wParam, FALSE); + DWORD dwContactEMailCount = GetContactEMailCount((MCONTACT)wParam, FALSE); if (dwContactEMailCount) { if (dwContactEMailCount == 1) { CMStringA szUrl, szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, FALSE, szEmail)) { + if (GetContactFirstEMail((MCONTACT)wParam, FALSE, szEmail)) { szEmail.MakeLower(); szUrl.Format("http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s", GetContactNameA((HANDLE)wParam), szEmail); MraMPopSessionQueueAddUrl(hMPopSessionQueue, szUrl); } } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD); } return 0; } @@ -141,14 +141,14 @@ INT_PTR CMraProto::MraViewAlbum(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_FOTO_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM); } return 0; } @@ -158,14 +158,14 @@ INT_PTR CMraProto::MraReadBlog(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG); return 0; } @@ -176,9 +176,9 @@ INT_PTR CMraProto::MraReplyBlogStatus(WPARAM wParam, LPARAM lParam) return 0; CMStringW blogStatusMsg; - mraGetStringW((HCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg); + mraGetStringW((MCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg); if (!blogStatusMsg.IsEmpty() || wParam == 0) - MraSendReplyBlogStatus((HCONTACT)wParam); + MraSendReplyBlogStatus((MCONTACT)wParam); return 0; } @@ -188,14 +188,14 @@ INT_PTR CMraProto::MraViewVideo(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_VIDEO_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO); } return 0; } @@ -205,14 +205,14 @@ INT_PTR CMraProto::MraAnswers(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_ANSWERS_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS); } return 0; } @@ -222,14 +222,14 @@ INT_PTR CMraProto::MraWorld(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_WORLD_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_WORLD); + else MraSelectEMailDlgShow((MCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_WORLD); } return 0; } @@ -241,7 +241,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM wParam, LPARAM lParam) BOOL bIsContactMRA, bHasEMail, bHasEMailMR, bChatAgent; DWORD dwContactSeverFlags = 0; CMStringW blogStatusMsgSize; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // proto own contact bIsContactMRA = IsContactMra(hContact); diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 73270f7d9e..eb968f9d10 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -233,7 +233,7 @@ DWORD CMraProto::MraNetworkDispatcher() } { DWORD dwCMDNum, dwFlags, dwAckType; - HCONTACT hContact; + MCONTACT hContact; LPBYTE lpbData; size_t dwDataSize; while (!MraSendQueueFindOlderThan(hSendQueueHandle, SEND_QUEUE_TIMEOUT, &dwCMDNum, &dwFlags, &hContact, &dwAckType, &lpbData, &dwDataSize)) { @@ -430,7 +430,7 @@ bool CMraProto::CmdMessageAck(BinBuffer &buf) bool CMraProto::CmdMessageStatus(ULONG seq, BinBuffer &buf) { DWORD dwAckType, dwTemp = buf.getDword(); - HCONTACT hContact; + MCONTACT hContact; if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, NULL, NULL)) { switch (dwTemp) { case MESSAGE_DELIVERED:// Message delivered directly to user @@ -554,7 +554,7 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf) buf >> szEmail; BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); if (bAdded) MraUpdateContactInfo(hContact); @@ -613,7 +613,7 @@ bool CMraProto::CmdFileTransfer(BinBuffer &buf) } BOOL bAdded = FALSE; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); if (bAdded) MraUpdateContactInfo(hContact); @@ -667,7 +667,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf) buf >> dwStatus >> szSpecStatusUri >> szStatusTitle >> szStatusDesc >> szEmail >> dwFutureFlags >> szUserAgentFormatted; BOOL bAdded; - if (HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) { + if (MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) { if (bAdded) MraUpdateContactInfo(hContact); @@ -705,7 +705,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf) bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) { - DWORD dwAckType; HCONTACT hContact; LPBYTE pData; size_t dataLen; + DWORD dwAckType; MCONTACT hContact; LPBYTE pData; size_t dataLen; if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, &pData, &dataLen)) { DWORD dwTemp = buf.getDword(); switch (dwTemp) { @@ -753,7 +753,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) { - DWORD dwAckType, dwFlags; HCONTACT hContact; LPBYTE pData; size_t dataLen; + DWORD dwAckType, dwFlags; MCONTACT hContact; LPBYTE pData; size_t dataLen; if (MraSendQueueFind(hSendQueueHandle, seq, &dwFlags, &hContact, &dwAckType, &pData, &dataLen)) { MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_ANKETA_INFO: not found in queue")); return true; @@ -1002,7 +1002,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) bool CMraProto::CmdGame(BinBuffer &buf) { - HCONTACT hContact; + MCONTACT hContact; CMStringA szEmail, szData; DWORD dwGameSessionID, dwGameMsg, dwGameMsgID, dwTemp; buf >> szEmail >> dwGameSessionID >> dwGameMsg >> dwGameMsgID >> dwTemp >> szData; @@ -1241,7 +1241,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) if (dwControlParam > 5)// âńĺ ďŕđŕěĺňđű ďđŕâčëüíî číčöčŕëčçčđîâŕííű! if ((dwContactFlag & (CONTACT_FLAG_GROUP | CONTACT_FLAG_REMOVED)) == 0) { BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded); if (hContact) { // already in list, remove the duplicate if (GetContactBasicInfoW(hContact, &dwTemp, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == NO_ERROR && dwTemp != -1) { @@ -1309,7 +1309,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) if (mraGetStringW(NULL, "AuthMessage", wszAuthMessage) == FALSE) // def auth message wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, &szEmail, NULL, NULL) == NO_ERROR) if (dwID == -1) { if (IsEMailChatAgent(szEmail)) {// ÷ŕň: ĺů¸ đŕç çŕďđîńčě ŕâňîđčçŕöčţ, ďîěĺňčě ęŕę âčäčěűé â ńďčńęĺ, ďîńňî˙ííűé @@ -1338,7 +1338,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) } else { // ęîíňŕęň ëčńň ďî÷ĺěóňî íĺ ďîëó÷čëč // âńĺő â offline č id â íĺńňŕíäŕđň - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -2, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0); // request user info from server @@ -1442,7 +1442,7 @@ bool CMraProto::CmdBlogStatus(BinBuffer &buf) buf >> dwFlags >> szEmail >> dwBlogStatusID >> dwTime >> wszText >> szString; - if (HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) { + if (MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) { if (dwFlags & MRIM_BLOG_STATUS_MUSIC) mraSetStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, wszText); else { @@ -1459,7 +1459,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader) WCHAR szBuff[4096] = { 0 }; DWORD dwTemp, dwAckType; size_t dwSize; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; LPBYTE pByte; debugLogA("Received packet %x\n", pmaHeader->msg); @@ -1674,7 +1674,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & } else { BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded); if (bAdded) MraUpdateContactInfo(hContact); diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 16efbc3467..bbc74e26cb 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -119,7 +119,7 @@ const LPWSTR lpcszXStatusNameDef[] = ////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CMraProto::SetExtraIcons(HCONTACT hContact) +void CMraProto::SetExtraIcons(MCONTACT hContact) { DWORD dwID, dwGroupID, dwContactSeverFlags; if (GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL)) @@ -168,7 +168,7 @@ INT_PTR CMraProto::MraXStatusMenu(WPARAM wParam, LPARAM lParam, LPARAM param) int CMraProto::MraContactDeleted(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bLoggedIn || !hContact) return 0; @@ -191,7 +191,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn || !lParam) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) return 0; @@ -298,7 +298,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) int CMraProto::MraExtraIconsApply(WPARAM wParam, LPARAM lParam) { - SetExtraIcons((HCONTACT)wParam); + SetExtraIcons((MCONTACT)wParam); return 0; } @@ -449,7 +449,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam; if (pData->cbSize < sizeof(CUSTOM_STATUS)) @@ -552,7 +552,7 @@ INT_PTR CMraProto::MraSendNudge(WPARAM wParam, LPARAM lParam) { if (m_bLoggedIn && wParam) { LPWSTR lpwszAlarmMessage = TranslateW(MRA_ALARM_MESSAGE); - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CMStringA szEmail; if (mraGetStringA(hContact, "e-mail", szEmail)) @@ -619,7 +619,7 @@ INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam) int CMraProto::OnGroupChanged(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) { CLISTGROUPCHANGE *cgc = (CLISTGROUPCHANGE*)lParam; if (cgc->pszOldName == NULL) diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp index ae8ca277cb..6f6f86998a 100644 --- a/protocols/MSN/src/msn_avatar.cpp +++ b/protocols/MSN/src/msn_avatar.cpp @@ -34,7 +34,7 @@ void CMsnProto::AvatarQueue_Uninit() ::CloseHandle(hevAvatarQueue); } -void CMsnProto::pushAvatarRequest(HCONTACT hContact, LPCSTR pszUrl) +void CMsnProto::pushAvatarRequest(MCONTACT hContact, LPCSTR pszUrl) { ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0); diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 76688d5235..1ffd87f65d 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -25,13 +25,13 @@ along with this program. If not, see . #include "msn_proto.h" #include -HCONTACT CMsnProto::MSN_GetChatInernalHandle(HCONTACT hContact) +MCONTACT CMsnProto::MSN_GetChatInernalHandle(MCONTACT hContact) { - HCONTACT result = hContact; + MCONTACT result = hContact; if ( isChatRoom(hContact)) { DBVARIANT dbv; if (getString(hContact, "ChatRoomID", &dbv) == 0) { - result = (HCONTACT)(-atol(dbv.pszVal)); + result = (MCONTACT)(-atol(dbv.pszVal)); db_free(&dbv); } } @@ -98,7 +98,7 @@ void CMsnProto::MSN_ChatStart(ThreadData* info) for (int j=0; j < info->mJoinedContactsWLID.getCount(); j++) { - HCONTACT hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]); + MCONTACT hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]); TCHAR *wlid = mir_a2t(info->mJoinedContactsWLID[j]); gce.ptszNick = GetContactNameT(hContact); @@ -169,23 +169,23 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto } -static void ChatValidateContact(HCONTACT hItem, HWND hwndList, CMsnProto* ppro) +static void ChatValidateContact(MCONTACT hItem, HWND hwndList, CMsnProto* ppro) { if (!ppro->MSN_IsMyContact(hItem) || ppro->isChatRoom(hItem) || ppro->MSN_IsMeByContact(hItem)) SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); } -static void ChatPrepare(HCONTACT hItem, HWND hwndList, CMsnProto* ppro) +static void ChatPrepare(MCONTACT hItem, HWND hwndList, CMsnProto* ppro) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) ChatPrepare(hItemT, hwndList, ppro); } @@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l { case CLN_NEWCONTACT: if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - ChatValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); + ChatValidateContact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); break; case CLN_LISTREBUILT: @@ -361,7 +361,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case GC_USER_PRIVMESS: { char *email = mir_t2a(gch->ptszUID); - HCONTACT hContact = MSN_HContactFromEmail(email); + MCONTACT hContact = MSN_HContactFromEmail(email); CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); mir_free(email); break; @@ -384,7 +384,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case GC_USER_NICKLISTMENU: { char *email = mir_t2a(gch->ptszUID); - HCONTACT hContact = MSN_HContactFromEmail(email); + MCONTACT hContact = MSN_HContactFromEmail(email); mir_free(email); switch(gch->dwData) diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 56dc3e9807..c8b7e9029c 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -46,7 +46,7 @@ void MSN_ConnectionProc(HANDLE hNewConnection, DWORD /* dwRemoteIP */, void* ext } } -void CMsnProto::sttSetMirVer(HCONTACT hContact, DWORD dwValue, bool always) +void CMsnProto::sttSetMirVer(MCONTACT hContact, DWORD dwValue, bool always) { static const char* MirVerStr[] = { @@ -253,7 +253,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c void CMsnProto::sttCustomSmiley(const char* msgBody, char* email, char* nick, int iSmileyType) { - HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); + MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); char smileyList[500] = ""; @@ -389,7 +389,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para tFileInfo.readFromBuffer(msgBody); info->firstMsgRecv = true; - HCONTACT hContact = MSN_HContactFromEmail(email); + MCONTACT hContact = MSN_HContactFromEmail(email); const char* mirver = tFileInfo["Client-Name"]; if (hContact != NULL && mirver != NULL) { setString(hContact, "MirVer", mirver); @@ -404,7 +404,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para } if (!_strnicmp(tContentType, "text/plain", 10)) { - HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); + MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); const char* p = tHeader["X-MMS-IM-Format"]; bool isRtl = p != NULL && strstr(p, "RL=1") != NULL; @@ -490,13 +490,13 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para const char* tTypingUser = tHeader["TypingUser"]; if (tTypingUser != NULL && info->mChatID[0] == 0 && _stricmp(email, MyOptions.szEmail)) { - HCONTACT hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser); + MCONTACT hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser); CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, 7); } } else if (!_strnicmp(tContentType, "text/x-msnmsgr-datacast", 23)) { if (info->mJoinedContactsWLID.getCount()) { - HCONTACT tContact; + MCONTACT tContact; if (info->mChatID[0]) { GC_INFO gci = { 0 }; @@ -602,7 +602,7 @@ void CMsnProto::sttProcessYFind(char* buf, size_t len) else { if (szNetId != NULL) { int netId = atol(szNetId); - HCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false); + MCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false); if (MSN_AddUser(hContact, szEmail, netId, LIST_FL)) { MSN_AddUser(hContact, szEmail, netId, LIST_PL + LIST_REMOVE); MSN_AddUser(hContact, szEmail, netId, LIST_BL + LIST_REMOVE); @@ -640,7 +640,7 @@ void CMsnProto::sttProcessAdd(char* buf, size_t len) UrlDecode((char*)szNick); if (listId == LIST_FL) { - HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick, true, false); + MCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick, true, false); MSN_SetContactDb(hContact, szEmail); } @@ -706,7 +706,7 @@ void CMsnProto::sttProcessRemove(char* buf, size_t len) void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wlid) { - HCONTACT hContact = MSN_HContactFromEmail(wlid); + MCONTACT hContact = MSN_HContactFromEmail(wlid); if (hContact == NULL) return; ezxml_t xmli = ezxml_parse_str(buf, len); @@ -1048,12 +1048,12 @@ LBL_InvalidCommand: if (strchr(data.userEmail, ';')) { if (info->mJoinedContactsWLID.getCount() == 1) - p2p_clearThreadSessions((HCONTACT)info->mJoinedContactsWLID[0], info->mType); + p2p_clearThreadSessions((MCONTACT)info->mJoinedContactsWLID[0], info->mType); info->contactLeft(data.userEmail); break; } - HCONTACT hContact = MSN_HContactFromEmail(data.userEmail); + MCONTACT hContact = MSN_HContactFromEmail(data.userEmail); if (getByte("EnableSessionPopup", 0)) MSN_ShowPopup(hContact, TranslateT("Contact left channel"), 0); @@ -1098,7 +1098,7 @@ LBL_InvalidCommand: MSN_KillChatSession(info->mChatID); // open up srmm dialog when quit while 1 person left - HCONTACT hContact = info->getContactHandle(); + MCONTACT hContact = info->getContactHandle(); if (hContact) CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); } } @@ -1162,7 +1162,7 @@ LBL_InvalidCommand: if (tArgs < 2) goto LBL_InvalidCommand; - HCONTACT hContact = MSN_HContactFromEmail(data.userEmail); + MCONTACT hContact = MSN_HContactFromEmail(data.userEmail); if (hContact != NULL) { setWord(hContact, "Status", MSN_GetThreadByContact(data.userEmail) ? ID_STATUS_INVISIBLE : ID_STATUS_OFFLINE); setDword(hContact, "IdleTS", 0); @@ -1203,7 +1203,7 @@ LBL_InvalidCommand: MsnContact *cont = Lists_Get(szEmail); - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; if (!cont && !isMe) { hContact = MSN_HContactFromEmail(data.wlid, data.userNick, true, true); cont = Lists_Get(szEmail); @@ -1293,7 +1293,7 @@ remove: if (!strchr(data.userEmail, ';')) { UrlDecode(data.userNick); - HCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true); + MCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true); if (tNumTokens == 5 && strcmp(data.flags, "0:0")) { MsnContact *cont = Lists_Get(data.userEmail); @@ -1385,7 +1385,7 @@ remove: stripBBCode(data.userNick); stripColorCode(data.userNick); - HCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true); + MCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true); if (tNumTokens == 3) { MsnContact *cont = Lists_Get(data.userEmail); if (cont) { diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index 1fdef99e6b..bb7bd6c559 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -23,9 +23,9 @@ along with this program. If not, see . #include "msn_global.h" #include "msn_proto.h" -HCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary) +MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; char* szEmail; parseWLID(NEWSTR_ALLOCA(wlid), NULL, &szEmail, NULL); @@ -34,7 +34,7 @@ HCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, if (msc && msc->hContact) hContact = msc->hContact; if (hContact == NULL && addIfNeeded) { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); setString(hContact, "e-mail", szEmail); setStringUtf(hContact, "Nick", msnNick ? msnNick : wlid); @@ -48,7 +48,7 @@ HCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, } -void CMsnProto::MSN_SetContactDb(HCONTACT hContact, const char *szEmail) +void CMsnProto::MSN_SetContactDb(MCONTACT hContact, const char *szEmail) { MsnContact *cont = Lists_Get(szEmail); const int listId = cont->list; @@ -119,7 +119,7 @@ void CMsnProto::AddDelUserContList(const char* email, const int list, const int ///////////////////////////////////////////////////////////////////////////////////////// // MSN_AddUser - adds a e-mail address to one of the MSN server lists -bool CMsnProto::MSN_AddUser(HCONTACT hContact, const char* email, int netId, int flags, const char *msg) +bool CMsnProto::MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg) { bool needRemove = (flags & LIST_REMOVE) != 0; bool leaveHotmail = (flags & LIST_REMOVENH) == LIST_REMOVENH; diff --git a/protocols/MSN/src/msn_global.h b/protocols/MSN/src/msn_global.h index fac52f59d7..d1efa2736b 100644 --- a/protocols/MSN/src/msn_global.h +++ b/protocols/MSN/src/msn_global.h @@ -167,7 +167,7 @@ template void UrlDecode(chartype* str); void __cdecl MSN_ConnectionProc(HANDLE hNewConnection, DWORD dwRemoteIP, void*); char* MSN_GetAvatarHash(char* szContext, char** pszUrl = NULL); -bool MSN_MsgWndExist(HCONTACT hContact); +bool MSN_MsgWndExist(MCONTACT hContact); #define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a)) @@ -542,7 +542,7 @@ struct ThreadData int contactJoined(const char* email); int contactLeft(const char* email); - HCONTACT getContactHandle(void); + MCONTACT getContactHandle(void); }; @@ -569,7 +569,7 @@ struct ThreadData -inline bool IsChatHandle(HCONTACT hContact) { return (INT_PTR)hContact < 0; } +inline bool IsChatHandle(MCONTACT hContact) { return (INT_PTR)hContact < 0; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -596,10 +596,10 @@ struct MsgQueueEntry struct AvatarQueueEntry { - HCONTACT hContact; + MCONTACT hContact; char *pszUrl; - __forceinline AvatarQueueEntry(HCONTACT _contact, LPCSTR _url) : + __forceinline AvatarQueueEntry(MCONTACT _contact, LPCSTR _url) : hContact(_contact), pszUrl( mir_strdup(_url)) {} @@ -639,7 +639,7 @@ struct MsnContact char *email; char *invite; char *nick; - HCONTACT hContact; + MCONTACT hContact; int list; int netId; int p2pMsgId; @@ -863,7 +863,7 @@ struct chunkedmsg struct DeleteParam { CMsnProto *proto; - HCONTACT hContact; + MCONTACT hContact; }; INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -871,10 +871,10 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA struct InviteChatParam { TCHAR* id; - HCONTACT hContact; + MCONTACT hContact; CMsnProto* ppro; - InviteChatParam(const TCHAR* id, HCONTACT hContact, CMsnProto* ppro) + InviteChatParam(const TCHAR* id, MCONTACT hContact, CMsnProto* ppro) : id(mir_tstrdup(id)), hContact(hContact), ppro(ppro) {} ~InviteChatParam() diff --git a/protocols/MSN/src/msn_links.cpp b/protocols/MSN/src/msn_links.cpp index e41bf5becb..e058d9194b 100644 --- a/protocols/MSN/src/msn_links.cpp +++ b/protocols/MSN/src/msn_links.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . static HANDLE hServiceParseLink; -static HCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto) +static MCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto) { TCHAR* email = NULL; do @@ -51,7 +51,7 @@ static HCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto) return NULL; } if (pemail) *pemail = email; - HCONTACT hContact = proto->MSN_HContactFromEmail(UTF8(email), NULL, true, true); + MCONTACT hContact = proto->MSN_HContactFromEmail(UTF8(email), NULL, true, true); return hContact; } @@ -96,7 +96,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) arg += 4; TCHAR *email; - HCONTACT hContact = GetContact(arg, &email, proto); + MCONTACT hContact = GetContact(arg, &email, proto); if (email == NULL) return 1; /* does not yet check if email is current user */ @@ -121,7 +121,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) { arg += 5; - HCONTACT hContact = GetContact(arg, NULL, proto); + MCONTACT hContact = GetContact(arg, NULL, proto); if (hContact != NULL) { @@ -133,7 +133,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) { arg += 6; - HCONTACT hContact = GetContact(arg, NULL, proto); + MCONTACT hContact = GetContact(arg, NULL, proto); if (hContact != NULL) { @@ -145,7 +145,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) { arg += 6; - HCONTACT hContact = GetContact(arg, NULL, proto); + MCONTACT hContact = GetContact(arg, NULL, proto); if (hContact != NULL) { diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index bd3ab46208..b091510004 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -65,7 +65,7 @@ MsnContact* CMsnProto::Lists_Get(const char* email) return p; } -MsnContact* CMsnProto::Lists_Get(HCONTACT hContact) +MsnContact* CMsnProto::Lists_Get(MCONTACT hContact) { EnterCriticalSection(&csLists); @@ -188,7 +188,7 @@ unsigned CMsnProto::p2p_getPktNum(const char* wlid) return res; } -int CMsnProto::Lists_Add(int list, int netId, const char* email, HCONTACT hContact, const char* nick, const char* invite) +int CMsnProto::Lists_Add(int list, int netId, const char* email, MCONTACT hContact, const char* nick, const char* invite) { EnterCriticalSection(&csLists); @@ -238,9 +238,9 @@ void CMsnProto::Lists_Remove(int list, const char* email) void CMsnProto::Lists_Populate(void) { - HCONTACT hContact = db_find_first(m_szModuleName); + MCONTACT hContact = db_find_first(m_szModuleName); while (hContact) { - HCONTACT hNext = db_find_next(hContact, m_szModuleName); + MCONTACT hNext = db_find_next(hContact, m_szModuleName); char szEmail[MSN_MAX_EMAIL_LEN] = ""; if (db_get_static(hContact, m_szModuleName, "wlid", szEmail, sizeof(szEmail))) db_get_static(hContact, m_szModuleName, "e-mail", szEmail, sizeof(szEmail)); @@ -439,7 +439,7 @@ static void ResetListOptions(HWND hwndList) SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT)); } -static void SetContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto) +static void SetContactIcons(MCONTACT hItem, HWND hwndList, CMsnProto* proto) { if (!proto->MSN_IsMyContact(hItem)) { SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); @@ -460,17 +460,17 @@ static void SetContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(4,(dwMask & LIST_RL)?5:0)); } -static void SetAllContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto) +static void SetAllContactIcons(MCONTACT hItem, HWND hwndList, CMsnProto* proto) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) SetAllContactIcons(hItemT, hwndList, proto); } @@ -481,7 +481,7 @@ static void SetAllContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto) } } -static void SaveListItem(HCONTACT hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto) +static void SaveListItem(MCONTACT hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto) { if (iPrevValue == iNewValue) return; @@ -499,15 +499,15 @@ static void SaveListItem(HCONTACT hContact, const char* szEmail, int list, int i proto->MSN_AddUser(hContact, szEmail, proto->Lists_GetNetId(szEmail), list); } -static void SaveSettings(HCONTACT hItem, HWND hwndList, CMsnProto* proto) +static void SaveSettings(MCONTACT hItem, HWND hwndList, CMsnProto* proto) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) SaveSettings(hItemT, hwndList, proto); } @@ -536,7 +536,7 @@ static void SaveSettings(HCONTACT hItem, HWND hwndList, CMsnProto* proto) if (xorMask && newMask & (LIST_FL | LIST_LL)) { - HCONTACT hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem; + MCONTACT hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem; proto->MSN_SetContactDb(hContact, szEmail); } @@ -550,7 +550,7 @@ static void SaveSettings(HCONTACT hItem, HWND hwndList, CMsnProto* proto) } } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } @@ -632,7 +632,7 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { case CLN_NEWCONTACT: if ((nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - SetContactIcons((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, proto); + SetContactIcons((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, proto); break; case CLN_LISTREBUILT: diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index d74d62ff33..f3c84f36af 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -293,7 +293,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) ShowPopup &= mUnreadMessages != 0 || (mUnreadJunkEmails != 0 && !getByte("DisableHotmailJunk", 0)); - HCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail); + MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail); if (hContact) { CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1); @@ -398,7 +398,7 @@ static void TruncUtf8(char *str, size_t sz) str[cntl] = 0; } -void CMsnProto::displayEmailCount(HCONTACT hContact) +void CMsnProto::displayEmailCount(MCONTACT hContact) { if (!emailEnabled || getByte("DisableHotmailCL", 0)) return; diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index e9e6cf3b1a..f36fccd9e2 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -33,7 +33,7 @@ HANDLE hNetMeeting, hBlockCom, hSendHotMail, hInviteChat, hViewProfile; INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM) { if (msnLoggedIn) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char tEmail[MSN_MAX_EMAIL_LEN]; db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)); @@ -51,7 +51,7 @@ INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM) INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM) { - HCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail); + MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail); if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1); MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox"); @@ -60,7 +60,7 @@ INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM) INT_PTR CMsnProto::MsnSendHotmail(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char szEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, szEmail)) @@ -85,7 +85,7 @@ INT_PTR CMsnProto::MsnSetupAlerts(WPARAM, LPARAM) INT_PTR CMsnProto::MsnViewProfile(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char buf[64], *cid; if (hContact == NULL) @@ -127,7 +127,7 @@ INT_PTR CMsnProto::MsnInviteCommand(WPARAM, LPARAM) int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char szEmail[MSN_MAX_EMAIL_LEN]; if ( !MSN_IsMyContact(hContact)) @@ -157,7 +157,7 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) int CMsnProto::OnContactDoubleClicked(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (emailEnabled && MSN_IsMeByContact(hContact)) { MsnSendHotmail(wParam, 0); @@ -173,7 +173,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM) { if (!msnLoggedIn) return 0; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); char szEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, szEmail)) return 0; @@ -359,7 +359,7 @@ void CMsnProto::MSN_EnableMenuItems(bool bEnable) ////////////////////////////////////////////////////////////////////////////////////// -static CMsnProto* GetProtoInstanceByHContact(HCONTACT hContact) +static CMsnProto* GetProtoInstanceByHContact(MCONTACT hContact) { char* szProto = GetContactProto(hContact); if (szProto == NULL) @@ -374,31 +374,31 @@ static CMsnProto* GetProtoInstanceByHContact(HCONTACT hContact) static INT_PTR MsnMenuBlockCommand(WPARAM wParam, LPARAM lParam) { - CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam); + CMsnProto* ppro = GetProtoInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->MsnBlockCommand(wParam, lParam) : 0; } static INT_PTR MsnMenuViewProfile(WPARAM wParam, LPARAM lParam) { - CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam); + CMsnProto* ppro = GetProtoInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->MsnViewProfile(wParam, lParam) : 0; } static INT_PTR MsnMenuSendNetMeeting(WPARAM wParam, LPARAM lParam) { - CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam); + CMsnProto* ppro = GetProtoInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->MsnSendNetMeeting(wParam, lParam) : 0; } static INT_PTR MsnMenuSendHotmail(WPARAM wParam, LPARAM lParam) { - CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam); + CMsnProto* ppro = GetProtoInstanceByHContact((MCONTACT)wParam); return (ppro) ? ppro->MsnSendHotmail(wParam, lParam) : 0; } static int MSN_OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam) { - CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam); + CMsnProto* ppro = GetProtoInstanceByHContact((MCONTACT)wParam); if (ppro) ppro->OnPrebuildContactMenu(wParam, lParam); else { diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 704adaf6f4..f3c74618e2 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -88,7 +88,7 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const ch { //blob is: UIN=0(DWORD), hContact(DWORD), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ) - HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); + MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true); int emaillen = (int)strlen(email); @@ -176,7 +176,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl) ///////////////////////////////////////////////////////////////////////////////////////// // MSN_GetAvatarFileName - gets a file name for an contact's avatar -void CMsnProto::MSN_GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) +void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) { size_t tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName); @@ -321,7 +321,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen) ///////////////////////////////////////////////////////////////////////////////////////// // MSN_GetCustomSmileyFileName - gets a file name for an contact's custom smiley -void CMsnProto::MSN_GetCustomSmileyFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type) +void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type) { size_t tPathLen; @@ -834,7 +834,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_COMMAND: if (tData != NULL) { if (tData->flags & MSN_HOTMAIL_POPUP) { - HCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL); + MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL); if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1); if (tData->flags & MSN_ALLOW_ENTER) tData->proto->MsnInvokeMyURL(true, tData->url); @@ -847,7 +847,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_CONTEXTMENU: if (tData != NULL && tData->flags & MSN_HOTMAIL_POPUP) { - HCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL); + MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL); if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1); } @@ -946,7 +946,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); } -void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HCONTACT hContact) +void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, MCONTACT hContact) { if (Miranda_Terminated()) return; @@ -961,7 +961,7 @@ void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags } -void CMsnProto::MSN_ShowPopup(const HCONTACT hContact, const TCHAR* msg, int flags) +void CMsnProto::MSN_ShowPopup(const MCONTACT hContact, const TCHAR* msg, int flags) { const TCHAR* nickname = hContact ? GetContactNameT(hContact) : _T("Me"); MSN_ShowPopup(nickname, msg, flags, NULL, hContact); @@ -1194,13 +1194,13 @@ char* TWinErrorCode::getText() return mErrorText; } -bool CMsnProto::MSN_IsMyContact(HCONTACT hContact) +bool CMsnProto::MSN_IsMyContact(MCONTACT hContact) { const char* szProto = GetContactProto(hContact); return szProto != NULL && strcmp(m_szModuleName, szProto) == 0; } -bool CMsnProto::MSN_IsMeByContact(HCONTACT hContact, char* szEmail) +bool CMsnProto::MSN_IsMeByContact(MCONTACT hContact, char* szEmail) { char tEmail[MSN_MAX_EMAIL_LEN]; char *emailPtr = szEmail ? szEmail : tEmail; @@ -1212,7 +1212,7 @@ bool CMsnProto::MSN_IsMeByContact(HCONTACT hContact, char* szEmail) return _stricmp(emailPtr, MyOptions.szEmail) == 0; } -bool MSN_MsgWndExist(HCONTACT hContact) +bool MSN_MsgWndExist(MCONTACT hContact) { MessageWindowInputData msgWinInData = { sizeof(MessageWindowInputData), hContact, MSG_WINDOW_UFLAG_MSG_BOTH }; @@ -1222,7 +1222,7 @@ bool MSN_MsgWndExist(HCONTACT hContact) bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0; res = res || msgWinData.hwndWindow; if (res) { - msgWinInData.hContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0); + msgWinInData.hContact = (MCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0); if (msgWinInData.hContact != NULL) { res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0; res |= (msgWinData.hwndWindow == NULL); diff --git a/protocols/MSN/src/msn_msgqueue.cpp b/protocols/MSN/src/msn_msgqueue.cpp index 0bbd87c01b..ae231e7097 100644 --- a/protocols/MSN/src/msn_msgqueue.cpp +++ b/protocols/MSN/src/msn_msgqueue.cpp @@ -156,7 +156,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) const MsgQueueEntry& E = lsMessageQueue[i]; if (E.msgSize == 0) { - HCONTACT hContact = MSN_HContactFromEmail(E.wlid); + MCONTACT hContact = MSN_HContactFromEmail(E.wlid); ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)E.seq, (LPARAM)Translate("Message delivery failed")); } @@ -187,7 +187,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) if (msgfnd) { LeaveCriticalSection(&csMsgQueue); - HCONTACT hContact = MSN_HContactFromEmail(wlid); + MCONTACT hContact = MSN_HContactFromEmail(wlid); ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq, (LPARAM)Translate("Message delivery failed")); i = 0; diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index b4c00ca167..ae6276b6f3 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -490,7 +490,7 @@ static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM w proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG)); proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION)); - HCONTACT hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail); + MCONTACT hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail); if (hContact) proto->displayEmailCount(hContact); return TRUE; diff --git a/protocols/MSN/src/msn_p2ps.cpp b/protocols/MSN/src/msn_p2ps.cpp index 697bb49c0b..780c27b197 100644 --- a/protocols/MSN/src/msn_p2ps.cpp +++ b/protocols/MSN/src/msn_p2ps.cpp @@ -110,7 +110,7 @@ bool CMsnProto::p2p_sessionRegistered(filetransfer* ft) return idx > -1; } -filetransfer* CMsnProto::p2p_getThreadSession(HCONTACT hContact, TInfoType mType) +filetransfer* CMsnProto::p2p_getThreadSession(MCONTACT hContact, TInfoType mType) { EnterCriticalSection(&sessionLock); @@ -129,7 +129,7 @@ filetransfer* CMsnProto::p2p_getThreadSession(HCONTACT hContact, TInfoType mType return result; } -void CMsnProto::p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType) +void CMsnProto::p2p_clearThreadSessions(MCONTACT hContact, TInfoType mType) { EnterCriticalSection(&sessionLock); @@ -147,7 +147,7 @@ void CMsnProto::p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType) LeaveCriticalSection(&sessionLock); } -filetransfer* CMsnProto::p2p_getAvatarSession(HCONTACT hContact) +filetransfer* CMsnProto::p2p_getAvatarSession(MCONTACT hContact) { EnterCriticalSection(&sessionLock); @@ -165,7 +165,7 @@ filetransfer* CMsnProto::p2p_getAvatarSession(HCONTACT hContact) return result; } -bool CMsnProto::p2p_isAvatarOnly(HCONTACT hContact) +bool CMsnProto::p2p_isAvatarOnly(MCONTACT hContact) { EnterCriticalSection(&sessionLock); diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 7f4ad25621..1c21cb445e 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -80,7 +80,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : LoadOptions(); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { delSetting(hContact, "Status"); delSetting(hContact, "IdleTS"); delSetting(hContact, "p2pMsgId"); @@ -216,9 +216,9 @@ int CMsnProto::OnPreShutdown(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // MsnAddToList - adds contact to the server list -HCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags) +MCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags) { - HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY); + MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY); if (flags & PALF_TEMPORARY) { @@ -249,7 +249,7 @@ HCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD return hContact; } -HCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { TCHAR *id = psr->id ? psr->id : psr->email; return AddToListByEmail( @@ -258,7 +258,7 @@ HCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) flags); } -HCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1)) @@ -277,7 +277,7 @@ HCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDb return AddToListByEmail(email, nick, flags); } -int CMsnProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int CMsnProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { Proto_AuthRecv(m_szModuleName, pre); return 0; @@ -286,7 +286,7 @@ int CMsnProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CMsnProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { if (msnLoggedIn) { @@ -349,7 +349,7 @@ int CMsnProto::Authorize(HANDLE hDbEvent) char* lastName = firstName + strlen(firstName) + 1; char* email = lastName + strlen(lastName) + 1; - HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, 0); + MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, 0); int netId = Lists_GetNetId(email); MSN_AddUser(hContact, email, netId, LIST_AL); @@ -398,7 +398,7 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) { if (msc->hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0); msc->hContact = NULL; - HCONTACT hContact = MSN_HContactFromEmail(email); + MCONTACT hContact = MSN_HContactFromEmail(email); if (hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); } @@ -518,7 +518,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0); } -HANDLE __cdecl CMsnProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE __cdecl CMsnProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { filetransfer* ft = (filetransfer*)hTransfer; @@ -546,7 +546,7 @@ HANDLE __cdecl CMsnProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const P ///////////////////////////////////////////////////////////////////////////////////////// // MsnFileCancel - cancels the active file transfer -int __cdecl CMsnProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CMsnProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { filetransfer* ft = (filetransfer*)hTransfer; @@ -579,7 +579,7 @@ int __cdecl CMsnProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) ///////////////////////////////////////////////////////////////////////////////////////// // MsnFileDeny - rejects the file transfer request -int __cdecl CMsnProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) +int __cdecl CMsnProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) { filetransfer* ft = (filetransfer*)hTransfer; @@ -650,7 +650,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR typedef struct AwayMsgInfo_tag { INT_PTR id; - HCONTACT hContact; + MCONTACT hContact; } AwayMsgInfo; void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) @@ -668,7 +668,7 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) mir_free(inf); } -HANDLE __cdecl CMsnProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CMsnProto::GetAwayMsg(MCONTACT hContact) { AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo)); inf->hContact = hContact; @@ -681,7 +681,7 @@ HANDLE __cdecl CMsnProto::GetAwayMsg(HCONTACT hContact) ///////////////////////////////////////////////////////////////////////////////////////// // MsnGetCaps - obtain the protocol capabilities -DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT hContact) { switch(type) { case PFLAGNUM_1: @@ -718,7 +718,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HCONTACT hContact) ///////////////////////////////////////////////////////////////////////////////////////// // MsnGetInfo - nothing to do, cause we cannot obtain information from the server -int __cdecl CMsnProto::GetInfo(HCONTACT hContact, int infoType) +int __cdecl CMsnProto::GetInfo(MCONTACT hContact, int infoType) { return 1; } @@ -726,7 +726,7 @@ int __cdecl CMsnProto::GetInfo(HCONTACT hContact, int infoType) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CMsnProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CMsnProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -735,7 +735,7 @@ int __cdecl CMsnProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) ///////////////////////////////////////////////////////////////////////////////////////// // MsnRecvFile - creates a database event from the file request been received -int __cdecl CMsnProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) +int __cdecl CMsnProto::RecvFile(MCONTACT hContact, PROTOFILEEVENT* evt) { return Proto_RecvFile(hContact, evt); } @@ -743,7 +743,7 @@ int __cdecl CMsnProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) ///////////////////////////////////////////////////////////////////////////////////////// // MsnRecvMessage - creates a database event from the message been received -int __cdecl CMsnProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { char tEmail[MSN_MAX_EMAIL_LEN]; db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)); @@ -757,7 +757,7 @@ int __cdecl CMsnProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CMsnProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CMsnProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -765,7 +765,7 @@ int __cdecl CMsnProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CMsnProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CMsnProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } @@ -773,7 +773,7 @@ int __cdecl CMsnProto::SendContacts(HCONTACT hContact, int flags, int nContacts, ///////////////////////////////////////////////////////////////////////////////////////// // MsnSendFile - initiates a file transfer -HANDLE __cdecl CMsnProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) +HANDLE __cdecl CMsnProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { if (!msnLoggedIn) return 0; @@ -826,14 +826,14 @@ HANDLE __cdecl CMsnProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescrip struct TFakeAckParams { - inline TFakeAckParams(HCONTACT p2, long p3, const char* p4, CMsnProto *p5) : + inline TFakeAckParams(MCONTACT p2, long p3, const char* p4, CMsnProto *p5) : hContact(p2), id(p3), msg(p4), proto(p5) {} - HCONTACT hContact; + MCONTACT hContact; long id; const char* msg; CMsnProto *proto; @@ -851,7 +851,7 @@ void CMsnProto::MsnFakeAck(void* arg) delete tParam; } -int __cdecl CMsnProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { const char *errMsg = NULL; @@ -1002,7 +1002,7 @@ int __cdecl CMsnProto::SetAwayMsg(int status, const TCHAR* msg) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CMsnProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt) +int __cdecl CMsnProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt) { return 1; } @@ -1065,7 +1065,7 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus) ///////////////////////////////////////////////////////////////////////////////////////// // MsnUserIsTyping - notify another contact that we're typing a message -int __cdecl CMsnProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type) { if (!msnLoggedIn) return 0; @@ -1108,7 +1108,7 @@ int __cdecl CMsnProto::UserIsTyping(HCONTACT hContact, int type) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CMsnProto::SendUrl(HCONTACT hContact, int flags, const char* url) +int __cdecl CMsnProto::SendUrl(MCONTACT hContact, int flags, const char* url) { return 1; } @@ -1116,7 +1116,7 @@ int __cdecl CMsnProto::SendUrl(HCONTACT hContact, int flags, const char* url) ///////////////////////////////////////////////////////////////////////////////////////// // MsnSetApparentMode - controls contact visibility -int __cdecl CMsnProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CMsnProto::SetApparentMode(MCONTACT hContact, int mode) { if (mode && mode != ID_STATUS_OFFLINE) return 1; diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index cf40b2b89e..74d758dcbf 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -32,23 +32,23 @@ struct CMsnProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - 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 HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email); @@ -56,24 +56,24 @@ struct CMsnProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -195,7 +195,7 @@ struct CMsnProto : public PROTO bool getMyAvatarFile(char *url, TCHAR *fname); void MSN_GoOffline(void); - void MSN_GetCustomSmileyFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type); + void MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type); const char* MirandaStatusToMSN(int status); WORD MSNStatusToMiranda(const char *status); @@ -218,13 +218,13 @@ struct CMsnProto : public PROTO void sttProcessYFind(char* buf, size_t len); void sttCustomSmiley(const char* msgBody, char* email, char* nick, int iSmileyType); void sttInviteMessage(ThreadData* info, char* msgBody, char* email, char* nick); - void sttSetMirVer(HCONTACT hContact, DWORD dwValue, bool always); + void sttSetMirVer(MCONTACT hContact, DWORD dwValue, bool always); void LoadOptions(void); void InitPopups(void); - void MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HCONTACT hContact = NULL); - void MSN_ShowPopup(const HCONTACT hContact, const TCHAR* msg, int flags); + void MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, MCONTACT hContact = NULL); + void MSN_ShowPopup(const MCONTACT hContact, const TCHAR* msg, int flags); void MSN_ShowError(const char* msgtext, ...); void MSN_SetNicknameUtf(const char* nickname); @@ -337,7 +337,7 @@ struct CMsnProto : public PROTO void p2p_cancelAllSessions(void); void p2p_redirectSessions(const char* wlid); void p2p_startSessions(const char* wlid); - void p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType); + void p2p_clearThreadSessions(MCONTACT hContact, TInfoType mType); void p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid); void p2p_inviteDc(filetransfer* ft, const char *wlid); @@ -380,14 +380,14 @@ struct CMsnProto : public PROTO void P2pSessions_Init(void); void P2pSessions_Uninit(void); - filetransfer* p2p_getAvatarSession(HCONTACT hContact); - filetransfer* p2p_getThreadSession(HCONTACT hContact, TInfoType mType); + filetransfer* p2p_getAvatarSession(MCONTACT hContact); + filetransfer* p2p_getThreadSession(MCONTACT hContact, TInfoType mType); filetransfer* p2p_getSessionByID(unsigned id); filetransfer* p2p_getSessionByUniqueID(unsigned id); filetransfer* p2p_getSessionByCallID(const char* CallID, const char* wlid); bool p2p_sessionRegistered(filetransfer* ft); - bool p2p_isAvatarOnly(HCONTACT hContact); + bool p2p_isAvatarOnly(MCONTACT hContact); unsigned p2p_getMsgId(const char* wlid, int inc); unsigned p2p_getPktNum(const char* wlid); @@ -413,7 +413,7 @@ struct CMsnProto : public PROTO void MSN_ChatStart(ThreadData* info); void MSN_KillChatSession(const TCHAR* id); - HCONTACT MSN_GetChatInernalHandle(HCONTACT hContact); + MCONTACT MSN_GetChatInernalHandle(MCONTACT hContact); int __cdecl MSN_GCEventHook(WPARAM wParam, LPARAM lParam); int __cdecl MSN_GCMenuHook(WPARAM wParam, LPARAM lParam); @@ -421,7 +421,7 @@ struct CMsnProto : public PROTO ///////////////////////////////////////////////////////////////////////////////////////// // MSN contact list - int Lists_Add(int list, int netId, const char* email, HCONTACT hContact = NULL, const char* nick = NULL, const char* invite = NULL); + int Lists_Add(int list, int netId, const char* email, MCONTACT hContact = NULL, const char* nick = NULL, const char* invite = NULL); bool Lists_IsInList(int list, const char* email); int Lists_GetMask(const char* email); int Lists_GetNetId(const char* email); @@ -430,7 +430,7 @@ struct CMsnProto : public PROTO void Lists_Wipe(void); MsnContact* Lists_Get(const char* email); - MsnContact* Lists_Get(HCONTACT hContact); + MsnContact* Lists_Get(MCONTACT hContact); MsnContact* Lists_GetNext(int& i); MsnPlace* Lists_GetPlace(const char* wlid); @@ -446,13 +446,13 @@ struct CMsnProto : public PROTO void MSN_FindYahooUser(const char* email); bool MSN_RefreshContactList(void); - bool MSN_IsMyContact(HCONTACT hContact); - bool MSN_IsMeByContact(HCONTACT hContact, char* szEmail = NULL); - bool MSN_AddUser(HCONTACT hContact, const char* email, int netId, int flags, const char *msg = NULL); + bool MSN_IsMyContact(MCONTACT hContact); + bool MSN_IsMeByContact(MCONTACT hContact, char* szEmail = NULL); + bool MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg = NULL); void MSN_AddAuthRequest(const char *email, const char *nick, const char *reason); - void MSN_SetContactDb(HCONTACT hContact, const char *szEmail); - HCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false); - HCONTACT AddToListByEmail(const char *email, const char *nick, DWORD flags); + void MSN_SetContactDb(MCONTACT hContact, const char *szEmail); + MCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false); + MCONTACT AddToListByEmail(const char *email, const char *nick, DWORD flags); ///////////////////////////////////////////////////////////////////////////////////////// // MSN server groups @@ -464,11 +464,11 @@ struct CMsnProto : public PROTO LPCSTR MSN_GetGroupByName(const char* pName); void MSN_SetGroupName(const char* pId, const char* pName); - void MSN_MoveContactToGroup(HCONTACT hContact, const char* grpName); + void MSN_MoveContactToGroup(MCONTACT hContact, const char* grpName); void MSN_RenameServerGroup(LPCSTR szId, const char* newName); void MSN_DeleteServerGroup(LPCSTR szId); void MSN_RemoveEmptyGroups(void); - void MSN_SyncContactToServerGroup(HCONTACT hContact, const char* szContId, ezxml_t cgrp); + void MSN_SyncContactToServerGroup(MCONTACT hContact, const char* szContId, ezxml_t cgrp); void MSN_UploadServerGroups(char* group); ///////////////////////////////////////////////////////////////////////////////////////// @@ -485,12 +485,12 @@ struct CMsnProto : public PROTO void AvatarQueue_Init(void); void AvatarQueue_Uninit(void); - void MSN_GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); + void MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); int MSN_SetMyAvatar(const TCHAR* szFname, void* pData, size_t cbLen); void __cdecl MSN_AvatarsThread(void*); - void pushAvatarRequest(HCONTACT hContact, LPCSTR pszUrl); + void pushAvatarRequest(MCONTACT hContact, LPCSTR pszUrl); bool loadHttpAvatar(AvatarQueueEntry *p); ///////////////////////////////////////////////////////////////////////////////////////// @@ -504,7 +504,7 @@ struct CMsnProto : public PROTO void processMailData(char* mailData); void sttNotificationMessage(char* msgBody, bool isInitial); - void displayEmailCount(HCONTACT hContact); + void displayEmailCount(MCONTACT hContact); ///////////////////////////////////////////////////////////////////////////////////////// // MSN SOAP Address Book @@ -526,7 +526,7 @@ struct CMsnProto : public PROTO ezxml_t abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr); char* GetABHost(const char* service, bool isSharing); - void SetAbParam(HCONTACT hContact, const char *name, const char *par); + void SetAbParam(MCONTACT hContact, const char *name, const char *par); void UpdateABHost(const char* service, const char* url); void UpdateABCacheKey(ezxml_t bdy, bool isSharing); @@ -560,11 +560,11 @@ struct CMsnProto : public PROTO ////////////////////////////////////////////////////////////////////////////////////// - TCHAR* GetContactNameT(HCONTACT hContact); + TCHAR* GetContactNameT(MCONTACT hContact); - int getStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result); + int getStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result); int getStringUtf(const char* name, DBVARIANT* result); - void setStringUtf(HCONTACT hContact, const char* name, const char* value); + void setStringUtf(MCONTACT hContact, const char* name, const char* value); }; extern OBJLIST g_Instances; diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index 5f528760f0..7545a1d7d7 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -609,7 +609,7 @@ bool CMsnProto::MSN_SharingMyProfile(bool allowRecurse) } -void CMsnProto::SetAbParam(HCONTACT hContact, const char *name, const char *par) +void CMsnProto::SetAbParam(MCONTACT hContact, const char *name, const char *par) { if (*par) setStringUtf(hContact, name, (char*)par); // else delSetting(hContact, "FirstName"); @@ -814,7 +814,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas // Depricated in WLM 8.1 // const char* szNick = ezxml_txt(ezxml_child(contInf, "displayName")); // if (*szNick == '\0') szNick = szEmail; - HCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false); + MCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false); // setStringUtf(hContact, "Nick", (char*)szNick); if (MyOptions.ManageServer) @@ -1555,7 +1555,7 @@ unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, in else { MSN_ABAddRemoveContact(szContId, NETID_MSN, true); - HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false); + MCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false); setString(hContact, "ID", szContId); } status = 0; @@ -1590,7 +1590,7 @@ unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, in } else { - HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false); + MCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false); setString(hContact, "ID", szContId); } } diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp index 472e7fafd8..5d655a2d31 100644 --- a/protocols/MSN/src/msn_srv.cpp +++ b/protocols/MSN/src/msn_srv.cpp @@ -133,7 +133,7 @@ void CMsnProto::MSN_SetGroupName(const char* pId, const char* pNewName) ///////////////////////////////////////////////////////////////////////////////////////// // MSN_MoveContactToGroup - sends a contact to the specified group -void CMsnProto::MSN_MoveContactToGroup(HCONTACT hContact, const char* grpName) +void CMsnProto::MSN_MoveContactToGroup(MCONTACT hContact, const char* grpName) { if (!MyOptions.ManageServer) return; @@ -251,7 +251,7 @@ void CMsnProto::MSN_UploadServerGroups(char* group) // if contact in multiple server groups it get removed from all of them other them it's // in or the last one -void CMsnProto::MSN_SyncContactToServerGroup(HCONTACT hContact, const char* szContId, ezxml_t cgrp) +void CMsnProto::MSN_SyncContactToServerGroup(MCONTACT hContact, const char* szContId, ezxml_t cgrp) { if (!MyOptions.ManageServer) return; diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp index 78655c0035..b6e2163e4d 100644 --- a/protocols/MSN/src/msn_std.cpp +++ b/protocols/MSN/src/msn_std.cpp @@ -26,7 +26,7 @@ along with this program. If not, see . ///////////////////////////////////////////////////////////////////////////////////////// // Standard functions -int CMsnProto::getStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result) +int CMsnProto::getStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result) { return db_get_utf(hContact, m_szModuleName, name, result); } @@ -34,13 +34,13 @@ int CMsnProto::getStringUtf(const char* name, DBVARIANT* result) { return db_get_utf(NULL, m_szModuleName, name, result); } -void CMsnProto::setStringUtf(HCONTACT hContact, const char* name, const char* value) +void CMsnProto::setStringUtf(MCONTACT hContact, const char* name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } ///////////////////////////////////////////////////////////////////////////////////////// -TCHAR* CMsnProto::GetContactNameT(HCONTACT hContact) +TCHAR* CMsnProto::GetContactNameT(MCONTACT hContact) { if (hContact) return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR); diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 73a74e0670..f19cbc0dec 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -246,7 +246,7 @@ INT_PTR CMsnProto::SendNudge(WPARAM wParam, LPARAM lParam) { if (!msnLoggedIn) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char tEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, tEmail)) return 0; @@ -380,7 +380,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM wParam, LPARAM lParam) int CMsnProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) { - const HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)wParam; if (!msnLoggedIn) //should never happen for MSN contacts return 0; @@ -424,7 +424,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam) { if (!msnLoggedIn || !MyOptions.ManageServer) return 0; - const HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)wParam; const CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam; if (hContact == NULL) @@ -458,7 +458,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam) int CMsnProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam; if (!msnLoggedIn) @@ -619,7 +619,7 @@ INT_PTR CMsnProto::GetUnreadEmailCount(WPARAM wParam, LPARAM lParam) INT_PTR CMsnProto::OnLeaveChat(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (isChatRoom(hContact) != 0) { DBVARIANT dbv; if (getTString(hContact, "ChatRoomID", &dbv) == 0) { diff --git a/protocols/MSN/src/msn_switchboard.cpp b/protocols/MSN/src/msn_switchboard.cpp index 582ea94452..4ff32a7938 100644 --- a/protocols/MSN/src/msn_switchboard.cpp +++ b/protocols/MSN/src/msn_switchboard.cpp @@ -47,7 +47,7 @@ int ThreadData::contactLeft(const char* email) return mJoinedContactsWLID.getCount(); } -HCONTACT ThreadData::getContactHandle(void) +MCONTACT ThreadData::getContactHandle(void) { return mJoinedContactsWLID.getCount() ? proto->MSN_HContactFromEmail(mJoinedContactsWLID[0]) : NULL; } diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index 5abc87ed2a..057f694311 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -552,7 +552,7 @@ ThreadData* CMsnProto::MSN_StartSB(const char* wlid, bool& isOffline) ThreadData* thread = MSN_GetThreadByContact(wlid); if (thread == NULL) { - HCONTACT hContact = MSN_HContactFromEmail(wlid); + MCONTACT hContact = MSN_HContactFromEmail(wlid); WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (wStatus != ID_STATUS_OFFLINE) { @@ -664,7 +664,7 @@ ThreadData::~ThreadData() for (i=0; iMSN_HContactFromEmail(wlid); + MCONTACT hContact = proto->MSN_HContactFromEmail(wlid); int temp_status = proto->getWord(hContact, "Status", ID_STATUS_OFFLINE); if (temp_status == ID_STATUS_INVISIBLE && proto->MSN_GetThreadByContact(wlid) == NULL) proto->setWord(hContact, "Status", ID_STATUS_OFFLINE); diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp index 95f0ba5cea..22a4cbc0aa 100644 --- a/protocols/MSN/src/msn_ws.cpp +++ b/protocols/MSN/src/msn_ws.cpp @@ -67,7 +67,7 @@ bool ThreadData::isTimeout(void) } else if (mJoinedContactsWLID.getCount() <= 1 || mChatID[0] == 0) { - HCONTACT hContact = getContactHandle(); + MCONTACT hContact = getContactHandle(); if (mJoinedContactsWLID.getCount() == 0 || termPending) res = true; @@ -96,7 +96,7 @@ bool ThreadData::isTimeout(void) if (proto->getByte("EnableSessionPopup", 0)) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; if (mJoinedContactsWLID.getCount()) hContact = proto->MSN_HContactFromEmail(mJoinedContactsWLID[0]); else if (mInitialContactWLID) diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index f9d1c75b0a..a51eb4542f 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -361,12 +361,12 @@ void OmegleProto::ClearChat() } // TODO: Could this be done better? -HCONTACT OmegleProto::GetChatHandle() +MCONTACT OmegleProto::GetChatHandle() { /*if (facy.chatHandle_ != NULL) return facy.chatHandle_; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) > 0) { ptrA id = db_get_sa(hContact, m_szModuleName, "ChatRoomId"); if (id != NULL && !strcmp(id, m_szModuleName)) diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp index e98fa84271..4ec6ef36fe 100644 --- a/protocols/Omegle/src/messages.cpp +++ b/protocols/Omegle/src/messages.cpp @@ -79,7 +79,7 @@ void OmegleProto::StopChatWorker(void*p) StopChat(); } -int OmegleProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int OmegleProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { // TODO: msg comes as Unicode (retyped wchar_t*), why should we convert it as ANSI to UTF-8? o_O /* if ( flags & PREF_UNICODE ) diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index ef213f5066..29612b1a75 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -82,7 +82,7 @@ OmegleProto::~OmegleProto( ) ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR OmegleProto::GetCaps( int type, HCONTACT hContact ) +DWORD_PTR OmegleProto::GetCaps( int type, MCONTACT hContact ) { switch(type) { case PFLAGNUM_1: @@ -210,7 +210,7 @@ int OmegleProto::OnPreShutdown(WPARAM wParam,LPARAM lParam) int OmegleProto::OnContactDeleted(WPARAM wparam,LPARAM) { - //HCONTACT hContact = (HCONTACT)wparam; + //MCONTACT hContact = (MCONTACT)wparam; OnLeaveChat(NULL, NULL); return 0; diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index f274dc0174..7e8ce70cad 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -44,23 +44,23 @@ public: } // PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason ); - virtual int __cdecl AuthRecv( HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest( HCONTACT hContact, const PROTOCHAR* szMessage ); + virtual int __cdecl AuthRecv( MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest( MCONTACT hContact, const PROTOCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - 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 HANDLE __cdecl FileAllow( MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); + virtual int __cdecl FileCancel( MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny( MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo( HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo( MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ); @@ -68,24 +68,24 @@ public: virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - virtual int __cdecl RecvContacts( HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvFile( HCONTACT hContact, PROTOFILEEVENT* ); - virtual int __cdecl RecvMsg( HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvUrl( HCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvContacts( MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvFile( MCONTACT hContact, PROTOFILEEVENT* ); + virtual int __cdecl RecvMsg( MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl( MCONTACT hContact, PROTORECVEVENT* ); - 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 SendContacts( MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList ); + virtual HANDLE __cdecl SendFile( MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ); + virtual int __cdecl SendMsg( MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl( MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode( HCONTACT hContact, int mode ); + virtual int __cdecl SetApparentMode( MCONTACT hContact, int mode ); virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg( HCONTACT hContact ); - virtual int __cdecl RecvAwayMsg( HCONTACT hContact, int mode, PROTORECVEVENT* evt ); + virtual HANDLE __cdecl GetAwayMsg( MCONTACT hContact ); + virtual int __cdecl RecvAwayMsg( MCONTACT hContact, int mode, PROTORECVEVENT* evt ); virtual int __cdecl SetAwayMsg( int iStatus, const PROTOCHAR* msg ); - virtual int __cdecl UserIsTyping( HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping( MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam ); @@ -132,7 +132,7 @@ public: void SetChatStatus(int); void ClearChat(); void SetTopic(const TCHAR *topic = NULL); - HCONTACT GetChatHandle(); + MCONTACT GetChatHandle(); // Connection client Omegle_client facy; diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp index 1f8c085547..897ab43de3 100644 --- a/protocols/Omegle/src/stubs.cpp +++ b/protocols/Omegle/src/stubs.cpp @@ -22,12 +22,12 @@ along with this program. If not, see . #include "common.h" -HCONTACT OmegleProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT OmegleProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { return NULL; }; -HCONTACT OmegleProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT OmegleProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) { return NULL; }; @@ -42,12 +42,12 @@ int OmegleProto::AuthDeny(HANDLE hDbEvent,const PROTOCHAR *reason) return 1; } -int OmegleProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *) +int OmegleProto::AuthRecv(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int OmegleProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message) +int OmegleProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) { return 1; } @@ -57,17 +57,17 @@ HANDLE OmegleProto::ChangeInfo(int type,void *info_data) return NULL; } -HANDLE OmegleProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) +HANDLE OmegleProto::FileAllow(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) { return NULL; } -int OmegleProto::FileCancel(HCONTACT hContact,HANDLE hTransfer) +int OmegleProto::FileCancel(MCONTACT hContact,HANDLE hTransfer) { return 1; } -int OmegleProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) +int OmegleProto::FileDeny(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) { return 1; } @@ -77,7 +77,7 @@ int OmegleProto::FileResume(HANDLE hTransfer,int *action,const PROTOCHAR **filen return 1; } -int OmegleProto::GetInfo( HCONTACT hContact, int infoType ) +int OmegleProto::GetInfo( MCONTACT hContact, int infoType ) { return 1; } @@ -107,47 +107,47 @@ HWND OmegleProto::CreateExtendedSearchUI(HWND owner) return NULL; } -int OmegleProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *) +int OmegleProto::RecvContacts(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int OmegleProto::RecvFile(HCONTACT hContact,PROTORECVFILET *) +int OmegleProto::RecvFile(MCONTACT hContact,PROTORECVFILET *) { return 1; } -int OmegleProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *) +int OmegleProto::RecvUrl(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int OmegleProto::SendContacts(HCONTACT hContact,int flags,int nContacts,HCONTACT *hContactsList) +int OmegleProto::SendContacts(MCONTACT hContact,int flags,int nContacts,MCONTACT *hContactsList) { return 1; } -HANDLE OmegleProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) +HANDLE OmegleProto::SendFile(MCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) { return NULL; } -int OmegleProto::SendUrl(HCONTACT hContact,int flags,const char *url) +int OmegleProto::SendUrl(MCONTACT hContact,int flags,const char *url) { return 1; } -int OmegleProto::SetApparentMode(HCONTACT hContact,int mode) +int OmegleProto::SetApparentMode(MCONTACT hContact,int mode) { return 1; } -int OmegleProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt) +int OmegleProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) { return 1; } -int OmegleProto::UserIsTyping(HCONTACT hContact, int type) +int OmegleProto::UserIsTyping(MCONTACT hContact, int type) { return 1; } @@ -157,12 +157,12 @@ int OmegleProto::SetAwayMsg(int iStatus, const PROTOCHAR* msg) return 1; } -HANDLE OmegleProto::GetAwayMsg( HCONTACT hContact ) +HANDLE OmegleProto::GetAwayMsg( MCONTACT hContact ) { return NULL; } -int OmegleProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int OmegleProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { return 1; } diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp index 78e1f9d135..c9b41d93ec 100644 --- a/protocols/Omegle/src/theme.cpp +++ b/protocols/Omegle/src/theme.cpp @@ -47,7 +47,7 @@ HANDLE GetIconHandle(const char* name) } // Helper functions -static OmegleProto * GetInstanceByHContact(HCONTACT hContact) +static OmegleProto * GetInstanceByHContact(MCONTACT hContact) { char *proto = GetContactProto(hContact); if (!proto) diff --git a/protocols/Skype/src/skype_avatars.cpp b/protocols/Skype/src/skype_avatars.cpp index 0ff7d40b56..25db2a32df 100644 --- a/protocols/Skype/src/skype_avatars.cpp +++ b/protocols/Skype/src/skype_avatars.cpp @@ -1,6 +1,6 @@ #include "skype.h" -bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, HCONTACT hContact) +bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, MCONTACT hContact) { bool result = false; @@ -21,7 +21,7 @@ bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, HCONTACT hContact) return result; } -wchar_t * CSkypeProto::GetContactAvatarFilePath(HCONTACT hContact) +wchar_t * CSkypeProto::GetContactAvatarFilePath(MCONTACT hContact) { TCHAR path[MAX_PATH]; ::mir_sntprintf(path, SIZEOF(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), this->m_szModuleName); diff --git a/protocols/Skype/src/skype_blocked.cpp b/protocols/Skype/src/skype_blocked.cpp index a7c96da731..b807f95059 100644 --- a/protocols/Skype/src/skype_blocked.cpp +++ b/protocols/Skype/src/skype_blocked.cpp @@ -3,7 +3,7 @@ int CSkypeProto::BlockCommand(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) { SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID))); @@ -143,7 +143,7 @@ LRESULT CALLBACK CSkypeProto::SkypeBlockedOptionsSubProc(HWND hwnd, UINT msg, WP param->contact->GetIdentity(data); ptrW sid(::mir_utf8decodeW(data)); - HCONTACT hContact = param->ppro->GetContactBySid(sid); + MCONTACT hContact = param->ppro->GetContactBySid(sid); if (::db_get_b(hContact, param->ppro->m_szModuleName, "IsSkypeOut", 0) > 0) ::db_set_w(hContact, param->ppro->m_szModuleName, "Status", ID_STATUS_ONTHEPHONE); @@ -252,7 +252,7 @@ INT_PTR CALLBACK CSkypeProto::SkypeBlockedOptionsProc(HWND hwndDlg, UINT msg, WP } /// int nItem = 0; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; ::EnterCriticalSection(&ppro->contact_search_lock); @@ -296,7 +296,7 @@ INT_PTR CALLBACK CSkypeProto::SkypeBlockedOptionsProc(HWND hwndDlg, UINT msg, WP { int i = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETCURSEL, 0, 0); - HCONTACT hContact = (HCONTACT)::SendMessage(GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETITEMDATA, i, 0); + MCONTACT hContact = (MCONTACT)::SendMessage(GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETITEMDATA, i, 0); if ( !hContact) break; diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp index e0f76365c2..dc9845b6c6 100644 --- a/protocols/Skype/src/skype_chat.cpp +++ b/protocols/Skype/src/skype_chat.cpp @@ -140,7 +140,7 @@ ChatRoom::~ChatRoom() this->members.destroy(); } -HCONTACT ChatRoom::GetContactHandle() const +MCONTACT ChatRoom::GetContactHandle() const { return this->hContact; } @@ -982,7 +982,7 @@ void ChatRoom::OnParticipantChanged(const ParticipantRef &participant, int prop) /// -void CSkypeProto::ChatValidateContact(HCONTACT hItem, HWND hwndList, const StringList &contacts) +void CSkypeProto::ChatValidateContact(MCONTACT hItem, HWND hwndList, const StringList &contacts) { if (this->IsProtoContact(hItem) && !this->isChatRoom(hItem)) { @@ -994,16 +994,16 @@ void CSkypeProto::ChatValidateContact(HCONTACT hItem, HWND hwndList, const Strin ::SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); } -void CSkypeProto::ChatPrepare(HCONTACT hItem, HWND hwndList, const StringList &contacts) +void CSkypeProto::ChatPrepare(MCONTACT hItem, HWND hwndList, const StringList &contacts) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) this->ChatPrepare(hItemT, hwndList, contacts); } @@ -1014,14 +1014,14 @@ void CSkypeProto::ChatPrepare(HCONTACT hItem, HWND hwndList, const StringList &c } } -void CSkypeProto::GetInvitedContacts(HCONTACT hItem, HWND hwndList, StringList &chatTargets) +void CSkypeProto::GetInvitedContacts(MCONTACT hItem, HWND hwndList, StringList &chatTargets) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) this->GetInvitedContacts(hItemT, hwndList, chatTargets); } @@ -1040,7 +1040,7 @@ void CSkypeProto::GetInvitedContacts(HCONTACT hItem, HWND hwndList, StringList & } } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } @@ -1088,7 +1088,7 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam switch (nmc->hdr.code) { case CLN_NEWCONTACT: if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - param->ppro->ChatValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->invitedContacts); + param->ppro->ChatValidateContact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->invitedContacts); break; case CLN_LISTREBUILT: @@ -1192,7 +1192,7 @@ INT_PTR CSkypeProto::CreateChatRoomCommand(WPARAM, LPARAM) return 0; } -void CSkypeProto::ChatRoomInvite(HCONTACT hContact) +void CSkypeProto::ChatRoomInvite(MCONTACT hContact) { ptrT chat_id(::db_get_tsa(hContact, this->m_szModuleName, "ChatRoomID")); @@ -1384,7 +1384,7 @@ int __cdecl CSkypeProto::OnGCEventHook(WPARAM, LPARAM lParam) case CHAT_LIST_MENU::ICM_COPY_SID: { - HCONTACT hContact = this->GetContactBySid(gch->ptszUID); + MCONTACT hContact = this->GetContactBySid(gch->ptszUID); if (!hContact) { ptrW sid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)); @@ -1456,7 +1456,7 @@ int __cdecl CSkypeProto::OnGCMenuHook(WPARAM, LPARAM lParam) if (member->GetRank() > Participant::SPECTATOR) DisableChatMenuItem(ICM_ROLE); - HCONTACT hContact = this->GetContactBySid(gcmi->pszUID); + MCONTACT hContact = this->GetContactBySid(gcmi->pszUID); if (hContact == NULL) DisableChatMenuItem(ICM_DETAILS); else if(this->getByte(hContact, "Auth", 0) == 0) @@ -1539,7 +1539,7 @@ void CSkypeProto::UpdateChatUserNick(const ContactRef &contact) INT_PTR __cdecl CSkypeProto::OnJoinChat(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) { ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID")); @@ -1567,7 +1567,7 @@ INT_PTR __cdecl CSkypeProto::OnJoinChat(WPARAM wParam, LPARAM) INT_PTR __cdecl CSkypeProto::OnLeaveChat(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) { ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID")); diff --git a/protocols/Skype/src/skype_chat.h b/protocols/Skype/src/skype_chat.h index e5e775f980..d63d7c9da2 100644 --- a/protocols/Skype/src/skype_chat.h +++ b/protocols/Skype/src/skype_chat.h @@ -129,7 +129,7 @@ private: CConversation::Ref conversation; - HCONTACT hContact; + MCONTACT hContact; OBJLIST members; @@ -158,7 +158,7 @@ public: ChatRoom(const wchar_t *cid, const wchar_t *name, CSkypeProto *ppro); ~ChatRoom(); - HCONTACT GetContactHandle() const; + MCONTACT GetContactHandle() const; void SetTopic(const wchar_t *topic); wchar_t *GetUri(); diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 325d70f508..9638676e83 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -1,6 +1,6 @@ #include "skype.h" -void CSkypeProto::UpdateContactAuthState(HCONTACT hContact, const ContactRef &contact) +void CSkypeProto::UpdateContactAuthState(MCONTACT hContact, const ContactRef &contact) { uint newTS = 0; contact->GetPropAuthreqTimestamp(newTS); @@ -23,7 +23,7 @@ void CSkypeProto::UpdateContactAuthState(HCONTACT hContact, const ContactRef &co } } -void CSkypeProto::UpdateContactStatus(HCONTACT hContact, const ContactRef &contact) +void CSkypeProto::UpdateContactStatus(MCONTACT hContact, const ContactRef &contact) { Contact::AVAILABILITY availability; contact->GetPropAvailability(availability); @@ -40,7 +40,7 @@ void CSkypeProto::UpdateContactStatus(HCONTACT hContact, const ContactRef &conta } } -void CSkypeProto::UpdateContactClient(HCONTACT hContact, const ContactRef &contact) +void CSkypeProto::UpdateContactClient(MCONTACT hContact, const ContactRef &contact) { bool isMobile = false; contact->HasCapability(Contact::CAPABILITY_MOBILE_DEVICE, isMobile/*, true*/); @@ -48,7 +48,7 @@ void CSkypeProto::UpdateContactClient(HCONTACT hContact, const ContactRef &conta this->setTString(hContact, "MirVer", isMobile ? L"SkypeMobile" : L"Skype"); } -void CSkypeProto::UpdateContactOnlineSinceTime(HCONTACT hContact, const ContactRef &contact) +void CSkypeProto::UpdateContactOnlineSinceTime(MCONTACT hContact, const ContactRef &contact) { uint newTS = 0; contact->GetPropLastonlineTimestamp(newTS); @@ -57,7 +57,7 @@ void CSkypeProto::UpdateContactOnlineSinceTime(HCONTACT hContact, const ContactR this->setDword(hContact, "OnlineSinceTS", newTS); } -void CSkypeProto::UpdateContactLastEventDate(HCONTACT hContact, const ContactRef &contact) +void CSkypeProto::UpdateContactLastEventDate(MCONTACT hContact, const ContactRef &contact) { uint newTS = 0; contact->GetPropLastusedTimestamp(newTS); @@ -71,7 +71,7 @@ void CSkypeProto::OnContactChanged(const ContactRef &contact, int prop) SEString data; contact->GetPropSkypename(data); wchar_t *sid = ::mir_utf8decodeW(data); - HCONTACT hContact = this->GetContactBySid(sid); + MCONTACT hContact = this->GetContactBySid(sid); ::mir_free(sid); SEObject *contactObj = contact.fetch(); @@ -148,14 +148,14 @@ void CSkypeProto::OnContactListChanged(const ContactRef &contact) } } -bool CSkypeProto::IsProtoContact(HCONTACT hContact) +bool CSkypeProto::IsProtoContact(MCONTACT hContact) { return ::lstrcmpiA(::GetContactProto(hContact), this->m_szModuleName) == 0; } -HCONTACT CSkypeProto::GetContactBySid(const wchar_t *sid) +MCONTACT CSkypeProto::GetContactBySid(const wchar_t *sid) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; ::EnterCriticalSection(&this->contact_search_lock); @@ -171,7 +171,7 @@ HCONTACT CSkypeProto::GetContactBySid(const wchar_t *sid) return hContact; } -HCONTACT CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent) +MCONTACT CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent) { // db_event_getContact DWORD body[3]; @@ -180,28 +180,28 @@ HCONTACT CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body; if (::db_event_get(hEvent, &dbei)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (strcmp(dbei.szModule, this->m_szModuleName) != 0) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; return ::DbGetAuthEventContact(&dbei); } -HCONTACT CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary) +MCONTACT CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary) { ptrW sid(::mir_utf8decodeW(contact->GetSid())); CContact::AVAILABILITY availability; contact->GetPropAvailability(availability); - HCONTACT hContact = this->GetContactBySid(sid); + MCONTACT hContact = this->GetContactBySid(sid); if ( !hContact) { - hContact = (HCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0); ::CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)this->m_szModuleName); ptrW nick(::mir_utf8decodeW(contact->GetNick())); @@ -255,7 +255,7 @@ void __cdecl CSkypeProto::LoadContactList(void* data) { CContact::Ref contact = this->contactList[i]; - HCONTACT hContact = this->AddContact(contact); + MCONTACT hContact = this->AddContact(contact); if ( !isFirstLoad) { @@ -293,7 +293,7 @@ void __cdecl CSkypeProto::LoadAuthWaitList(void*) } } -bool CSkypeProto::IsContactOnline(HCONTACT hContact) +bool CSkypeProto::IsContactOnline(MCONTACT hContact) { return this->getWord(hContact, SKYPE_SETTINGS_STATUS, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE; } @@ -302,7 +302,7 @@ void CSkypeProto::SetAllContactStatus(int status) { ::EnterCriticalSection(&this->contact_search_lock); - for (HCONTACT hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName)) + for (MCONTACT hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName)) { if (this->getByte(hContact, "IsSkypeOut", 0) != 0) continue; @@ -355,7 +355,7 @@ void __cdecl CSkypeProto::SearchBySidAsync(void* arg) { mir_ptr sid((wchar_t*)arg); - HCONTACT hContact = this->GetContactBySid(sid); + MCONTACT hContact = this->GetContactBySid(sid); if (hContact) { this->ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact); @@ -462,7 +462,7 @@ void CSkypeProto::OnContactsReceived(const ConversationRef &conversation, const CContact::Ref author; this->GetContact(data, author); - HCONTACT hContact = this->AddContact(author); + MCONTACT hContact = this->AddContact(author); SEBinary guid; message->GetPropGuid(guid); @@ -518,7 +518,7 @@ void CSkypeProto::OnContactsSent(const ConversationRef &conversation, const Mess CContact::Ref receiver; this->GetContact(data, receiver); - HCONTACT hContact = this->AddContact(receiver); + MCONTACT hContact = this->AddContact(receiver); this->SendBroadcast( hContact, ACKTYPE_CONTACTS, diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp index 2390897d10..11caa48001 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -1,6 +1,6 @@ #include "skype.h" -bool CSkypeProto::IsMessageInDB(HCONTACT hContact, DWORD timestamp, SEBinary &guid, int flag) +bool CSkypeProto::IsMessageInDB(MCONTACT hContact, DWORD timestamp, SEBinary &guid, int flag) { for (HANDLE hDbEvent = ::db_event_last(hContact); hDbEvent; hDbEvent = ::db_event_prev(hDbEvent)) { @@ -25,7 +25,7 @@ bool CSkypeProto::IsMessageInDB(HCONTACT hContact, DWORD timestamp, SEBinary &gu return false; } -HANDLE CSkypeProto::AddDBEvent(HCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob) +HANDLE CSkypeProto::AddDBEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = this->m_szModuleName; @@ -52,7 +52,7 @@ void CSkypeProto::RaiseAuthRequestEvent(DWORD timestamp, CContact::Ref contact) char *firstName = ::mir_strdup(data); char *lastName = ::mir_strdup(last); - HCONTACT hContact = this->AddContact(contact); + MCONTACT hContact = this->AddContact(contact); /*blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), firstName(ASCIIZ), lastName(ASCIIZ), sid(ASCIIZ), reason(ASCIIZ)*/ DWORD cbBlob = (DWORD) @@ -84,7 +84,7 @@ void CSkypeProto::RaiseAuthRequestEvent(DWORD timestamp, CContact::Ref contact) this->AddDBEvent(hContact, EVENTTYPE_AUTHREQUEST, time(NULL), DBEF_UTF, cbBlob, pBlob); } -void CSkypeProto::RaiseMessageSentEvent(HCONTACT hContact, DWORD timestamp, SEBinary &guid, const char *message, bool isUnread) +void CSkypeProto::RaiseMessageSentEvent(MCONTACT hContact, DWORD timestamp, SEBinary &guid, const char *message, bool isUnread) { if (this->IsMessageInDB(hContact, timestamp, guid, DBEF_SENT)) return; diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index b0dd1f5802..8aaa3bf433 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -403,7 +403,7 @@ INT_PTR CALLBACK CSkypeProto::SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam break; char *szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact == NULL) szProto = ppro->m_szModuleName; @@ -780,7 +780,7 @@ INT_PTR CALLBACK CSkypeProto::HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } } - tmi.prepareList((HCONTACT)lParam, ::GetDlgItem(hwndDlg, IDC_TIMEZONE), TZF_PLF_CB); + tmi.prepareList((MCONTACT)lParam, ::GetDlgItem(hwndDlg, IDC_TIMEZONE), TZF_PLF_CB); HANDLE hTimeZone = tmi.createByContact ? tmi.createByContact(NULL, 0) : 0; LPCTSTR TzDescr = tmi.getTzDescription(tmi.getTzName(hTimeZone)); ::SetDlgItemText(hwndDlg, IDC_TIMEZONE, TzDescr); diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index 7e399ba829..5d36c697e1 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -65,7 +65,7 @@ int CSkypeProto::OnPreShutdown(WPARAM, LPARAM) int CSkypeProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) { if (this->isChatRoom(hContact)) @@ -128,7 +128,7 @@ int __cdecl CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) int __cdecl CSkypeProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { - if ((!this->IsProtoContact((HCONTACT)lParam)) && lParam) + if ((!this->IsProtoContact((MCONTACT)lParam)) && lParam) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; @@ -138,7 +138,7 @@ int __cdecl CSkypeProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) odp.position = -1900000000; odp.ptszTitle = this->m_tszUserName; - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; if (hContact) { char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if (szProto != NULL && !strcmp(szProto, m_szModuleName)) { @@ -192,7 +192,7 @@ int __cdecl CSkypeProto::OnSrmmWindowOpen(WPARAM, LPARAM lParam) int __cdecl CSkypeProto::OnTabSRMMButtonPressed(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam; switch (cbcd->dwButtonId) diff --git a/protocols/Skype/src/skype_instances.cpp b/protocols/Skype/src/skype_instances.cpp index 264f6e14c2..7a571d243b 100644 --- a/protocols/Skype/src/skype_instances.cpp +++ b/protocols/Skype/src/skype_instances.cpp @@ -73,7 +73,7 @@ void CSkypeProto::UninitInstances() instanceList.destroy(); } -CSkypeProto* CSkypeProto::GetContactInstance(HCONTACT hContact) +CSkypeProto* CSkypeProto::GetContactInstance(MCONTACT hContact) { char *proto = (char *)::CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp index 52849b5efd..d1ea410511 100644 --- a/protocols/Skype/src/skype_menus.cpp +++ b/protocols/Skype/src/skype_menus.cpp @@ -13,7 +13,7 @@ INT_PTR CSkypeProto::MenuChooseService(WPARAM wParam, LPARAM lParam) int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if ( !hContact) return 0; @@ -66,19 +66,19 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) template INT_PTR GlobalService(WPARAM wParam, LPARAM lParam) { - CSkypeProto *ppro = CSkypeProto::GetContactInstance((HCONTACT)wParam); + CSkypeProto *ppro = CSkypeProto::GetContactInstance((MCONTACT)wParam); return ppro ? (ppro->*Service)(wParam, lParam) : 0; } int CSkypeProto::RequestAuth(WPARAM wParam, LPARAM lParam) { - return this->AuthRequest((HCONTACT)wParam, LPGENT("Hi! I\'d like to add you to my contact list")); + return this->AuthRequest((MCONTACT)wParam, LPGENT("Hi! I\'d like to add you to my contact list")); } int CSkypeProto::GrantAuth(WPARAM wParam, LPARAM lParam) { CContact::Ref contact; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID))); if (this->GetContact(sid, contact)) { @@ -95,7 +95,7 @@ int CSkypeProto::GrantAuth(WPARAM wParam, LPARAM lParam) int CSkypeProto::RevokeAuth(WPARAM wParam, LPARAM lParam) { CContact::Ref contact; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID))); if (this->GetContact(sid, contact)) { @@ -112,7 +112,7 @@ int CSkypeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) for (int i = 0; i < SIZEOF(CSkypeProto::contactMenuItems); i++) ::Menu_ShowItem(CSkypeProto::contactMenuItems[i], false); - CSkypeProto* ppro = CSkypeProto::GetContactInstance((HCONTACT)wParam); + CSkypeProto* ppro = CSkypeProto::GetContactInstance((MCONTACT)wParam); return (ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0; } diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp index f82b89cb9e..b212959f98 100644 --- a/protocols/Skype/src/skype_messages.cpp +++ b/protocols/Skype/src/skype_messages.cpp @@ -53,7 +53,7 @@ void CSkypeProto::OnMessageReceived(const ConversationRef &conversation, const M message->GetPropAuthor(data); this->GetContact(data, author); - HCONTACT hContact = this->AddContact(author, true); + MCONTACT hContact = this->AddContact(author, true); this->UserIsTyping(hContact, PROTOTYPE_SELFTYPING_OFF); SEBinary guid; @@ -103,7 +103,7 @@ void CSkypeProto::OnMessageSent(const ConversationRef &conversation, const Messa ptrW sid(::mir_utf8decodeW(data)); - HCONTACT hContact = this->GetContactBySid(sid); + MCONTACT hContact = this->GetContactBySid(sid); this->SendBroadcast( hContact, ACKTYPE_MESSAGE, @@ -157,7 +157,7 @@ void CSkypeProto::OnMessageEvent(const ConversationRef &conversation, const Mess CContact::Ref author; this->GetContact(identity, author); - HCONTACT hContact = this->AddContact(author); + MCONTACT hContact = this->AddContact(author); char *message = ::mir_utf8encode(::Translate("Incoming call started")); @@ -191,7 +191,7 @@ void CSkypeProto::OnMessageEvent(const ConversationRef &conversation, const Mess CContact::Ref author; this->GetContact(identity, author); - HCONTACT hContact = this->AddContact(author); + MCONTACT hContact = this->AddContact(author); char *message = ::mir_utf8encode(::Translate("Incoming call finished")); @@ -222,7 +222,7 @@ void CSkypeProto::SyncMessageHystory(const ConversationRef &conversation, const } } -void CSkypeProto::SyncHistoryCommand(HCONTACT hContact, time_t timestamp) +void CSkypeProto::SyncHistoryCommand(MCONTACT hContact, time_t timestamp) { if (hContact) { @@ -250,7 +250,7 @@ int CSkypeProto::SyncLastDayHistoryCommand(WPARAM wParam, LPARAM lParam) { time_t timestamp = time(NULL); timestamp -= 60*60*24; - this->SyncHistoryCommand((HCONTACT)wParam, timestamp); + this->SyncHistoryCommand((MCONTACT)wParam, timestamp); return 0; } @@ -258,7 +258,7 @@ int CSkypeProto::SyncLastWeekHistoryCommand(WPARAM wParam, LPARAM lParam) { time_t timestamp = time(NULL); timestamp -= 60*60*24*7; - this->SyncHistoryCommand((HCONTACT)wParam, timestamp); + this->SyncHistoryCommand((MCONTACT)wParam, timestamp); return 0; } @@ -266,7 +266,7 @@ int CSkypeProto::SyncLastMonthHistoryCommand(WPARAM wParam, LPARAM lParam) { time_t timestamp = time(NULL); timestamp -= 60*60*24*30; - this->SyncHistoryCommand((HCONTACT)wParam, timestamp); + this->SyncHistoryCommand((MCONTACT)wParam, timestamp); return 0; } @@ -274,7 +274,7 @@ int CSkypeProto::SyncLast3MonthHistoryCommand(WPARAM wParam, LPARAM lParam) { time_t timestamp = time(NULL); timestamp -= 60*60*24*90; - this->SyncHistoryCommand((HCONTACT)wParam, timestamp); + this->SyncHistoryCommand((MCONTACT)wParam, timestamp); return 0; } @@ -282,13 +282,13 @@ int CSkypeProto::SyncLastYearHistoryCommand(WPARAM wParam, LPARAM lParam) { time_t timestamp = time(NULL); timestamp -= 60*60*24*365; - this->SyncHistoryCommand((HCONTACT)wParam, timestamp); + this->SyncHistoryCommand((MCONTACT)wParam, timestamp); return 0; } int CSkypeProto::SyncAllTimeHistoryCommand(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact) { ptrW sid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)); diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp index 6c8cb4e96d..0a6686303d 100644 --- a/protocols/Skype/src/skype_profile.cpp +++ b/protocols/Skype/src/skype_profile.cpp @@ -1,7 +1,7 @@ #include "skype.h" #include -void CSkypeProto::UpdateProfileAvatar(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileAvatar(SEObject *obj, MCONTACT hContact) { uint newTS = obj->GetUintProp(/* *::P_AVATAR_TIMESTAMP */ 182); //if (!newTS) return; //uncomment when skypekit will be work correctly @@ -50,7 +50,7 @@ void CSkypeProto::UpdateProfileAvatar(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileAboutText(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileAboutText(SEObject *obj, MCONTACT hContact) { ptrW aboutText(::mir_utf8decodeW(obj->GetStrProp(/* *::P_ABOUT */ 18))); if ( !::wcslen(aboutText)) @@ -59,7 +59,7 @@ void CSkypeProto::UpdateProfileAboutText(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "About", aboutText); } -void CSkypeProto::UpdateProfileBirthday(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileBirthday(SEObject *obj, MCONTACT hContact) { uint data = obj->GetUintProp(/* *::P_BIRTHDAY */ 7); if (data > 0) @@ -96,7 +96,7 @@ void CSkypeProto::UpdateProfileBirthday(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileCity(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileCity(SEObject *obj, MCONTACT hContact) { ptrW city(::mir_utf8decodeW(obj->GetStrProp(/* *::P_CITY */ 12))); if ( !::wcslen(city)) @@ -105,7 +105,7 @@ void CSkypeProto::UpdateProfileCity(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "City", city); } -void CSkypeProto::UpdateProfileCountry(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileCountry(SEObject *obj, MCONTACT hContact) { char *country; ptrA isocode(::mir_strdup(obj->GetStrProp(/* *::P_COUNTRY */ 10))); @@ -118,7 +118,7 @@ void CSkypeProto::UpdateProfileCountry(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileEmails(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileEmails(SEObject *obj, MCONTACT hContact) { ptrW emails(::mir_utf8decodeW(obj->GetStrProp(/* *::P_EMAILS */ 16))); if (::wcscmp(emails, L"") == 0) @@ -141,7 +141,7 @@ void CSkypeProto::UpdateProfileEmails(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileFullName(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileFullName(SEObject *obj, MCONTACT hContact) { ptrW fullname(::mir_utf8decodeW(obj->GetStrProp(/* *::P_FULLNAME */ 5))); if ( !::wcslen(fullname)) @@ -159,7 +159,7 @@ void CSkypeProto::UpdateProfileFullName(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileGender(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileGender(SEObject *obj, MCONTACT hContact) { uint data = obj->GetUintProp(/* *::P_GENDER */ 8); if (data) @@ -168,7 +168,7 @@ void CSkypeProto::UpdateProfileGender(SEObject *obj, HCONTACT hContact) this->delSetting(hContact, "Gender"); } -void CSkypeProto::UpdateProfileHomepage(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileHomepage(SEObject *obj, MCONTACT hContact) { ptrW homepage(::mir_utf8decodeW(obj->GetStrProp(/* *::P_HOMEPAGE */ 17))); if (::wcscmp(homepage, L"") == 0) @@ -177,7 +177,7 @@ void CSkypeProto::UpdateProfileHomepage(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "Homepage", homepage); } -void CSkypeProto::UpdateProfileLanguages(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileLanguages(SEObject *obj, MCONTACT hContact) { ptrW isocodes(::mir_utf8decodeW(obj->GetStrProp(/* *::P_LANGUAGES */ 9))); @@ -199,7 +199,7 @@ void CSkypeProto::UpdateProfileLanguages(SEObject *obj, HCONTACT hContact) } } -void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, MCONTACT hContact) { ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_MOBILE */ 15))); if ( !::wcslen(phone)) @@ -208,7 +208,7 @@ void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "Cellular", phone); } -void CSkypeProto::UpdateProfileNick(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileNick(SEObject *obj, MCONTACT hContact) { ptrW nick; if (hContact) @@ -225,7 +225,7 @@ void CSkypeProto::UpdateProfileNick(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "Nick", nick); } -void CSkypeProto::UpdateProfilePhone(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfilePhone(SEObject *obj, MCONTACT hContact) { ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_MOBILE */ 13))); if ( !::wcslen(phone)) @@ -234,7 +234,7 @@ void CSkypeProto::UpdateProfilePhone(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "Phone", phone); } -void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, MCONTACT hContact) { ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_OFFICE */ 14))); if ( !::wcslen(phone)) @@ -243,7 +243,7 @@ void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "CompanyPhone", phone); } -void CSkypeProto::UpdateProfileState(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileState(SEObject *obj, MCONTACT hContact) { ptrW state(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PROVINCE */ 11))); if ( !::wcslen(state)) @@ -252,7 +252,7 @@ void CSkypeProto::UpdateProfileState(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "State", state); } -void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, MCONTACT hContact) { ptrW statusMessage(::mir_utf8decodeW(obj->GetStrProp(/* *::P_MOOD_TEXT */ 26))); if ( !::wcslen(statusMessage)) @@ -261,7 +261,7 @@ void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, HCONTACT hContact) this->setTString(hContact, "XStatusMsg", statusMessage); } -void CSkypeProto::UpdateProfileTimezone(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfileTimezone(SEObject *obj, MCONTACT hContact) { LONG data = obj->GetUintProp(/* *::P_TIMEZONE */ 27); if (data > 0) @@ -286,7 +286,7 @@ void CSkypeProto::UpdateProfileTimezone(SEObject *obj, HCONTACT hContact) else this->delSetting(hContact, "Timezone"); } -void CSkypeProto::UpdateProfile(SEObject *obj, HCONTACT hContact) +void CSkypeProto::UpdateProfile(SEObject *obj, MCONTACT hContact) { this->debugLogW(L"Updating profile for %p", hContact); this->UpdateProfileAvatar(obj, hContact); diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index c1d745185e..508c0684f9 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -46,14 +46,14 @@ CSkypeProto::~CSkypeProto() } } -HCONTACT __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { CContact::Ref contact; this->GetContact((char *)mir_ptr(::mir_utf8encodeW(psr->id)), contact); return this->AddContact(contact); } -HCONTACT __cdecl CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); @@ -79,8 +79,8 @@ int __cdecl CSkypeProto::Authorize(HANDLE hDbEvent) { if (this->IsOnline() && hDbEvent) { - HCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; return CSkypeProto::GrantAuth((WPARAM)hContact, NULL); @@ -93,8 +93,8 @@ int __cdecl CSkypeProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) { if (this->IsOnline()) { - HCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; return CSkypeProto::RevokeAuth((WPARAM)hContact, NULL); @@ -103,7 +103,7 @@ int __cdecl CSkypeProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) return 1; } -int __cdecl CSkypeProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CSkypeProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { DWORD flags = 0; @@ -124,7 +124,7 @@ int __cdecl CSkypeProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) return 0; } -int __cdecl CSkypeProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CSkypeProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { if (this->IsOnline() && hContact) { @@ -144,7 +144,7 @@ int __cdecl CSkypeProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) HANDLE __cdecl CSkypeProto::ChangeInfo( int iInfoType, void* pInfoData ) { return 0; } -HANDLE __cdecl CSkypeProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ) +HANDLE __cdecl CSkypeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ) { uint oid = (uint)hTransfer; @@ -193,7 +193,7 @@ HANDLE __cdecl CSkypeProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const return hTransfer; } -int __cdecl CSkypeProto::FileCancel(HCONTACT hContact, HANDLE hTransfer ) +int __cdecl CSkypeProto::FileCancel(MCONTACT hContact, HANDLE hTransfer ) { uint oid = (uint)hTransfer; @@ -217,7 +217,7 @@ int __cdecl CSkypeProto::FileCancel(HCONTACT hContact, HANDLE hTransfer ) return 1; } -int __cdecl CSkypeProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ) +int __cdecl CSkypeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ) { uint oid = (uint)hTransfer; @@ -292,7 +292,7 @@ int __cdecl CSkypeProto::FileResume( HANDLE hTransfer, int* action, const TCH return 0; } -DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, MCONTACT hContact) { switch(type) { @@ -318,7 +318,7 @@ DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, HCONTACT hContact) } } -int __cdecl CSkypeProto::GetInfo(HCONTACT hContact, int infoType ) { return 0; } +int __cdecl CSkypeProto::GetInfo(MCONTACT hContact, int infoType ) { return 0; } HANDLE __cdecl CSkypeProto::SearchBasic(const TCHAR* id) { @@ -358,7 +358,7 @@ HWND __cdecl CSkypeProto::SearchAdvanced( HWND owner ) { return 0; } HWND __cdecl CSkypeProto::CreateExtendedSearchUI( HWND owner ){ return 0; } -int __cdecl CSkypeProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { this->debugLogW(L"Incoming contacts"); ::db_unset(hContact, "CList", "Hidden"); @@ -372,14 +372,14 @@ int __cdecl CSkypeProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) (PBYTE)pre->szMessage); } -int __cdecl CSkypeProto::RecvFile(HCONTACT hContact, PROTORECVFILET* pre) +int __cdecl CSkypeProto::RecvFile(MCONTACT hContact, PROTORECVFILET* pre) { this->debugLogW(L"Incoming file transfer"); ::db_unset(hContact, "CList", "Hidden"); return ::Proto_RecvFile(hContact, pre); } -int __cdecl CSkypeProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CSkypeProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { this->debugLogW(L"Incoming message"); ::db_unset(hContact, "CList", "Hidden"); @@ -401,9 +401,9 @@ int __cdecl CSkypeProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) (PBYTE)message); } -int __cdecl CSkypeProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT *) { return 0; } +int __cdecl CSkypeProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT *) { return 0; } -int __cdecl CSkypeProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CSkypeProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { if (this->IsOnline() && hContact && hContactsList) { @@ -454,7 +454,7 @@ int __cdecl CSkypeProto::SendContacts(HCONTACT hContact, int flags, int nContact return 0; } -HANDLE __cdecl CSkypeProto::SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles) +HANDLE __cdecl CSkypeProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles) { if (this->IsOnline() && hContact && ppszFiles) { @@ -525,7 +525,7 @@ HANDLE __cdecl CSkypeProto::SendFile(HCONTACT hContact, const TCHAR *szDescripti return 0; } -int __cdecl CSkypeProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int __cdecl CSkypeProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { this->debugLogW(L"Outcoming message"); SEStringList targets; @@ -546,9 +546,9 @@ int __cdecl CSkypeProto::SendMsg(HCONTACT hContact, int flags, const char *msg) return 0; } -int __cdecl CSkypeProto::SendUrl(HCONTACT hContact, int flags, const char *url) { return 0; } +int __cdecl CSkypeProto::SendUrl(MCONTACT hContact, int flags, const char *url) { return 0; } -int __cdecl CSkypeProto::SetApparentMode(HCONTACT hContact, int mode) { return 0; } +int __cdecl CSkypeProto::SetApparentMode(MCONTACT hContact, int mode) { return 0; } int CSkypeProto::SetStatus(int new_status) { @@ -613,11 +613,11 @@ int CSkypeProto::SetStatus(int new_status) return 0; } -HANDLE __cdecl CSkypeProto::GetAwayMsg(HCONTACT hContact) { return 0; } -int __cdecl CSkypeProto::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 0; } +HANDLE __cdecl CSkypeProto::GetAwayMsg(MCONTACT hContact) { return 0; } +int __cdecl CSkypeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 0; } int __cdecl CSkypeProto::SetAwayMsg(int m_iStatus, const TCHAR *msg) { return 0; } -int __cdecl CSkypeProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CSkypeProto::UserIsTyping(MCONTACT hContact, int type) { if (hContact && this->IsOnline() && this->m_iStatus != ID_STATUS_INVISIBLE) { diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 972d450e0f..3e009ea67b 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -26,12 +26,12 @@ struct ContactParam struct BlockParam { - HCONTACT hContact; + MCONTACT hContact; CSkypeProto *ppro; bool remove; bool abuse; - BlockParam(HCONTACT hContact, CSkypeProto *ppro) : ppro(ppro) + BlockParam(MCONTACT hContact, CSkypeProto *ppro) : ppro(ppro) { this->hContact = hContact; } @@ -179,23 +179,23 @@ public: ~CSkypeProto(); // PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath ); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const TCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const TCHAR* email ); @@ -203,24 +203,24 @@ public: virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET* ); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles ); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode ); virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact ); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt ); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact ); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt ); virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg ); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); @@ -228,7 +228,7 @@ public: static CSkypeProto* InitSkypeProto(const char* protoName, const wchar_t* userName); static int UninitSkypeProto(CSkypeProto* ppro); - static CSkypeProto* GetContactInstance(HCONTACT hContact); + static CSkypeProto* GetContactInstance(MCONTACT hContact); static void UninitInstances(); // icons @@ -321,9 +321,9 @@ protected: INT_PTR __cdecl SetMyNickName(WPARAM, LPARAM); // avatars - bool IsAvatarChanged(const SEBinary &avatar, HCONTACT hContact = NULL); + bool IsAvatarChanged(const SEBinary &avatar, MCONTACT hContact = NULL); - wchar_t* GetContactAvatarFilePath(HCONTACT hContact); + wchar_t* GetContactAvatarFilePath(MCONTACT hContact); INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM); INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM); @@ -338,7 +338,7 @@ protected: void OnMessageReceived(const ConversationRef &conversation, const MessageRef &message); void SyncMessageHystory(const ConversationRef &conversation, const time_t timestamp); - void SyncHistoryCommand(HCONTACT hContact, time_t timestamp); + void SyncHistoryCommand(MCONTACT hContact, time_t timestamp); int __cdecl SyncLastDayHistoryCommand(WPARAM wParam, LPARAM lParam); int __cdecl SyncLastWeekHistoryCommand(WPARAM wParam, LPARAM lParam); int __cdecl SyncLastMonthHistoryCommand(WPARAM wParam, LPARAM lParam); @@ -366,14 +366,14 @@ protected: void UpdateChatUserStatus(const ContactRef &contact); void UpdateChatUserNick(const ContactRef &contact); - void ChatValidateContact(HCONTACT hItem, HWND hwndList, const StringList &contacts); - void ChatPrepare(HCONTACT hItem, HWND hwndList, const StringList &contacts); + void ChatValidateContact(MCONTACT hItem, HWND hwndList, const StringList &contacts); + void ChatPrepare(MCONTACT hItem, HWND hwndList, const StringList &contacts); - void GetInvitedContacts(HCONTACT hItem, HWND hwndList, StringList &invitedContacts); + void GetInvitedContacts(MCONTACT hItem, HWND hwndList, StringList &invitedContacts); void ChatRoomParseUriComands(const wchar_t *commands); - void ChatRoomInvite(HCONTACT hContact); + void ChatRoomInvite(MCONTACT hContact); void CloseAllChatSessions(); @@ -391,11 +391,11 @@ protected: OBJLIST chatRooms; // contacts - void UpdateContactAuthState(HCONTACT hContact, const ContactRef &contact); - void UpdateContactStatus(HCONTACT hContact, const ContactRef &contact); - void UpdateContactClient(HCONTACT hContact, const ContactRef &contact); - void UpdateContactOnlineSinceTime(HCONTACT hContact, const ContactRef &contact); - void UpdateContactLastEventDate(HCONTACT hContact, const ContactRef &contact); + void UpdateContactAuthState(MCONTACT hContact, const ContactRef &contact); + void UpdateContactStatus(MCONTACT hContact, const ContactRef &contact); + void UpdateContactClient(MCONTACT hContact, const ContactRef &contact); + void UpdateContactOnlineSinceTime(MCONTACT hContact, const ContactRef &contact); + void UpdateContactLastEventDate(MCONTACT hContact, const ContactRef &contact); void OnSearchCompleted(HANDLE hSearch); void OnContactFinded(CContact::Ref contact, HANDLE hSearch); @@ -403,12 +403,12 @@ protected: void OnContactChanged(const ContactRef &contact, int prop); void OnContactListChanged(const ContactRef &contact); - bool IsProtoContact(HCONTACT hContact); - HCONTACT GetContactBySid(const wchar_t* sid); - HCONTACT GetContactFromAuthEvent(HANDLE hEvent); - HCONTACT AddContact(CContact::Ref contact, bool isTemporary = false); + bool IsProtoContact(MCONTACT hContact); + MCONTACT GetContactBySid(const wchar_t* sid); + MCONTACT GetContactFromAuthEvent(HANDLE hEvent); + MCONTACT AddContact(CContact::Ref contact, bool isTemporary = false); - bool IsContactOnline(HCONTACT hContact); + bool IsContactOnline(MCONTACT hContact); void SetAllContactStatus(int status); void __cdecl LoadContactList(void*); @@ -420,25 +420,25 @@ protected: void __cdecl SearchByEmailAsync(void*); // profile - void UpdateProfileAvatar(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileAboutText(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileBirthday(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileCity(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileCountry(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileEmails(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileFullName(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileGender(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileHomepage(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileLanguages(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileMobilePhone(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileNick(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfilePhone(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileOfficePhone(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileState(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileStatusMessage(SEObject *obj, HCONTACT hContact = NULL); - void UpdateProfileTimezone(SEObject *obj, HCONTACT hContact = NULL); - - void UpdateProfile(SEObject *obj, HCONTACT hContact = NULL); + void UpdateProfileAvatar(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileAboutText(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileBirthday(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileCity(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileCountry(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileEmails(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileFullName(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileGender(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileHomepage(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileLanguages(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileMobilePhone(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileNick(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfilePhone(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileOfficePhone(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileState(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileStatusMessage(SEObject *obj, MCONTACT hContact = NULL); + void UpdateProfileTimezone(SEObject *obj, MCONTACT hContact = NULL); + + void UpdateProfile(SEObject *obj, MCONTACT hContact = NULL); void __cdecl LoadOwnInfo(void*); @@ -456,8 +456,8 @@ protected: static bool FileExists(wchar_t *path); - static void ShowNotification(const wchar_t *message, int flags = 0, HCONTACT hContact = NULL); - static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, HCONTACT hContact = NULL); + static void ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL); + static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL); static void CopyToClipboard(const wchar_t *text); @@ -472,7 +472,7 @@ protected: // int SendBroadcast(int type, int result, HANDLE hProcess, LPARAM lParam); - int SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam); + int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam); HANDLE CreateEvent(const char* szService); @@ -514,11 +514,11 @@ protected: static LRESULT CALLBACK SkypeBlockedOptionsSubProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); // database - bool IsMessageInDB(HCONTACT hContact, DWORD timestamp, SEBinary &guid, int flag = 0); + bool IsMessageInDB(MCONTACT hContact, DWORD timestamp, SEBinary &guid, int flag = 0); - HANDLE AddDBEvent(HCONTACT hContact, WORD type, DWORD time, DWORD flags = 0, DWORD cbBlob = 0, PBYTE pBlob = 0); + HANDLE AddDBEvent(MCONTACT hContact, WORD type, DWORD time, DWORD flags = 0, DWORD cbBlob = 0, PBYTE pBlob = 0); void RaiseMessageSentEvent( - HCONTACT hContact, + MCONTACT hContact, DWORD timestamp, SEBinary &guid, const char *message, diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index e95287b65b..f8c410513d 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -243,7 +243,7 @@ void CSkypeProto::InitLanguages() // --- -int CSkypeProto::SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) +int CSkypeProto::SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { return ::ProtoBroadcastAck(this->m_szModuleName, hContact, type, result, hProcess, lParam); } @@ -285,7 +285,7 @@ int CSkypeProto::SkypeToMirandaLoginError(CAccount::LOGOUTREASON logoutReason) return loginError; } -void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, HCONTACT hContact) +void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact) { if (::Miranda_Terminated()) return; @@ -305,7 +305,7 @@ void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *messag ::MessageBoxW(NULL, message, caption, MB_OK | flags); } -void CSkypeProto::ShowNotification(const wchar_t *message, int flags, HCONTACT hContact) +void CSkypeProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) { CSkypeProto::ShowNotification(::TranslateT(MODULE), message, flags, hContact); } diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index 127f962792..ecc6902397 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -151,7 +151,7 @@ CLISTMENUITEM ChatInitItem(void) { return mi; } -HANDLE add_contextmenu(HCONTACT hContact) { +HANDLE add_contextmenu(MCONTACT hContact) { CLISTMENUITEM mi; UNREFERENCED_PARAMETER(hContact); @@ -225,8 +225,8 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { if (!strcmp(szProto, SKYPE_PROTONAME)) { if (!HasVoiceService()) { - if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { - if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)) + if (!db_get((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)) mi=ResumeCallItem(); else mi=HoldCallItem(); mi.flags=CMIM_ALL; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi); @@ -237,7 +237,7 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { db_free(&dbv); } else { callAvailable = TRUE; hangupAvailable = FALSE; } - if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) { + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) { callAvailable = FALSE; hangupAvailable = FALSE; } @@ -259,7 +259,7 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { // File sending and groupchat-creation works starting with protocol version 5 if (protocol>=5) { mi=FileTransferItem(); - if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) mi.flags ^= CMIF_HIDDEN; mi.flags |= CMIM_FLAGS; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuFileTransferItem,(LPARAM)&mi); @@ -268,19 +268,19 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { if (protocol>=5 || bIsImoproxy) { mi=ChatInitItem(); if (db_get_b(NULL, SKYPE_PROTONAME, "UseGroupchat", 0) && - db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) + db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) mi.flags ^= CMIF_HIDDEN; mi.flags |= CMIM_FLAGS; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem,(LPARAM)&mi); } } else if (bSkypeOut) { - if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (!db_get((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { mi=SkypeOutHupItem(); db_free(&dbv); } else { mi=SkypeOutCallItem(); - if(!db_get((HCONTACT)wParam,"UserInfo","MyPhone0",&dbv)) { + if(!db_get((MCONTACT)wParam,"UserInfo","MyPhone0",&dbv)) { db_free(&dbv); mi.flags=0; } @@ -306,13 +306,13 @@ int ClistDblClick(WPARAM wParam, LPARAM lParam) { } */ -HCONTACT find_contact(char *name) +MCONTACT find_contact(char *name) { int tCompareResult; DBVARIANT dbv; // already on list? - for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) { char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 ); if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0) @@ -327,13 +327,13 @@ HCONTACT find_contact(char *name) return NULL; } -HCONTACT find_contactT(TCHAR *name) +MCONTACT find_contactT(TCHAR *name) { int tCompareResult; DBVARIANT dbv; // already on list? - for (HCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) + for (MCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) { char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 ); if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0) @@ -349,9 +349,9 @@ HCONTACT find_contactT(TCHAR *name) } -HCONTACT add_contact(char *name, DWORD flags) +MCONTACT add_contact(char *name, DWORD flags) { - HCONTACT hContact; + MCONTACT hContact; // already on list? if (hContact=find_contact(name)) { @@ -365,7 +365,7 @@ HCONTACT add_contact(char *name, DWORD flags) // no, so add LOG(("add_contact: Adding %s", name)); - hContact=(HCONTACT)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0); + hContact=(MCONTACT)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { if (CallServiceSync(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)SKYPE_PROTONAME)!=0) { LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason")); @@ -387,7 +387,7 @@ HCONTACT add_contact(char *name, DWORD flags) } void logoff_contacts(BOOL bCleanup) { - HCONTACT hContact; + MCONTACT hContact; char *szProto; DBVARIANT dbv={0}; diff --git a/protocols/SkypeClassic/src/contacts.h b/protocols/SkypeClassic/src/contacts.h index 1cc71571a5..5665b70a7b 100644 --- a/protocols/SkypeClassic/src/contacts.h +++ b/protocols/SkypeClassic/src/contacts.h @@ -1,10 +1,10 @@ // Prototypes -HANDLE add_contextmenu(HCONTACT hContact); +HANDLE add_contextmenu(MCONTACT hContact); HANDLE add_mainmenu(void); -HCONTACT find_contact(char *name); -HCONTACT find_contactT(TCHAR *name); -HCONTACT add_contact(char *name, DWORD flags); +MCONTACT find_contact(char *name); +MCONTACT find_contactT(TCHAR *name); +MCONTACT add_contact(char *name, DWORD flags); CLISTMENUITEM HupItem(void); CLISTMENUITEM CallItem(void); diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp index dd38a9d990..9e746244b6 100644 --- a/protocols/SkypeClassic/src/gchat.cpp +++ b/protocols/SkypeClassic/src/gchat.cpp @@ -112,7 +112,7 @@ gchat_contact *GetChatContact(gchat_contacts *gc, const TCHAR *who) { static int AddChatContact(gchat_contacts *gc, char *who, TCHAR *pszRole) { int i = -2; - HCONTACT hContact; + MCONTACT hContact; CONTACTINFO ci = {0}; TCHAR *twho; @@ -165,10 +165,10 @@ void RemChatContact(gchat_contacts *gc, const TCHAR *who) { } } -HCONTACT find_chat(LPCTSTR chatname) { +MCONTACT find_chat(LPCTSTR chatname) { char *szProto; int tCompareResult; - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { @@ -187,10 +187,10 @@ HCONTACT find_chat(LPCTSTR chatname) { } #ifdef _UNICODE -HCONTACT find_chatA(char *chatname) { +MCONTACT find_chatA(char *chatname) { char *szProto; int tCompareResult; - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { @@ -479,7 +479,7 @@ void KillChatSession(GCDEST *gcd) void InviteUser(const TCHAR *szChatId) { HMENU tMenu = CreatePopupMenu(); - HCONTACT hContact = db_find_first(), hInvitedUser; + MCONTACT hContact = db_find_first(), hInvitedUser; DBVARIANT dbv; HWND tWindow; POINT pt; @@ -516,7 +516,7 @@ void InviteUser(const TCHAR *szChatId) tWindow = CreateWindow(_T("EDIT"),_T(""),0,1,1,1,1,NULL,NULL,hInst,NULL); GetCursorPos (&pt); - hInvitedUser = (HCONTACT)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL); + hInvitedUser = (MCONTACT)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL); DestroyMenu(tMenu); DestroyWindow(tWindow); @@ -527,7 +527,7 @@ void InviteUser(const TCHAR *szChatId) } -static void KickUser (HCONTACT hContact, GCHOOK *gch) +static void KickUser (MCONTACT hContact, GCHOOK *gch) { char *ptr; @@ -566,7 +566,7 @@ static void KickUser (HCONTACT hContact, GCHOOK *gch) void SetChatTopic(const TCHAR *szChatId, TCHAR *szTopic, BOOL bSet) { - HCONTACT hContact = find_chat (szChatId); + MCONTACT hContact = find_chat (szChatId); char *szUTFTopic; GCDEST gcd = { SKYPE_PROTONAME, szChatId, GC_EVENT_TOPIC }; @@ -608,7 +608,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { switch (gch->pDest->iType) { case GC_SESSION_TERMINATE: { - HCONTACT hContact; + MCONTACT hContact; if (gc->mJoinedCount == 1) { // switch back to normal session @@ -691,7 +691,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { InviteUser(gch->pDest->ptszID); break; case GC_USER_PRIVMESS: { - HCONTACT hContact = find_contactT(gch->ptszUID); + MCONTACT hContact = find_contactT(gch->ptszUID); if (hContact) CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); break; @@ -714,7 +714,7 @@ int GCEventHook(WPARAM wParam,LPARAM lParam) { } break; case GC_USER_NICKLISTMENU: { - HCONTACT hContact = find_contactT(gch->ptszUID); + MCONTACT hContact = find_contactT(gch->ptszUID); switch(gch->dwData) { case 10:CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break; @@ -821,7 +821,7 @@ int __cdecl GCMenuHook(WPARAM wParam,LPARAM lParam) { INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; UNREFERENCED_PARAMETER(lParam); @@ -837,7 +837,7 @@ INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam) INT_PTR GCOnJoinChat(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; UNREFERENCED_PARAMETER(lParam); diff --git a/protocols/SkypeClassic/src/gchat.h b/protocols/SkypeClassic/src/gchat.h index 13ef26afe6..91dcef43f4 100644 --- a/protocols/SkypeClassic/src/gchat.h +++ b/protocols/SkypeClassic/src/gchat.h @@ -12,7 +12,7 @@ #define MAX_BUF 256 // Buffer for topic-string typedef struct { - HCONTACT hContact; + MCONTACT hContact; TCHAR who[33]; TCHAR szRole[12]; } gchat_contact; @@ -26,9 +26,9 @@ typedef struct { int ChatInit(WPARAM, LPARAM); int __cdecl ChatStart(char *szChatId, BOOL bJustCreate); gchat_contacts *GetChat(LPCTSTR szChatId); -HCONTACT find_chat(LPCTSTR chatname); +MCONTACT find_chat(LPCTSTR chatname); #ifdef _UNICODE -HCONTACT find_chatA(char *chatname); +MCONTACT find_chatA(char *chatname); #else #define find_chatA find_chat #endif diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 3a6b431f96..5acdb42d43 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -123,7 +123,7 @@ typedef struct { } fetchmsg_arg; typedef struct { - HCONTACT hContact; + MCONTACT hContact; char szId[16]; } msgsendwt_arg; @@ -266,7 +266,7 @@ int HookContactAdded(WPARAM wParam, LPARAM lParam) { szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME)) - add_contextmenu((HCONTACT)wParam); + add_contextmenu((MCONTACT)wParam); return 0; } @@ -280,7 +280,7 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; int retval; - if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1; + if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1; retval=SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal); db_free(&dbv); if (retval) return 1; @@ -304,7 +304,7 @@ void GetInfoThread(void *hContact) LOG (("GetInfoThread started.")); EnterCriticalSection (&QueryThreadMutex); - if (db_get_s((HCONTACT)hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) + if (db_get_s((MCONTACT)hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) { LOG (("GetInfoThread terminated, cannot find Skype Name for contact %08X.", hContact)); LeaveCriticalSection (&QueryThreadMutex); @@ -320,7 +320,7 @@ void GetInfoThread(void *hContact) if (ptr=SkypeGet ("USER", dbv.pszVal, "FULLNAME")) { if (*ptr && !bSetNick && db_get_b(NULL, SKYPE_PROTONAME, "ShowFullname", 1)) { // No Displayname and FULLNAME requested - db_set_utf((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", ptr); + db_set_utf((MCONTACT)hContact, SKYPE_PROTONAME, "Nick", ptr); bSetNick = TRUE; } free (ptr); @@ -328,7 +328,7 @@ void GetInfoThread(void *hContact) if (!bSetNick) { // Still no nick set, so use SKYPE Nickname - db_set_s((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal); + db_set_s((MCONTACT)hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal); } @@ -345,7 +345,7 @@ void GetInfoThread(void *hContact) ACKDATA ack = {0}; ack.cbSize = sizeof( ACKDATA ); ack.szModule = SKYPE_PROTONAME; - ack.hContact = (HCONTACT)hContact; + ack.hContact = (MCONTACT)hContact; ack.type = ACKTYPE_AVATAR; ack.result = ACKRESULT_STATUS; @@ -359,7 +359,7 @@ void GetInfoThread(void *hContact) if (ptr=SkypeGet ("USER", dbv.pszVal, m_settings[i].SkypeSetting)) free (ptr); } - ProtoBroadcastAck(SKYPE_PROTONAME, (HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0); + ProtoBroadcastAck(SKYPE_PROTONAME, (MCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0); LeaveCriticalSection(&QueryThreadMutex); db_free(&dbv); LOG (("GetInfoThread terminated gracefully.")); @@ -449,11 +449,11 @@ INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) { - if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0; + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) { + if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0; SkypeSend ("GET CHAT %s CHATMESSAGES", dbv.pszVal); } else { - if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0; + if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0; SkypeSend("SEARCH %sS %s", cmdMessage, dbv.pszVal); } db_free(&dbv); @@ -501,7 +501,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) { while (token) { CCSDATA ccs={0}; PROTORECVEVENT pre={0}; - HCONTACT hContact; + MCONTACT hContact; char *firstname=NULL, *lastname=NULL, *pCurBlob; LOG(("Awaiting auth: %s", token)); @@ -513,7 +513,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) { pre.timestamp=(DWORD)SkypeTime(NULL); /* blob is: */ - //DWORD protocolSpecific HCONTACT hContact + //DWORD protocolSpecific MCONTACT hContact //ASCIIZ nick, firstName, lastName, e-mail, requestReason if (firstname=SkypeGet("USER", token, "FULLNAME")) if (lastname=strchr(firstname, ' ')) { @@ -872,7 +872,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { DWORD timestamp = 0, lwr=0; CCSDATA ccs={0}; PROTORECVEVENT pre={0}; - HCONTACT hContact = NULL, hChat = NULL; + MCONTACT hContact = NULL, hChat = NULL; HANDLE hDbEvent; DBEVENTINFO dbei={0}; DBVARIANT dbv={0}; @@ -1309,7 +1309,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (db_get_b(hContact, "MetaContacts", "IsSubcontact", 0)) { DWORD dwMetaLink = db_get_dw(hContact, "MetaContacts", "MetaLink", MAXDWORD); - HCONTACT hMetaContact; + MCONTACT hMetaContact; if (dwMetaLink != MAXDWORD && (hMetaContact = GetMetaHandle(dwMetaLink))) { @@ -1364,8 +1364,8 @@ void FetchMessageThreadSync(fetchmsg_arg *pargs) { /* if (pargs->bIsRead && pMsgEvent->hEvent != INVALID_HANDLE_VALUE) { - HCONTACT hContact; - if ((int)(hContact = (HCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1) + MCONTACT hContact; + if ((int)(hContact = (MCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1) CallService (MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDBEvent); } */ @@ -1419,10 +1419,10 @@ char *GetCallerHandle(char *szSkypeMsg) { } -HCONTACT GetCallerContact(char *szSkypeMsg) +MCONTACT GetCallerContact(char *szSkypeMsg) { char *szHandle; - HCONTACT hContact=NULL; + MCONTACT hContact=NULL; if (!(szHandle=GetCallerHandle(szSkypeMsg))) return NULL; if (!(hContact=find_contact(szHandle))) { @@ -1442,9 +1442,9 @@ HCONTACT GetCallerContact(char *szSkypeMsg) return hContact; } -HCONTACT GetMetaHandle(DWORD dwId) +MCONTACT GetMetaHandle(DWORD dwId) { - for (HCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) { + for (MCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) { char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 ); if (szProto!=NULL && !strcmp(szProto, "MetaContacts") && db_get_dw(hContact, "MetaContacts", "MetaID", MAXDWORD)==dwId) @@ -1478,7 +1478,7 @@ LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) } void RingThread(char *szSkypeMsg) { - HCONTACT hContact; + MCONTACT hContact; DBEVENTINFO dbei={0}; DBVARIANT dbv; char *ptr = NULL; @@ -1606,7 +1606,7 @@ l_exitRT: } void EndCallThread(char *szSkypeMsg) { - HCONTACT hContact=NULL; + MCONTACT hContact=NULL; HANDLE hDbEvent; DBEVENTINFO dbei={0}; DBVARIANT dbv; @@ -1669,7 +1669,7 @@ void EndCallThread(char *szSkypeMsg) { } void HoldCallThread(char *szSkypeMsg) { - HCONTACT hContact; + MCONTACT hContact; LOG(("HoldCallThread started")); if (!szSkypeMsg) { @@ -1685,7 +1685,7 @@ void HoldCallThread(char *szSkypeMsg) { } void ResumeCallThread(char *szSkypeMsg) { - HCONTACT hContact; + MCONTACT hContact; LOG(("ResumeCallThread started")); if (!szSkypeMsg) { @@ -1743,7 +1743,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) static char *onlinestatus=NULL; static BOOL RestoreUserStatus=FALSE; int sstat, oldstatus, flag; - HCONTACT hContact; + MCONTACT hContact; fetchmsg_arg *args; static int iReentranceCnt = 0; @@ -2091,7 +2091,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) } else if (strncmp(ptr, " FRIENDLYNAME ", 14) == 0) { // Chat session name - HCONTACT hContact; + MCONTACT hContact; *ptr=0; if (hContact = find_chatA(szSkypeMsg+5)) @@ -2359,7 +2359,7 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam) return iRet; } -int __stdcall SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) +int __stdcall SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { ACKDATA ack = { sizeof( ACKDATA ) }; ack.szModule = SKYPE_PROTONAME; @@ -2374,11 +2374,11 @@ int __stdcall SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hPro static void __cdecl SkypeGetAwayMessageThread(void *hContact) { DBVARIANT dbv; - if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv )) { - SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal ); + if (!db_get_ts((MCONTACT)hContact, "CList", "StatusMsg", &dbv )) { + SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal ); db_free( &dbv ); } - else SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 ); + else SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 ); } INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam) @@ -2449,7 +2449,7 @@ static int _GetFileSize(char* filename) */ void RetrieveUserAvatar(void *param) { - HCONTACT hContact = (HCONTACT) param; + MCONTACT hContact = (MCONTACT) param; HANDLE file; PROTO_AVATAR_INFORMATION AI={0}; ACKDATA ack = {0}; @@ -2777,7 +2777,7 @@ INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam) INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv={0}; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (protocol<5 && !bIsImoproxy) return 0; if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv)) { @@ -2893,7 +2893,7 @@ INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam) { if (pBlob=__skypeauth(wParam)) { - HCONTACT hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam)); + MCONTACT hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam)); free(pBlob); if (hContact) return (int)hContact; } @@ -2914,7 +2914,7 @@ INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam) { void CleanupNicknames(char *dummy) { - HCONTACT hContact; + MCONTACT hContact; char *szProto; DBVARIANT dbv, dbv2; @@ -3014,7 +3014,7 @@ int EnumOldPluginName(const char *szSetting,LPARAM lParam) // 0 --> No int AnySkypeusers(void) { - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; int tCompareResult; @@ -3039,7 +3039,7 @@ int AnySkypeusers(void) DBCONTACTENUMSETTINGS cns; DBCONTACTWRITESETTING cws; DBVARIANT dbv; - HCONTACT hContact=NULL; + MCONTACT hContact=NULL; struct PLUGINDI pdi; LOG(("Updating old database settings if there are any...")); diff --git a/protocols/SkypeClassic/src/skype.h b/protocols/SkypeClassic/src/skype.h index 83021b91c6..5cd87986dd 100644 --- a/protocols/SkypeClassic/src/skype.h +++ b/protocols/SkypeClassic/src/skype.h @@ -172,7 +172,7 @@ int __stdcall EnterBitmapFileName( char* szDest ); void CleanupNicknames(char *dummy); int InitVSApi(); int FreeVSApi(); -HCONTACT GetMetaHandle(DWORD dwId); +MCONTACT GetMetaHandle(DWORD dwId); void LaunchSkypeAndSetStatusThread(void *newStatus); // Structs diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index 310d26b975..1534a3530a 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -413,7 +413,7 @@ char *SkypeRcv(char *what, DWORD maxwait) return SkypeRcvTime(what, 0, maxwait); } -char *SkypeRcvMsg(char *what, time_t st, HCONTACT hContact, DWORD maxwait) +char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) { char *msg, msgid[32]={0}, *pMsg, *pCurMsg; struct MsgQueue *ptr; @@ -612,10 +612,10 @@ INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam) { char *msg=0; int res; - if (!db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (!db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { res = -1; // no direct return, because dbv needs to be freed } else { - if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1; + if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1; msg=(char *)malloc(strlen(dbv.pszVal)+6); strcpy(msg, "CALL "); strcat(msg, dbv.pszVal); @@ -644,13 +644,13 @@ INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam) char *msg=0; int res = -1; - if (!db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (!db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { msg=(char *)malloc(strlen(dbv.pszVal)+21); sprintf(msg, "SET %s STATUS FINISHED", dbv.pszVal); //sprintf(msg, "ALTER CALL %s HANGUP", dbv.pszVal); res=SkypeSend(msg); #if _DEBUG - db_unset((HCONTACT)wParam, SKYPE_PROTONAME, "CallId"); + db_unset((MCONTACT)wParam, SKYPE_PROTONAME, "CallId"); #endif //} else { // if (db_get((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1; @@ -686,14 +686,14 @@ static void FixNumber(char *p) { * Purpose: Dialog procedure for the Dial-Dialog */ static INT_PTR CALLBACK DialDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static HCONTACT hContact; + static MCONTACT hContact; static unsigned int entries=0; BOOL TempAdded=FALSE; char number[64], *msg, *ptr=NULL; switch (uMsg){ case WM_INITDIALOG: - hContact=(HCONTACT)lParam; + hContact=(MCONTACT)lParam; Utils_RestoreWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "DIALdlg"); TranslateDialogDefault(hwndDlg); @@ -810,14 +810,14 @@ static INT_PTR CALLBACK CallstatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, switch (uMsg){ case WM_INITDIALOG: { - HCONTACT hContact; + MCONTACT hContact; - if (!db_get_s((HCONTACT)lParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (!db_get_s((MCONTACT)lParam, SKYPE_PROTONAME, "CallId", &dbv)) { // Check, if another call is in progress for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 ); - if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && hContact != (HCONTACT)lParam && + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && hContact != (MCONTACT)lParam && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0 && !db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv2)) { @@ -927,7 +927,7 @@ INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; int res = -1; - if (wParam && !db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (wParam && !db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { res=SkypeSend("SET %s STATUS FINISHED", dbv.pszVal); pthread_create(( pThreadFunc )SkypeOutCallErrorCheck, _strdup(dbv.pszVal)); db_free(&dbv); @@ -947,10 +947,10 @@ INT_PTR SkypeHoldCall(WPARAM wParam, LPARAM lParam) { int retval; LOG(("SkypeHoldCall started")); - if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) + if (!wParam || db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) return -1; retval = SkypeSend ("SET %s STATUS %s", dbv.pszVal, - db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD"); + db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD"); db_free(&dbv); return retval; } @@ -1145,7 +1145,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; int retval; - if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) + if (!wParam || db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1; retval=SkypeSend("OPEN FILETRANSFER %s", dbv.pszVal); db_free(&dbv); @@ -1162,7 +1162,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) { */ INT_PTR SkypeChatCreate(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - HCONTACT hContact=(HCONTACT)wParam; + MCONTACT hContact=(MCONTACT)wParam; char *ptr, *ptr2; if (!hContact || db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) diff --git a/protocols/SkypeClassic/src/skypeapi.h b/protocols/SkypeClassic/src/skypeapi.h index 0d3f661dcb..aaff523921 100644 --- a/protocols/SkypeClassic/src/skypeapi.h +++ b/protocols/SkypeClassic/src/skypeapi.h @@ -28,7 +28,7 @@ char *SkypeMsgGet(void); int SkypeSend(char*, ...); char *SkypeRcv(char *what, DWORD maxwait); char *SkypeRcvTime(char *what, time_t st, DWORD maxwait); -char *SkypeRcvMsg(char *what, time_t st, HCONTACT hContact, DWORD maxwait); +char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait); INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam); INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam); INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam); diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 8b90c78780..42e4f79423 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -159,7 +159,7 @@ INT_PTR CALLBACK OptPopupDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar { case IDC_PREVIEW: { - HCONTACT hContact; + MCONTACT hContact; TCHAR * lpzContactName; hContact = db_find_first(); @@ -750,7 +750,7 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L int OnDetailsInit( WPARAM wParam, LPARAM lParam ) { OPTIONSDIALOGPAGE odp = {0}; - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; odp.cbSize = sizeof(odp); odp.hIcon = NULL; diff --git a/protocols/SkypeClassic/src/voiceservice.cpp b/protocols/SkypeClassic/src/voiceservice.cpp index 93181d0d4c..f5e97f3a53 100644 --- a/protocols/SkypeClassic/src/voiceservice.cpp +++ b/protocols/SkypeClassic/src/voiceservice.cpp @@ -20,7 +20,7 @@ BOOL HasVoiceService() return has_voice_service; } -void NofifyVoiceService(HCONTACT hContact, char *callId, int state) +void NofifyVoiceService(MCONTACT hContact, char *callId, int state) { VOICE_CALL vc = {0}; vc.cbSize = sizeof(vc); @@ -40,9 +40,9 @@ static INT_PTR VoiceGetInfo(WPARAM wParam, LPARAM lParam) return VOICE_SUPPORTED | VOICE_CALL_CONTACT | VOICE_CAN_HOLD; } -static HCONTACT FindContactByCallId(char *callId) +static MCONTACT FindContactByCallId(char *callId) { - HCONTACT hContact; + MCONTACT hContact; int iCmpRes; for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { char *szProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); @@ -71,7 +71,7 @@ static INT_PTR VoiceCall(WPARAM wParam, LPARAM lParam) if (!wParam) return -1; - if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) + if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1; SkypeSend("CALL %s", dbv.pszVal); diff --git a/protocols/SkypeClassic/src/voiceservice.h b/protocols/SkypeClassic/src/voiceservice.h index fce03545d2..df1a016100 100644 --- a/protocols/SkypeClassic/src/voiceservice.h +++ b/protocols/SkypeClassic/src/voiceservice.h @@ -10,7 +10,7 @@ BOOL HasVoiceService(); void VoiceServiceInit(); void VoiceServiceExit(); void VoiceServiceModulesLoaded(); -void NofifyVoiceService(HCONTACT hContact, char *callId, int state) ; +void NofifyVoiceService(MCONTACT hContact, char *callId, int state) ; diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 377d52f43c..bc9cde59f4 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -114,7 +114,7 @@ static void TlenRegisterIcons() int TlenProtocol::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && isOnline) { DBVARIANT dbv; if (!db_get(hContact, m_szModuleName, "jid", &dbv)) { @@ -140,7 +140,7 @@ int TlenProtocol::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) INT_PTR TlenProtocol::ContactMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && isOnline) { DBVARIANT dbv; if (!db_get(hContact, m_szModuleName, "jid", &dbv)) { @@ -153,7 +153,7 @@ INT_PTR TlenProtocol::ContactMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) INT_PTR TlenProtocol::ContactMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && isOnline) { DBVARIANT dbv; if (!db_get(hContact, m_szModuleName, "jid", &dbv)) { @@ -166,7 +166,7 @@ INT_PTR TlenProtocol::ContactMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) INT_PTR TlenProtocol::ContactMenuHandleSendPicture(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact != NULL && isOnline) SendPicture(this, hContact); @@ -241,7 +241,7 @@ int TlenProtocol::OnModulesLoaded(WPARAM wParam, LPARAM lParam) char str[128]; /* Set all contacts to offline */ - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) if (db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) db_set_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE); diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h index 1096210110..b914fbc6f3 100644 --- a/protocols/Tlen/src/tlen.h +++ b/protocols/Tlen/src/tlen.h @@ -218,23 +218,23 @@ struct TlenProtocol : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - 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 HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email); @@ -242,24 +242,24 @@ struct TlenProtocol : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); @@ -381,7 +381,7 @@ typedef struct ThreadDataStruct{ typedef enum { FT_CONNECTING, FT_INITIALIZING, FT_RECEIVING, FT_DONE, FT_ERROR, FT_DENIED, FT_SWITCH } TLEN_FILE_STATE; typedef enum { FT_RECV, FT_SEND} TLEN_FILE_MODE; typedef struct TLEN_FILE_TRANSFER_STRUCT{ - HCONTACT hContact; + MCONTACT hContact; HANDLE s; NETLIBNEWCONNECTIONPROC_V2 pfnNewConnectionV2; TLEN_FILE_STATE state; @@ -466,8 +466,8 @@ void TlenSerialInit(TlenProtocol *proto); void TlenSerialUninit(TlenProtocol *proto); unsigned int TlenSerialNext(TlenProtocol *proto); int TlenSend(TlenProtocol *proto, const char *fmt, ...); -HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid); -char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact); +MCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid); +char *TlenJIDFromHContact(TlenProtocol *proto, MCONTACT hContact); char *TlenLoginFromJID(const char *jid); char *TlenResourceFromJID(const char *jid); char *TlenNickFromJID(const char *jid); @@ -481,7 +481,7 @@ void TlenUrlDecode(char *str); char *TlenUrlEncode(const char *str); char *TlenTextEncode(const char *str); char *TlenTextDecode(const char *str); -void TlenLogMessage(TlenProtocol *proto, HCONTACT hContact, DWORD flags, const char *message); +void TlenLogMessage(TlenProtocol *proto, MCONTACT hContact, DWORD flags, const char *message); BOOL IsAuthorized(TlenProtocol *proto, const char *jid); //char *TlenGetVersionText(); time_t TlenIsoToUnixTime(char *stamp); @@ -490,9 +490,9 @@ void TlenSendPresence(TlenProtocol *proto,int status); void TlenStringAppend(char **str, int *sizeAlloced, const char *fmt, ...); //char *TlenGetClientJID(char *jid); // tlen_misc.cpp -void TlenDBAddEvent(TlenProtocol *proto, HCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob); +void TlenDBAddEvent(TlenProtocol *proto, MCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob); void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick); -HCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary); +MCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary); // tlen_svc.cpp int TlenRunSearch(TlenProtocol *proto); // tlen_opt.cpp diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index f413b277ec..b75ac787ba 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -64,7 +64,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts mir_sntprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S_avatar%s"), proto->m_szModuleName, tszFileType); } -static void RemoveAvatar(TlenProtocol *proto, HCONTACT hContact) { +static void RemoveAvatar(TlenProtocol *proto, MCONTACT hContact) { TCHAR tFileName[ MAX_PATH ]; if (hContact == NULL) { proto->threadData->avatarHash[0] = '\0'; @@ -77,7 +77,7 @@ static void RemoveAvatar(TlenProtocol *proto, HCONTACT hContact) { ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0); } -static void SetAvatar(TlenProtocol *proto, HCONTACT hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format) { +static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format) { TCHAR filename[MAX_PATH]; char md5[33]; mir_md5_state_t ctx; @@ -123,7 +123,7 @@ int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_IT XmlNode *aNode; char *oldHash = NULL; char *md5 = NULL, *type = NULL; - HCONTACT hContact; + MCONTACT hContact; hContact = NULL; if (item != NULL) { if ((hContact=TlenHContactFromJID(proto, item->jid)) == NULL) return 0; @@ -165,7 +165,7 @@ int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_IT } void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITEM *item) { - HCONTACT hContact; + MCONTACT hContact; if ((hContact=TlenHContactFromJID(proto, item->jid)) == NULL) return; TlenProcessAvatarNode(proto, TlenXmlGetChild(node, "avatar"), item); } @@ -225,7 +225,7 @@ static int getAvatarMutex = 0; typedef struct { TlenProtocol *proto; - HCONTACT hContact; + MCONTACT hContact; } TLENGETAVATARTHREADDATA; static void TlenGetAvatarThread(void *ptr) { @@ -234,7 +234,7 @@ static void TlenGetAvatarThread(void *ptr) { NETLIBHTTPREQUEST req; NETLIBHTTPREQUEST *resp; TLENGETAVATARTHREADDATA *data = (TLENGETAVATARTHREADDATA *)ptr; - HCONTACT hContact = data->hContact; + MCONTACT hContact = data->hContact; char *request; char *login = NULL; if (hContact != NULL) { @@ -301,7 +301,7 @@ static void TlenGetAvatarThread(void *ptr) { mir_free(data); } -void TlenGetAvatar(TlenProtocol *proto, HCONTACT hContact) { +void TlenGetAvatar(TlenProtocol *proto, MCONTACT hContact) { if (hContact == NULL) { if (getAvatarMutex != 0) { return; diff --git a/protocols/Tlen/src/tlen_avatar.h b/protocols/Tlen/src/tlen_avatar.h index c0bbfaa086..5de5d482a6 100644 --- a/protocols/Tlen/src/tlen_avatar.h +++ b/protocols/Tlen/src/tlen_avatar.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITEM *item); int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_ITEM *item); void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* psztDest, int cbLen); -void TlenGetAvatar(TlenProtocol *proto, HCONTACT hContact); +void TlenGetAvatar(TlenProtocol *proto, MCONTACT hContact); void TlenUploadAvatar(TlenProtocol *proto, unsigned char *data, int dataLen, int access); void TlenRemoveAvatar(TlenProtocol *proto); diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 74181bd9c3..450fc6c4a5 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -65,7 +65,7 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) { DBVARIANT dbv; XmlNode *itemNode, *groupNode; TLEN_LIST_ITEM *item; - HCONTACT hContact; + MCONTACT hContact; char *jid, *name, *nick; int i; char *str; @@ -165,7 +165,7 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) nick = TlenLocalNickFromJID(jid); if (nick != NULL) { - HCONTACT hContact; + MCONTACT hContact; item = TlenListAdd(proto, LIST_ROSTER, jid); if (item->nick) mir_free(item->nick); item->nick = nick; @@ -206,8 +206,8 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) // Delete orphaned contacts (if roster sync is enabled) if (db_get_b(NULL, proto->m_szModuleName, "RosterSync", FALSE) == TRUE) { - for (HCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; ) { - HCONTACT hNext = hContact = db_find_next(hContact, proto->m_szModuleName); + for (MCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; ) { + MCONTACT hNext = hContact = db_find_next(hContact, proto->m_szModuleName); ptrA jid( db_get_sa(hContact, proto->m_szModuleName, "jid")); if (jid != NULL) { if (!TlenListExist(proto, LIST_ROSTER, jid)) { @@ -241,7 +241,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) XmlNode *queryNode, *itemNode, *n; char *type, *jid; char text[128]; - HCONTACT hContact; + MCONTACT hContact; char *nText; // TlenLog(" iqIdGetVcard (tlen)"); @@ -561,7 +561,7 @@ void TlenIqResultVersion(TlenProtocol *proto, XmlNode *iqNode) if (( from=TlenXmlGetAttrValue( iqNode, "from" )) != NULL ) { TLEN_LIST_ITEM *item; if (( item=TlenListGetItemPtr( proto, LIST_ROSTER, from )) != NULL) { - HCONTACT hContact; + MCONTACT hContact; XmlNode *n; if ( item->software ) mir_free( item->software ); if ( item->version ) mir_free( item->version ); @@ -598,7 +598,7 @@ void TlenIqResultInfo(TlenProtocol *proto, XmlNode *iqNode) if (( from=TlenXmlGetAttrValue( queryNode, "from" )) != NULL ) { TLEN_LIST_ITEM *item; if (( item=TlenListGetItemPtr( proto, LIST_ROSTER, from )) != NULL) { - HCONTACT hContact; + MCONTACT hContact; XmlNode *version = TlenXmlGetChild(queryNode, "version"); item->protocolVersion = TlenTextDecode(version->text); if (( hContact=TlenHContactFromJID(proto, item->jid )) != NULL ) { diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp index 6aed4ecadc..2879edfb82 100644 --- a/protocols/Tlen/src/tlen_misc.cpp +++ b/protocols/Tlen/src/tlen_misc.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "tlen.h" #include "tlen_list.h" -void TlenDBAddEvent(TlenProtocol *proto, HCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob) +void TlenDBAddEvent(TlenProtocol *proto, MCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = proto->m_szModuleName; @@ -42,10 +42,10 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) PBYTE pCurBlob; PBYTE pBlob; DWORD cbBlob; - HCONTACT hContact; + MCONTACT hContact; if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) { - hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); // strip resource if present s = TlenLoginFromJID(jid); @@ -72,7 +72,7 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) TlenDBAddEvent(proto, NULL, EVENTTYPE_AUTHREQUEST, 0, pBlob, cbBlob); } -char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact) +char *TlenJIDFromHContact(TlenProtocol *proto, MCONTACT hContact) { char *p = NULL; DBVARIANT dbv; @@ -83,14 +83,14 @@ char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact) return p; } -HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid) +MCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid) { DBVARIANT dbv; char *p; if (jid == NULL) return NULL; - for (HCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; hContact = db_find_next(hContact, proto->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; hContact = db_find_next(hContact, proto->m_szModuleName)) { if ( db_get_s(hContact, proto->m_szModuleName, "jid", &dbv)) continue; @@ -106,14 +106,14 @@ HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid) return NULL; } -HCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary) +MCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary) { - HCONTACT hContact; + MCONTACT hContact; if (jid == NULL || jid[0] == '\0') return NULL; if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) { - hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); db_set_s(hContact, proto->m_szModuleName, "jid", jid); if (nick != NULL && nick[0] != '\0') diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index 05d609947c..31dc19bb4b 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -69,7 +69,7 @@ static int stringToHex(const char *str) static char *getDisplayName(TlenProtocol *proto, const char *id) { char jid[256]; - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) { mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal); @@ -101,7 +101,7 @@ BOOL TlenMUCInit(TlenProtocol *proto) int TlenProtocol::MUCHandleEvent(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact; + MCONTACT hContact; int id; MUCCEVENT *mucce=(MUCCEVENT *) lParam; if (!strcmp(mucce->pszModule, m_szModuleName)) { @@ -954,7 +954,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr) queryResult.iItemsNum = 0; - for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { + for (MCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { if ( db_get_b(hContact, szProto, "bChat", FALSE)) continue; @@ -970,7 +970,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr) memset(queryResult.pItems, 0, sizeof(MUCCQUERYITEM) * queryResult.iItemsNum); queryResult.iItemsNum = 0; - for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { + for (MCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { if ( db_get_b(hContact, szProto, "bChat", FALSE)) continue; @@ -1025,13 +1025,13 @@ INT_PTR TlenProtocol::MUCMenuHandleChats(WPARAM wParam, LPARAM lParam) INT_PTR TlenProtocol::MUCContactMenuHandleMUC(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; TLEN_LIST_ITEM *item; if (!isOnline) return 1; - if ((hContact=(HCONTACT)wParam) != NULL && isOnline) { + if ((hContact=(MCONTACT)wParam) != NULL && isOnline) { if (!db_get(hContact, m_szModuleName, "jid", &dbv)) { char serialId[32]; mir_snprintf(serialId, SIZEOF(serialId), TLEN_IQID"%d", TlenSerialNext(this)); diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index 7f3f769ef2..f97cc1fb78 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -254,7 +254,7 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) { mir_free(fromRaw); } -BOOL SendPicture(TlenProtocol *proto, HCONTACT hContact) { +BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { DBVARIANT dbv; if (!db_get(hContact, proto->m_szModuleName, "jid", &dbv)) { char *jid = dbv.pszVal; diff --git a/protocols/Tlen/src/tlen_picture.h b/protocols/Tlen/src/tlen_picture.h index a15922a5a4..50e3b0b1e6 100644 --- a/protocols/Tlen/src/tlen_picture.h +++ b/protocols/Tlen/src/tlen_picture.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "tlen.h" void TlenProcessPic(XmlNode *node, TlenProtocol *proto); -BOOL SendPicture(TlenProtocol *, HCONTACT hContact); +BOOL SendPicture(TlenProtocol *, MCONTACT hContact); #endif /* _TLEN_PICTURE_H */ diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index d37c9bcdc6..57bd773bf0 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) { - HCONTACT hContact; + MCONTACT hContact; XmlNode *showNode, *statusNode; TLEN_LIST_ITEM *item; char *from, *type, *nick, *show; @@ -178,7 +178,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) void setOwnStatusOnCList(TlenProtocol *proto, int status, char *statusMsg) { ptrA ownJid(db_get_sa(NULL, proto->m_szModuleName, "jid")); - HCONTACT hContact = TlenHContactFromJID(proto, ownJid); + MCONTACT hContact = TlenHContactFromJID(proto, ownJid); if(hContact){ if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != status) db_set_w(hContact, proto->m_szModuleName, "Status", (WORD)status); diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 479026eb1b..4f996b8a38 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "tlen_avatar.h" #include "tlen_file.h" -DWORD_PTR TlenProtocol::GetCaps(int type, HCONTACT hContact) +DWORD_PTR TlenProtocol::GetCaps(int type, MCONTACT hContact) { if (type == PFLAGNUM_1) return PF1_IM|PF1_AUTHREQ|PF1_SERVERCLIST|PF1_MODEMSG|PF1_BASICSEARCH|PF1_SEARCHBYEMAIL|PF1_EXTSEARCH|PF1_EXTSEARCHUI|PF1_SEARCHBYNAME|PF1_FILE;//|PF1_VISLIST|PF1_INVISLIST; @@ -175,15 +175,15 @@ HWND TlenProtocol::SearchAdvanced(HWND owner) } -static HCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags) +static MCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags) { - HCONTACT hContact; + MCONTACT hContact; char *jid, *nick; if ((hContact=TlenHContactFromJID(proto, newJid)) == NULL) { // not already there: add jid = mir_strdup(newJid); _strlwr(jid); - hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); db_set_s(hContact, proto->m_szModuleName, "jid", jid); if ((nick=TlenNickFromJID(newJid)) == NULL) @@ -214,9 +214,9 @@ static HCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD fl return hContact; } -HCONTACT TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr) +MCONTACT TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr) { - HCONTACT hContact; + MCONTACT hContact; TLEN_SEARCH_RESULT *jsr = (TLEN_SEARCH_RESULT*)psr; if (jsr->hdr.cbSize != sizeof(TLEN_SEARCH_RESULT)) return NULL; @@ -224,7 +224,7 @@ HCONTACT TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr) return hContact; } -HCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ) +MCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ) { DBEVENTINFO dbei = { sizeof(dbei) }; if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1)) @@ -257,7 +257,7 @@ HCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEven char *lastName = firstName + strlen(firstName) + 1; char *jid = lastName + strlen(lastName) + 1; - HCONTACT hContact = (HCONTACT) AddToListByJID(this, jid, flags); + MCONTACT hContact = (MCONTACT) AddToListByJID(this, jid, flags); mir_free(dbei.pBlob); return hContact; } @@ -294,7 +294,7 @@ int TlenProtocol::Authorize(HANDLE hDbEvent) // Automatically add this user to my roster if option is enabled if (db_get_b(NULL, m_szModuleName, "AutoAdd", TRUE) == TRUE) { - HCONTACT hContact; + MCONTACT hContact; TLEN_LIST_ITEM *item; if ((item=TlenListGetItemPtr(this, LIST_ROSTER, jid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) { @@ -473,7 +473,7 @@ int TlenProtocol::SetAwayMsg(int iStatus, const PROTOCHAR* msg) return 0; } -int TlenProtocol::GetInfo(HCONTACT hContact, int infoType) +int TlenProtocol::GetInfo(MCONTACT hContact, int infoType) { DBVARIANT dbv; int iqId; @@ -500,7 +500,7 @@ int TlenProtocol::GetInfo(HCONTACT hContact, int infoType) return 0; } -int TlenProtocol::SetApparentMode(HCONTACT hContact, int mode) +int TlenProtocol::SetApparentMode(MCONTACT hContact, int mode) { DBVARIANT dbv; int oldMode; @@ -539,12 +539,12 @@ int TlenProtocol::SetApparentMode(HCONTACT hContact, int mode) struct SENDACKTHREADDATA { - __inline SENDACKTHREADDATA(TlenProtocol *_ppro, HCONTACT _hContact, int _msgid=0) : + __inline SENDACKTHREADDATA(TlenProtocol *_ppro, MCONTACT _hContact, int _msgid=0) : proto(_ppro), hContact(_hContact), msgid(_msgid) {} TlenProtocol *proto; - HCONTACT hContact; + MCONTACT hContact; int msgid; }; @@ -599,7 +599,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr) INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (isOnline && !db_get(hContact, m_szModuleName, "jid", &dbv)) { TlenSend(this, "", dbv.pszVal); @@ -609,7 +609,7 @@ INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam) return 0; } -int TlenProtocol::SendMsg(HCONTACT hContact, int flags, const char* msgRAW) +int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) { DBVARIANT dbv; char *msgEnc; @@ -717,19 +717,19 @@ INT_PTR TlenProtocol::GetAvatarInfo(WPARAM wParam, LPARAM lParam) return GAIR_NOAVATAR; } -HANDLE TlenProtocol::GetAwayMsg(HCONTACT hContact) +HANDLE TlenProtocol::GetAwayMsg(MCONTACT hContact) { SENDACKTHREADDATA *tdata = new SENDACKTHREADDATA(this, hContact, 0); forkthread((void (__cdecl *)(void*))TlenGetAwayMsgThread, 0, (void*)tdata); return (HANDLE)1; } -int TlenProtocol::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt) +int TlenProtocol::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt) { return 0; } -HANDLE TlenProtocol::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE TlenProtocol::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { TLEN_FILE_TRANSFER *ft; TLEN_LIST_ITEM *item; @@ -752,7 +752,7 @@ HANDLE TlenProtocol::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOC return (HANDLE)hTransfer; } -int TlenProtocol::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) +int TlenProtocol::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) { TLEN_FILE_TRANSFER *ft; char *nick; @@ -775,7 +775,7 @@ int TlenProtocol::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** sz return 0; } -int TlenProtocol::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int TlenProtocol::FileCancel(MCONTACT hContact, HANDLE hTransfer) { TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *) hTransfer; debugLogA("Invoking FileCancel()"); @@ -794,7 +794,7 @@ int TlenProtocol::FileCancel(HCONTACT hContact, HANDLE hTransfer) return 0; } -HANDLE TlenProtocol::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) +HANDLE TlenProtocol::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { TLEN_FILE_TRANSFER *ft; int i, j; @@ -862,25 +862,25 @@ HANDLE TlenProtocol::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, return (HANDLE) ft; } -int TlenProtocol::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList){ +int TlenProtocol::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList){ return 0; } -int TlenProtocol::SendUrl(HCONTACT hContact, int flags, const char* urlt){ +int TlenProtocol::SendUrl(MCONTACT hContact, int flags, const char* urlt){ return 0; } -int TlenProtocol::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt) +int TlenProtocol::RecvMsg(MCONTACT hContact, PROTORECVEVENT* evt) { return Proto_RecvMessage(hContact, evt); } -int TlenProtocol::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) +int TlenProtocol::RecvFile(MCONTACT hContact, PROTOFILEEVENT* evt) { return Proto_RecvFile(hContact, evt); } -int TlenProtocol::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int TlenProtocol::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 0; } @@ -904,12 +904,12 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!isConnected) return 0; if (!strcmp(cws->szModule, "CList")) { - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; TLEN_LIST_ITEM *item; char *szProto, *nick, *jid, *group; - hContact = (HCONTACT) wParam; + hContact = (MCONTACT) wParam; szProto = GetContactProto(hContact); if (szProto == NULL || strcmp(szProto, m_szModuleName)) return 0; // A contact's group is changed @@ -956,7 +956,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) else if (!strcmp(cws->szSetting, "MyHandle")) { char *newNick; -// hContact = (HCONTACT) wParam; +// hContact = (MCONTACT) wParam; // szProto = GetContactProto(hContact); // if (szProto == NULL || strcmp(szProto, proto->m_szModuleName)) return 0; @@ -1035,12 +1035,12 @@ int TlenProtocol::TlenContactDeleted(WPARAM wParam, LPARAM lParam) if (!isOnline) // should never happen return 0; - char *szProto = GetContactProto((HCONTACT)wParam); + char *szProto = GetContactProto((MCONTACT)wParam); if (szProto == NULL || strcmp(szProto, m_szModuleName)) return 0; DBVARIANT dbv; - if (!db_get((HCONTACT)wParam, m_szModuleName, "jid", &dbv)) { + if (!db_get((MCONTACT)wParam, m_szModuleName, "jid", &dbv)) { char *jid, *p, *q; jid = dbv.pszVal; @@ -1058,7 +1058,7 @@ int TlenProtocol::TlenContactDeleted(WPARAM wParam, LPARAM lParam) return 0; } -int TlenProtocol::UserIsTyping(HCONTACT hContact, int type) +int TlenProtocol::UserIsTyping(MCONTACT hContact, int type) { DBVARIANT dbv; TLEN_LIST_ITEM *item; @@ -1200,13 +1200,13 @@ int TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lPara } // PSS_ADDED -int TlenProtocol::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) +int TlenProtocol::AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt) { return 1; } // PSS_AUTHREQUEST -int TlenProtocol::AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage) +int TlenProtocol::AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage) { return 1; } @@ -1217,7 +1217,7 @@ HANDLE TlenProtocol::ChangeInfo(int iInfoType, void* pInfoData) } -int TlenProtocol::RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt) +int TlenProtocol::RecvContacts(MCONTACT hContact, PROTORECVEVENT* evt) { return 1; } diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 40ae861fcf..460f3d860f 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -352,7 +352,7 @@ void __cdecl TlenServerThread(ThreadData *info) ProtoBroadcastAck(szProto, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, info->proto->m_iStatus); // Set all contacts to offline - for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) + for (MCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); @@ -595,7 +595,7 @@ static void TlenProcessAvatar(XmlNode* node, ThreadData *info) static void TlenProcessMessage(XmlNode *node, ThreadData *info) { - HCONTACT hContact; + MCONTACT hContact; XmlNode *bodyNode, *subjectNode, *xNode, *n; char *from, *type, *nick, *p, *localMessage, *idStr; DWORD msgTime; @@ -728,7 +728,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) static void TlenProcessIq(XmlNode *node, ThreadData *info) { - HCONTACT hContact; + MCONTACT hContact; XmlNode *queryNode = NULL; char *type, *jid, *nick; char *xmlns = NULL; @@ -960,7 +960,7 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) */ static void TlenProcessW(XmlNode *node, ThreadData *info) { - HCONTACT hContact; + MCONTACT hContact; char *f, *e, *s, *body; char *str, *localMessage; int strSize; @@ -1007,7 +1007,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) */ static void TlenProcessM(XmlNode *node, ThreadData *info) { - HCONTACT hContact; + MCONTACT hContact; char *f;//, *from;//username char *tp;//typing start/stop char *p, *n, *r, *s, *str, *localMessage; diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index 22ed3651e7..108214ebf2 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -132,7 +132,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam) if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName)) return 0; - HCONTACT hContact = (HCONTACT) lParam; + MCONTACT hContact = (MCONTACT) lParam; char *szProto = GetContactProto(hContact); if ((szProto != NULL && !strcmp(szProto, m_szModuleName)) || !lParam) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; @@ -155,7 +155,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam) typedef struct { TlenProtocol *proto; - HCONTACT hContact; + MCONTACT hContact; }TLENUSERINFODLGDATA; @@ -166,7 +166,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara case WM_INITDIALOG: data = (TLENUSERINFODLGDATA*)mir_alloc(sizeof(TLENUSERINFODLGDATA)); - data->hContact = (HCONTACT) lParam; + data->hContact = (MCONTACT) lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data); // lParam is hContact TranslateDialogDefault(hwndDlg); @@ -286,7 +286,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (((LPNMHDR)lParam)->code) { case PSN_INFOCHANGED: { - HCONTACT hContact = (HCONTACT) ((LPPSHNOTIFY) lParam)->lParam; + MCONTACT hContact = (MCONTACT) ((LPPSHNOTIFY) lParam)->lParam; SendMessage(hwndDlg, WM_TLEN_REFRESH, 0, (LPARAM) hContact); } break; diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp index 8f8837454b..981c6da6fb 100644 --- a/protocols/Tlen/src/tlen_util.cpp +++ b/protocols/Tlen/src/tlen_util.cpp @@ -440,7 +440,7 @@ BOOL IsAuthorized(TlenProtocol *proto, const char *jid) } -void TlenLogMessage(TlenProtocol *proto, HCONTACT hContact, DWORD flags, const char *message) +void TlenLogMessage(TlenProtocol *proto, MCONTACT hContact, DWORD flags, const char *message) { int size = (int)strlen(message) + 2; char *localMessage = (char *)mir_alloc(size); diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 57cab89d2a..dca3634307 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -693,14 +693,14 @@ int TlenVoiceCancelAll(TlenProtocol *proto) INT_PTR TlenProtocol::VoiceContactMenuHandleVoice(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; TLEN_LIST_ITEM *item; TLEN_FILE_TRANSFER *ft; if (!isOnline) return 1; - if ((hContact=(HCONTACT)wParam) != NULL) { + if ((hContact=(MCONTACT)wParam) != NULL) { if (!db_get(hContact, m_szModuleName, "jid", &dbv)) { char serialId[32]; mir_snprintf(serialId, SIZEOF(serialId), "%d", TlenSerialNext(this)); @@ -942,7 +942,7 @@ int TlenVoiceStart(TLEN_FILE_TRANSFER *ft, int mode) static char *getDisplayName(TlenProtocol *proto, const char *id) { char jid[256]; - HCONTACT hContact; + MCONTACT hContact; DBVARIANT dbv; if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) { mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal); diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index df581c8586..d08e1c81e7 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -39,7 +39,7 @@ void TwitterProto::UpdateChat(const twitter_user &update) gce.time = static_cast(update.status.time); DBVARIANT nick; - HCONTACT hContact = UsernameToHContact(update.username.c_str()); + MCONTACT hContact = UsernameToHContact(update.username.c_str()); if(hContact && !db_get_s(hContact,"CList","MyHandle",&nick)) { gce.ptszNick = mir_a2t(nick.pszVal); @@ -163,7 +163,7 @@ void TwitterProto::SetChatStatus(int status) if(status == ID_STATUS_ONLINE) { // Add all friends to contact list - for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for(MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if( isChatRoom(hContact)) continue; diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index bb332624e4..e13ee2a66b 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -25,7 +25,7 @@ void CALLBACK TwitterProto::APC_callback(ULONG_PTR p) } template -inline static T db_pod_get(HCONTACT hContact,const char *module,const char *setting,T errorValue) +inline static T db_pod_get(MCONTACT hContact,const char *module,const char *setting,T errorValue) { DBVARIANT dbv; if(db_get(hContact, module, setting, &dbv)) @@ -41,7 +41,7 @@ inline static T db_pod_get(HCONTACT hContact,const char *module,const char *sett } template -inline static INT_PTR db_pod_set(HCONTACT hContact,const char *module,const char *setting,T val) +inline static INT_PTR db_pod_set(MCONTACT hContact,const char *module,const char *setting,T val) { return db_set_blob(hContact, module, setting, &val, sizeof(T)); } @@ -401,8 +401,8 @@ void TwitterProto::MessageLoop(void*) struct update_avatar { - update_avatar(HCONTACT hContact,const std::string &url) : hContact(hContact),url(url) {} - HCONTACT hContact; + update_avatar(MCONTACT hContact,const std::string &url) : hContact(hContact),url(url) {} + MCONTACT hContact; std::string url; }; @@ -454,7 +454,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) debugLogA( _T("***** Done avatar: %s"),data->url.c_str()); } -void TwitterProto::UpdateAvatar(HCONTACT hContact,const std::string &url,bool force) +void TwitterProto::UpdateAvatar(MCONTACT hContact,const std::string &url,bool force) { DBVARIANT dbv = {0}; @@ -493,7 +493,7 @@ void TwitterProto::UpdateFriends() if(i->username == twit_.get_username()) continue; - HCONTACT hContact = AddToClientList(i->username.c_str(),i->status.text.c_str()); + MCONTACT hContact = AddToClientList(i->username.c_str(),i->status.text.c_str()); UpdateAvatar(hContact,i->profile_image_url); } disconnectionCount = 0; @@ -516,7 +516,7 @@ void TwitterProto::UpdateFriends() } -void TwitterProto::ShowContactPopup(HCONTACT hContact,const std::string &text) +void TwitterProto::ShowContactPopup(MCONTACT hContact,const std::string &text) { if(!ServiceExists(MS_POPUP_ADDPOPUPT) || db_get_b(0,m_szModuleName,TWITTER_KEY_POPUP_SHOW,0) == 0) { @@ -565,7 +565,7 @@ void TwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg) if(i->username == twit_.get_username()) continue; - HCONTACT hContact = AddToClientList(i->username.c_str(),""); + MCONTACT hContact = AddToClientList(i->username.c_str(),""); UpdateAvatar(hContact,i->profile_image_url); // as UpdateFriends() doesn't work at the moment, i'm going to update the avatars here // i think we maybe should just do that DBEF_READ line instead of stopping ALL this code. have to test. @@ -620,7 +620,7 @@ void TwitterProto::UpdateMessages(bool pre_read) for(twitter::status_list::reverse_iterator i=messages.rbegin(); i!=messages.rend(); ++i) { - HCONTACT hContact = AddToClientList(i->username.c_str(),""); + MCONTACT hContact = AddToClientList(i->username.c_str(),""); PROTORECVEVENT recv = { 0 }; recv.flags = PREF_UTF; diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 3cb24db577..c78c28f914 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -32,7 +32,7 @@ void TwitterProto::AddToListWorker(void *p) twitter_user user = twit_.add_friend(name); s.Unlock(); - HCONTACT hContact = UsernameToHContact(name); + MCONTACT hContact = UsernameToHContact(name); UpdateAvatar(hContact,user.profile_image_url); } catch(const std::exception &e) @@ -43,7 +43,7 @@ void TwitterProto::AddToListWorker(void *p) mir_free(name); } -HCONTACT TwitterProto::AddToList(int flags,PROTOSEARCHRESULT *result) +MCONTACT TwitterProto::AddToList(int flags,PROTOSEARCHRESULT *result) { if(m_iStatus != ID_STATUS_ONLINE) return 0; @@ -60,7 +60,7 @@ void TwitterProto::UpdateInfoWorker(void *hContact) std::string username; DBVARIANT dbv; - if (!db_get_s((HCONTACT)hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) + if (!db_get_s((MCONTACT)hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) { username = dbv.pszVal; db_free(&dbv); @@ -73,11 +73,11 @@ void TwitterProto::UpdateInfoWorker(void *hContact) twit_.get_info(username,&user); } - UpdateAvatar((HCONTACT)hContact, user.profile_image_url, true); - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, 0, 0); + UpdateAvatar((MCONTACT)hContact, user.profile_image_url, true); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, 0, 0); } -int TwitterProto::GetInfo(HCONTACT hContact,int info_type) +int TwitterProto::GetInfo(MCONTACT hContact,int info_type) { if(m_iStatus != ID_STATUS_ONLINE) return 1; @@ -170,14 +170,14 @@ void TwitterProto::GetAwayMsgWorker(void *hContact) return; DBVARIANT dbv; - if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv)) { - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); + if (!db_get_ts((MCONTACT)hContact, "CList", "StatusMsg", &dbv)) { + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); db_free(&dbv); } - else ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_FAILED, (HANDLE)1, 0); + else ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_FAILED, (HANDLE)1, 0); } -HANDLE TwitterProto::GetAwayMsg(HCONTACT hContact) +HANDLE TwitterProto::GetAwayMsg(MCONTACT hContact) { ForkThread(&TwitterProto::GetAwayMsgWorker, (void*)hContact); return (HANDLE)1; @@ -188,7 +188,7 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam) if(m_iStatus != ID_STATUS_ONLINE) return 0; - const HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)wParam; if(!IsMyContact(hContact)) return 0; @@ -208,7 +208,7 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam) // ************************* -bool TwitterProto::IsMyContact(HCONTACT hContact,bool include_chat) +bool TwitterProto::IsMyContact(MCONTACT hContact,bool include_chat) { char *proto = GetContactProto(hContact); if(proto && strcmp(m_szModuleName,proto) == 0) { @@ -219,9 +219,9 @@ bool TwitterProto::IsMyContact(HCONTACT hContact,bool include_chat) else return false; } -HCONTACT TwitterProto::UsernameToHContact(const char *name) +MCONTACT TwitterProto::UsernameToHContact(const char *name) { - for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for(MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if( db_get_b(hContact, m_szModuleName, "ChatRoom", 0)) continue; @@ -242,10 +242,10 @@ HCONTACT TwitterProto::UsernameToHContact(const char *name) return 0; } -HCONTACT TwitterProto::AddToClientList(const char *name, const char *status) +MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) { // First, check if this contact exists - HCONTACT hContact = UsernameToHContact(name); + MCONTACT hContact = UsernameToHContact(name); if(hContact) return hContact; @@ -253,7 +253,7 @@ HCONTACT TwitterProto::AddToClientList(const char *name, const char *status) AddChatContact(name); // If not, make a new contact! - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if(hContact) { if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0) @@ -282,7 +282,7 @@ HCONTACT TwitterProto::AddToClientList(const char *name, const char *status) void TwitterProto::SetAllContactStatuses(int status) { - for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for(MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) if( !db_get_b(hContact, m_szModuleName, "ChatRoom", 0)) db_set_w(hContact,m_szModuleName,"Status",status); diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 6ec565871f..e9ee5618c9 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -88,7 +88,7 @@ TwitterProto::~TwitterProto() // ************************* -DWORD_PTR TwitterProto::GetCaps(int type, HCONTACT) +DWORD_PTR TwitterProto::GetCaps(int type, MCONTACT) { switch(type) { @@ -113,7 +113,7 @@ DWORD_PTR TwitterProto::GetCaps(int type, HCONTACT) // ************************* -int TwitterProto::RecvMsg(HCONTACT hContact,PROTORECVEVENT *pre) +int TwitterProto::RecvMsg(MCONTACT hContact,PROTORECVEVENT *pre) { Proto_RecvMessage(hContact, pre); return 0; @@ -123,11 +123,11 @@ int TwitterProto::RecvMsg(HCONTACT hContact,PROTORECVEVENT *pre) struct send_direct { - __inline send_direct(HCONTACT _hContact, const std::string &_msg, int _msgid) : + __inline send_direct(MCONTACT _hContact, const std::string &_msg, int _msgid) : hContact(_hContact), msg(_msg), msgid(_msgid) {} - HCONTACT hContact; + MCONTACT hContact; std::string msg; int msgid; }; @@ -151,7 +151,7 @@ void TwitterProto::SendSuccess(void *p) delete data; } -int TwitterProto::SendMsg(HCONTACT hContact,int flags,const char *msg) +int TwitterProto::SendMsg(MCONTACT hContact,int flags,const char *msg) { if(m_iStatus != ID_STATUS_ONLINE) return 0; @@ -246,7 +246,7 @@ INT_PTR TwitterProto::GetStatus(WPARAM,LPARAM) INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam,LPARAM) { // TODO: support replying to tweets instead of just users - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; HWND hDlg = CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_TWEET),0,tweet_proc,reinterpret_cast(this)); @@ -264,7 +264,7 @@ INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam,LPARAM) INT_PTR TwitterProto::VisitHomepage(WPARAM wParam,LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; // TODO: remove this @@ -398,7 +398,7 @@ int TwitterProto::OnPreShutdown(WPARAM,LPARAM) int TwitterProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if(IsMyContact(hContact)) ShowContactMenus(true); @@ -495,8 +495,8 @@ void TwitterProto::UpdateSettings() if(in_chat_) OnLeaveChat(0,0); - for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) { - HCONTACT hNext = db_find_next(hContact, m_szModuleName); + for(MCONTACT hContact = db_find_first(m_szModuleName); hContact; ) { + MCONTACT hNext = db_find_next(hContact, m_szModuleName); if(isChatRoom(hContact)) CallService(MS_DB_CONTACT_DELETE, WPARAM(hContact), 0); hContact = hNext; diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 68a7cb3b27..7ad5188626 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -36,23 +36,23 @@ public: //PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList(int,PROTOSEARCHRESULT *); - virtual HCONTACT __cdecl AddToListByEvent(int,int,HANDLE); + virtual MCONTACT __cdecl AddToList(int,PROTOSEARCHRESULT *); + virtual MCONTACT __cdecl AddToListByEvent(int,int,HANDLE); virtual int __cdecl Authorize(HANDLE); virtual int __cdecl AuthDeny(HANDLE,const TCHAR *); - virtual int __cdecl AuthRecv(HCONTACT, PROTORECVEVENT *); - virtual int __cdecl AuthRequest(HCONTACT, const TCHAR *); + virtual int __cdecl AuthRecv(MCONTACT, PROTORECVEVENT *); + virtual int __cdecl AuthRequest(MCONTACT, const TCHAR *); virtual HANDLE __cdecl ChangeInfo(int,void *); - virtual HANDLE __cdecl FileAllow(HCONTACT, HANDLE, const TCHAR *); - virtual int __cdecl FileCancel(HCONTACT, HANDLE); - virtual int __cdecl FileDeny(HCONTACT, HANDLE, const TCHAR *); + virtual HANDLE __cdecl FileAllow(MCONTACT, HANDLE, const TCHAR *); + virtual int __cdecl FileCancel(MCONTACT, HANDLE); + virtual int __cdecl FileDeny(MCONTACT, HANDLE, const TCHAR *); virtual int __cdecl FileResume(HANDLE, int *, const TCHAR **); - virtual DWORD_PTR __cdecl GetCaps(int, HCONTACT = 0); - virtual int __cdecl GetInfo(HCONTACT, int); + virtual DWORD_PTR __cdecl GetCaps(int, MCONTACT = 0); + virtual int __cdecl GetInfo(MCONTACT, int); virtual HANDLE __cdecl SearchBasic(const TCHAR *); virtual HANDLE __cdecl SearchByEmail(const TCHAR *); @@ -60,24 +60,24 @@ public: virtual HWND __cdecl SearchAdvanced(HWND); virtual HWND __cdecl CreateExtendedSearchUI(HWND); - virtual int __cdecl RecvContacts(HCONTACT, PROTORECVEVENT *); - virtual int __cdecl RecvFile(HCONTACT, PROTORECVFILET *); - virtual int __cdecl RecvMsg(HCONTACT, PROTORECVEVENT *); - virtual int __cdecl RecvUrl(HCONTACT, PROTORECVEVENT *); + virtual int __cdecl RecvContacts(MCONTACT, PROTORECVEVENT *); + virtual int __cdecl RecvFile(MCONTACT, PROTORECVFILET *); + virtual int __cdecl RecvMsg(MCONTACT, PROTORECVEVENT *); + virtual int __cdecl RecvUrl(MCONTACT, PROTORECVEVENT *); - virtual int __cdecl SendContacts(HCONTACT, int, int, HCONTACT*); - virtual HANDLE __cdecl SendFile(HCONTACT, const TCHAR *, TCHAR **); - virtual int __cdecl SendMsg(HCONTACT, int, const char *); - virtual int __cdecl SendUrl(HCONTACT, int, const char *); + virtual int __cdecl SendContacts(MCONTACT, int, int, MCONTACT*); + virtual HANDLE __cdecl SendFile(MCONTACT, const TCHAR *, TCHAR **); + virtual int __cdecl SendMsg(MCONTACT, int, const char *); + virtual int __cdecl SendUrl(MCONTACT, int, const char *); - virtual int __cdecl SetApparentMode(HCONTACT, int); + virtual int __cdecl SetApparentMode(MCONTACT, int); virtual int __cdecl SetStatus(int); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT); - virtual int __cdecl RecvAwayMsg(HCONTACT, int, PROTORECVEVENT *); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT); + virtual int __cdecl RecvAwayMsg(MCONTACT, int, PROTORECVEVENT *); virtual int __cdecl SetAwayMsg(int,const TCHAR *); - virtual int __cdecl UserIsTyping(HCONTACT, int); + virtual int __cdecl UserIsTyping(MCONTACT, int); virtual int __cdecl OnEvent(PROTOEVENTTYPE,WPARAM,LPARAM); @@ -123,16 +123,16 @@ private: void UpdateStatuses(bool pre_read,bool popups, bool tweetToMsg); void UpdateMessages(bool pre_read); void UpdateFriends(); - void UpdateAvatar(HCONTACT, const std::string &, bool force = false); + void UpdateAvatar(MCONTACT, const std::string &, bool force = false); int ShowPinDialog(); void ShowPopup(const wchar_t *, int Error = 0); void ShowPopup(const char *, int Error = 0); - void ShowContactPopup(HCONTACT, const std::string &); + void ShowContactPopup(MCONTACT, const std::string &); - bool IsMyContact(HCONTACT, bool include_chat = false); - HCONTACT UsernameToHContact(const char *); - HCONTACT AddToClientList(const char *, const char *); + bool IsMyContact(MCONTACT, bool include_chat = false); + MCONTACT UsernameToHContact(const char *); + MCONTACT AddToClientList(const char *, const char *); void SetAllContactStatuses(int); void debugLogA(TCHAR *fmt,...); diff --git a/protocols/Twitter/src/stubs.cpp b/protocols/Twitter/src/stubs.cpp index 9b8fc7deea..a959f6d487 100644 --- a/protocols/Twitter/src/stubs.cpp +++ b/protocols/Twitter/src/stubs.cpp @@ -17,7 +17,7 @@ along with this program. If not, see . #include "proto.h" -HCONTACT TwitterProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT TwitterProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) { return NULL; } @@ -32,12 +32,12 @@ int TwitterProto::AuthDeny(HANDLE hDbEvent,const TCHAR *reason) return 1; } -int TwitterProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *) +int TwitterProto::AuthRecv(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int TwitterProto::AuthRequest(HCONTACT hContact,const TCHAR *message) +int TwitterProto::AuthRequest(MCONTACT hContact,const TCHAR *message) { return 1; } @@ -48,17 +48,17 @@ HANDLE TwitterProto::ChangeInfo(int type,void *info_data) return NULL; } -HANDLE TwitterProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const TCHAR *path) +HANDLE TwitterProto::FileAllow(MCONTACT hContact,HANDLE hTransfer,const TCHAR *path) { return NULL; } -int TwitterProto::FileCancel(HCONTACT hContact,HANDLE hTransfer) +int TwitterProto::FileCancel(MCONTACT hContact,HANDLE hTransfer) { return 1; } -int TwitterProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const TCHAR *reason) +int TwitterProto::FileDeny(MCONTACT hContact,HANDLE hTransfer,const TCHAR *reason) { return 1; } @@ -83,42 +83,42 @@ HWND TwitterProto::CreateExtendedSearchUI(HWND owner) return NULL; } -int TwitterProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *) +int TwitterProto::RecvContacts(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int TwitterProto::RecvFile(HCONTACT hContact,PROTORECVFILET *) +int TwitterProto::RecvFile(MCONTACT hContact,PROTORECVFILET *) { return 1; } -int TwitterProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *) +int TwitterProto::RecvUrl(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int TwitterProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int TwitterProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } -HANDLE TwitterProto::SendFile(HCONTACT hContact,const TCHAR *desc, TCHAR **files) +HANDLE TwitterProto::SendFile(MCONTACT hContact,const TCHAR *desc, TCHAR **files) { return NULL; } -int TwitterProto::SendUrl(HCONTACT hContact,int flags,const char *url) +int TwitterProto::SendUrl(MCONTACT hContact,int flags,const char *url) { return 1; } -int TwitterProto::SetApparentMode(HCONTACT hContact,int mode) +int TwitterProto::SetApparentMode(MCONTACT hContact,int mode) { return 1; } -int TwitterProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt) +int TwitterProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) { return 1; } @@ -128,7 +128,7 @@ int TwitterProto::SetAwayMsg(int status,const TCHAR *msg) return 1; } -int TwitterProto::UserIsTyping(HCONTACT hContact,int type) +int TwitterProto::UserIsTyping(MCONTACT hContact,int type) { return 1; } \ No newline at end of file diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index 81891adc44..7b0a6a6eac 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -52,7 +52,7 @@ static HGENMENU g_hMenuItems[2]; static HANDLE g_hMenuEvts[3]; // Helper functions -static TwitterProto * GetInstanceByHContact(HCONTACT hContact) +static TwitterProto * GetInstanceByHContact(MCONTACT hContact) { char *proto = GetContactProto(hContact); if(!proto) @@ -68,7 +68,7 @@ static TwitterProto * GetInstanceByHContact(HCONTACT hContact) template INT_PTR GlobalService(WPARAM wParam,LPARAM lParam) { - TwitterProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + TwitterProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? (proto->*Fcn)(wParam,lParam) : 0; } @@ -76,7 +76,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) { ShowContactMenus(false); - TwitterProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + TwitterProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? proto->OnPrebuildContactMenu(wParam,lParam) : 0; } diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index 91c5f96ec5..9d8dfdd924 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -385,7 +385,7 @@ namespace popup_options POPUPDATAT popup = {}; // Pick a random contact - HCONTACT hContact = 0; + MCONTACT hContact = 0; int n_contacts = (int)CallService(MS_DB_CONTACT_GETCOUNT,0,0); if(n_contacts != 0) diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index b36ea81976..58d3b356ba 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -25,7 +25,7 @@ TCHAR* CVkProto::GetUserStoredPassword() void CVkProto::SetAllContactStatuses(int iStatus) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) SetChatStatus(hContact, iStatus); else if (getWord(hContact, "Status", 0) != iStatus) @@ -33,9 +33,9 @@ void CVkProto::SetAllContactStatuses(int iStatus) } } -HCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) +MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { LONG dbUserid = getDword(hContact, "ID", -1); if (dbUserid == -1) continue; @@ -47,7 +47,7 @@ HCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) if (!bCreate) return NULL; - HCONTACT hNewContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName); setDword(hNewContact, "ID", dwUserid); db_set_ts(hNewContact, "CList", "Group", m_defaultGroup); diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 15c56ba41a..560bf5dd75 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -23,18 +23,18 @@ void CVkProto::OnReceiveAvatar(NETLIBHTTPREQUEST *reply, AsyncHttpRequest* pReq) return; PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) }; - GetAvatarFileName((HCONTACT)pReq->pUserInfo, AI.filename, SIZEOF(AI.filename)); + GetAvatarFileName((MCONTACT)pReq->pUserInfo, AI.filename, SIZEOF(AI.filename)); AI.format = ProtoGetBufferFormat(reply->pData); FILE *out = _tfopen(AI.filename, _T("wb")); if (out == NULL) { - ProtoBroadcastAck((HCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0); + ProtoBroadcastAck((MCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0); return; } fwrite(reply->pData, 1, reply->dataLength, out); fclose(out); - ProtoBroadcastAck((HCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0); + ProtoBroadcastAck((MCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0); } INT_PTR CVkProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) @@ -93,7 +93,7 @@ INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM wParam, LPARAM lParam) return GAIR_NOAVATAR; } -void CVkProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen) +void CVkProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName); @@ -115,7 +115,7 @@ void CVkProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%d%s"), id, szFileType); } -void CVkProto::SetAvatarUrl(HCONTACT hContact, LPCTSTR ptszUrl) +void CVkProto::SetAvatarUrl(MCONTACT hContact, LPCTSTR ptszUrl) { ptrT oldUrl( getTStringA(hContact, "AvatarUrl")); if (!lstrcmp(ptszUrl, oldUrl)) diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 31b583c62c..b8dfa1257b 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -287,7 +287,7 @@ CVkChatUser* CVkChatInfo::GetUserById(LPCTSTR ptszId) ///////////////////////////////////////////////////////////////////////////////////////// -void CVkProto::SetChatStatus(HCONTACT hContact, int iStatus) +void CVkProto::SetChatStatus(MCONTACT hContact, int iStatus) { ptrT tszChatID(getTStringA(hContact, "ChatRoomID")); if (tszChatID == NULL) @@ -372,7 +372,7 @@ static INT_PTR CALLBACK InviteDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA { CVkProto *ppro = (CVkProto*)lParam; HWND hwndCombo = GetDlgItem(hwndDlg, IDC_CONTACT); - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0); int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, LPARAM(ptszNick)); SendMessage(hwndCombo, CB_SETITEMDATA, idx, (LPARAM)hContact); @@ -413,7 +413,7 @@ LPTSTR CVkProto::ChangeChatTopic(CVkChatInfo *cc) void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch) { - HCONTACT hContact; + MCONTACT hContact; switch (gch->dwData) { case IDM_TOPIC: @@ -425,7 +425,7 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch) break; case IDM_INVITE: - hContact = (HCONTACT)DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INVITE), NULL, InviteDlgProc, (LPARAM)this); + hContact = (MCONTACT)DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INVITE), NULL, InviteDlgProc, (LPARAM)this); if (hContact != NULL) { int uid = getDword(hContact, "ID", -1); if (uid != -1) @@ -474,7 +474,7 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) switch (gch->dwData) { case IDM_INFO: - if (HCONTACT hContact = FindUser(cu->m_uid)) + if (MCONTACT hContact = FindUser(cu->m_uid)) CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break; @@ -527,7 +527,7 @@ int CVkProto::OnGcMenuHook(WPARAM, LPARAM lParam) static void FilterContacts(HWND hwndDlg, CVkProto *ppro) { HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST); - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *proto = GetContactProto(hContact); if (lstrcmpA(proto, ppro->m_szModuleName) || ppro->isChatRoom(hContact)) if (HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_FINDCONTACT, (WPARAM)hContact, 0)) @@ -585,7 +585,7 @@ static INT_PTR CALLBACK GcCreateDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDOK: HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST); CMStringA uids; - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) { if (ppro->isChatRoom(hContact)) continue; diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 3e52d04e5f..f1697284c2 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -103,7 +103,7 @@ int CVkProto::OnPreShutdown(WPARAM wParam, LPARAM lParam) ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR CVkProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR CVkProto::GetCaps(int type, MCONTACT hContact) { switch(type) { case PFLAGNUM_1: @@ -135,7 +135,7 @@ DWORD_PTR CVkProto::GetCaps(int type, HCONTACT hContact) ////////////////////////////////////////////////////////////////////////////// -int CVkProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int CVkProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { Proto_RecvMessage(hContact, pre); return 0; @@ -145,11 +145,11 @@ int CVkProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) struct TFakeAckParams { - __inline TFakeAckParams(HCONTACT _hContact, int _msgid) : + __inline TFakeAckParams(MCONTACT _hContact, int _msgid) : hContact(_hContact), msgid(_msgid) {} - HCONTACT hContact; + MCONTACT hContact; int msgid; }; @@ -161,7 +161,7 @@ void CVkProto::SendMsgAck(void *param) delete ack; } -int CVkProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { LONG userID = getDword(hContact, "ID", -1); if (userID == -1) @@ -202,7 +202,7 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) } if (m_bServerDelivery) - ProtoBroadcastAck((HCONTACT)pReq->pData, ACKTYPE_MESSAGE, iResult, pReq->pUserInfo, 0); + ProtoBroadcastAck((MCONTACT)pReq->pData, ACKTYPE_MESSAGE, iResult, pReq->pUserInfo, 0); pReq->pData = NULL; } @@ -273,12 +273,12 @@ HANDLE CVkProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, return 0; } -HCONTACT CVkProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CVkProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { return NULL; } -int CVkProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message) +int CVkProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) { return 0; } @@ -295,17 +295,17 @@ int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason) return 1; } -int CVkProto::UserIsTyping(HCONTACT hContact, int type) +int CVkProto::UserIsTyping(MCONTACT hContact, int type) { return 0; } -HCONTACT CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) { return NULL; } -int CVkProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *) +int CVkProto::AuthRecv(MCONTACT hContact,PROTORECVEVENT *) { return 1; } @@ -316,17 +316,17 @@ HANDLE CVkProto::ChangeInfo(int type,void *info_data) return NULL; } -HANDLE CVkProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) +HANDLE CVkProto::FileAllow(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) { return NULL; } -int CVkProto::FileCancel(HCONTACT hContact,HANDLE hTransfer) +int CVkProto::FileCancel(MCONTACT hContact,HANDLE hTransfer) { return 1; } -int CVkProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) +int CVkProto::FileDeny(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) { return 1; } @@ -336,7 +336,7 @@ int CVkProto::FileResume(HANDLE hTransfer,int *action,const PROTOCHAR **filename return 1; } -int CVkProto::GetInfo(HCONTACT hContact, int infoType) +int CVkProto::GetInfo(MCONTACT hContact, int infoType) { // TODO: Most probably some ProtoAck should be here instead return 1; @@ -352,47 +352,47 @@ HWND CVkProto::CreateExtendedSearchUI(HWND owner) return NULL; } -int CVkProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *) +int CVkProto::RecvContacts(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int CVkProto::RecvFile(HCONTACT hContact,PROTORECVFILET *) +int CVkProto::RecvFile(MCONTACT hContact,PROTORECVFILET *) { return 1; } -int CVkProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *) +int CVkProto::RecvUrl(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int CVkProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int CVkProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } -HANDLE CVkProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) +HANDLE CVkProto::SendFile(MCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) { return NULL; } -int CVkProto::SendUrl(HCONTACT hContact,int flags,const char *url) +int CVkProto::SendUrl(MCONTACT hContact,int flags,const char *url) { return 1; } -int CVkProto::SetApparentMode(HCONTACT hContact,int mode) +int CVkProto::SetApparentMode(MCONTACT hContact,int mode) { return 1; } -int CVkProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt) +int CVkProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) { return 1; } -HANDLE CVkProto::GetAwayMsg(HCONTACT hContact) +HANDLE CVkProto::GetAwayMsg(MCONTACT hContact) { return 0; // Status messages are disabled } diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 6d5eec5f1a..34b34b8f59 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -100,7 +100,7 @@ struct CVkChatInfo : public MZeroedObject int m_chatid, m_admin_id; bool m_bHistoryRead; ptrT m_tszTopic, m_tszId; - HCONTACT m_hContact; + MCONTACT m_hContact; OBJLIST m_users; OBJLIST m_msgs; @@ -116,23 +116,23 @@ struct CVkProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const TCHAR *id); virtual HANDLE __cdecl SearchByEmail(const TCHAR *email); @@ -140,24 +140,24 @@ struct CVkProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -259,10 +259,10 @@ private: void OnLoggedOut(); void ShutdownSession(); - void SetAvatarUrl(HCONTACT hContact, LPCTSTR ptszUrl); - void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen); + void SetAvatarUrl(MCONTACT hContact, LPCTSTR ptszUrl); + void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen); - HCONTACT FindUser(LONG userid, bool bCreate = false); + MCONTACT FindUser(LONG userid, bool bCreate = false); void SetAllContactStatuses(int status); @@ -297,7 +297,7 @@ private: void LogMenuHook(CVkChatInfo*, GCHOOK*); void NickMenuHook(CVkChatInfo*, GCHOOK*); LPTSTR ChangeChatTopic(CVkChatInfo*); - void SetChatStatus(HCONTACT hContact, int iStatus); + void SetChatStatus(MCONTACT hContact, int iStatus); CVkChatInfo* GetChatById(LPCTSTR ptszId); INT_PTR __cdecl SvcCreateChat(WPARAM, LPARAM); diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index c8d729f540..9999f04590 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -249,7 +249,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (userid == 0) return; - HCONTACT hContact; + MCONTACT hContact; if (userid == m_myUserId) hContact = NULL; else if ((hContact = FindUser(userid, false)) == NULL) @@ -311,7 +311,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq bool bCleanContacts = getByte("AutoClean", 0) != 0; LIST arContacts(10, PtrKeySortT); if (bCleanContacts) - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) if (!isChatRoom(hContact)) arContacts.insert((HANDLE)hContact); @@ -321,7 +321,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq continue; CMString tszNick; - HCONTACT hContact = FindUser(_ttoi(szValue), true); + MCONTACT hContact = FindUser(_ttoi(szValue), true); arContacts.remove(hContact); szValue = json_as_string(json_get(pInfo, "first_name")); if (szValue) { @@ -468,7 +468,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (pAttachments != NULL) ptszBody = mir_tstrdup(CMString(ptszBody) + GetAttachmentDescr(pAttachments)); - HCONTACT hContact = FindUser(uid, true); + MCONTACT hContact = FindUser(uid, true); PROTORECVEVENT recv = { 0 }; recv.flags = PREF_TCHAR; @@ -523,7 +523,7 @@ void CVkProto::PollUpdates(JSONNODE *pUpdates) CMStringA mids; int msgid, uid, flags; - HCONTACT hContact; + MCONTACT hContact; JSONNODE *pChild; for (int i = 0; (pChild = json_at(pUpdates, i)) != NULL; i++) { diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 81fd154153..bef230ecfd 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -35,7 +35,7 @@ int WhatsAppProto::OnChatOutgoing(WPARAM wParam, LPARAM lParam) mir_free(id); if (isOnline()) { - HCONTACT hContact = this->ContactIDToHContact(chat_id); + MCONTACT hContact = this->ContactIDToHContact(chat_id); if (hContact) { debugLogA("**Chat - Outgoing message: %s", text); diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index d3cf75690c..49cdca0982 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -1,6 +1,6 @@ #include "common.h" -bool WhatsAppProto::IsMyContact(HCONTACT hContact, bool include_chat) +bool WhatsAppProto::IsMyContact(MCONTACT hContact, bool include_chat) { const char *proto = GetContactProto(hContact); if( proto && strcmp(m_szModuleName,proto) == 0 ) @@ -14,10 +14,10 @@ bool WhatsAppProto::IsMyContact(HCONTACT hContact, bool include_chat) return false; } -HCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool dont_check, const char *new_name, +MCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool dont_check, const char *new_name, bool isChatRoom, bool isHidden) { - HCONTACT hContact; + MCONTACT hContact; if (!dont_check) { // First, check if this contact exists @@ -55,7 +55,7 @@ HCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool } // If not, make a new contact! - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) == 0) @@ -111,20 +111,20 @@ HCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool else CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); } - return (HCONTACT)INVALID_HANDLE_VALUE; + return (MCONTACT)INVALID_HANDLE_VALUE; } -HCONTACT WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber) +MCONTACT WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber) { // Cache - std::map::iterator it = this->hContactByJid.find(phoneNumber); + std::map::iterator it = this->hContactByJid.find(phoneNumber); if (it != this->hContactByJid.end()) return it->second; const char* idForContact = "ID"; const char* idForChat = "ChatRoomID"; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (!IsMyContact(hContact, true)) continue; @@ -147,7 +147,7 @@ HCONTACT WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber) void WhatsAppProto::SetAllContactStatuses(int status, bool reset_client) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (!IsMyContact(hContact)) continue; @@ -171,7 +171,7 @@ void WhatsAppProto::ProcessBuddyList(void*) { std::vector jids; DBVARIANT dbv; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (!IsMyContact(hContact)) continue; @@ -219,7 +219,7 @@ void WhatsAppProto::SearchAckThread(void *targ) void WhatsAppProto::onAvailable(const std::string& paramString, bool paramBoolean) { - HCONTACT hContact = this->AddToContactList(paramString, 0, false); + MCONTACT hContact = this->AddToContactList(paramString, 0, false); if (hContact != NULL) { if (paramBoolean) @@ -246,7 +246,7 @@ void WhatsAppProto::onAvailable(const std::string& paramString, bool paramBoolea void WhatsAppProto::onLastSeen(const std::string& paramString1, int paramInt, std::string* paramString2) { /* - HCONTACT hContact = this->ContactIDToHContact(paramString1); + MCONTACT hContact = this->ContactIDToHContact(paramString1); if (hContact == NULL) { // This contact was searched @@ -262,13 +262,13 @@ void WhatsAppProto::onLastSeen(const std::string& paramString1, int paramInt, st // #TODO } */ - HCONTACT hContact = this->AddToContactList(paramString1, 0, false); + MCONTACT hContact = this->AddToContactList(paramString1, 0, false); setDword(hContact, WHATSAPP_KEY_LAST_SEEN, paramInt); this->UpdateStatusMsg(hContact); } -void WhatsAppProto::UpdateStatusMsg(HCONTACT hContact) +void WhatsAppProto::UpdateStatusMsg(MCONTACT hContact) { std::wstringstream ss; @@ -304,7 +304,7 @@ void WhatsAppProto::onPictureChanged(const std::string& from, const std::string& void WhatsAppProto::onSendGetPicture(const std::string& jid, const std::vector& data, const std::string& oldId, const std::string& newId) { - HCONTACT hContact = this->ContactIDToHContact(jid); + MCONTACT hContact = this->ContactIDToHContact(jid); if (hContact) { debugLogA("Updating avatar for jid %s", jid.c_str()); @@ -342,7 +342,7 @@ void WhatsAppProto::onSendGetPictureIds(std::map* ids) { for (std::map::iterator it = ids->begin(); it != ids->end(); ++it) { - HCONTACT hContact = this->AddToContactList(it->first); + MCONTACT hContact = this->AddToContactList(it->first); if (hContact != NULL) { DBVARIANT dbv; @@ -365,14 +365,14 @@ void WhatsAppProto::onSendGetPictureIds(std::map* ids) } } -string WhatsAppProto::GetContactDisplayName(HCONTACT hContact) +string WhatsAppProto::GetContactDisplayName(MCONTACT hContact) { return string((CHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0)); } string WhatsAppProto::GetContactDisplayName(const string& jid) { - HCONTACT hContact = this->ContactIDToHContact(jid); + MCONTACT hContact = this->ContactIDToHContact(jid); return hContact ? this->GetContactDisplayName(hContact) : (string("+")+ Utilities::removeWaDomainFromJid(jid)); } @@ -389,7 +389,7 @@ void WhatsAppProto::SendGetGroupInfoWorker(void* data) void WhatsAppProto::onGroupInfo(const std::string& gjid, const std::string& ownerJid, const std::string& subject, const std::string& createrJid, int paramInt1, int paramInt2) { debugLogA("'%s', '%s', '%s', '%s'", gjid.c_str(), ownerJid.c_str(), subject.c_str(), createrJid.c_str()); - HCONTACT hContact = ContactIDToHContact(gjid); + MCONTACT hContact = ContactIDToHContact(gjid); if (!hContact) { debugLogA("Group info requested for non existing contact '%s'", gjid.c_str()); @@ -409,13 +409,13 @@ void WhatsAppProto::onGroupInfoFromList(const std::string& paramString1, const s void WhatsAppProto::onGroupNewSubject(const std::string& from, const std::string& author, const std::string& newSubject, int paramInt) { debugLogA("'%s', '%s', '%s'", from.c_str(), author.c_str(), newSubject.c_str()); - HCONTACT hContact = this->AddToContactList(from, 0, false, newSubject.c_str(), true); + MCONTACT hContact = this->AddToContactList(from, 0, false, newSubject.c_str(), true); } void WhatsAppProto::onGroupAddUser(const std::string& paramString1, const std::string& paramString2) { debugLogA("%s - user: %s", paramString1.c_str(), paramString2.c_str()); - HCONTACT hContact = this->AddToContactList(paramString1); + MCONTACT hContact = this->AddToContactList(paramString1); std::string groupName(this->GetContactDisplayName(hContact)); if (paramString2.compare(this->jid) == 0) @@ -438,7 +438,7 @@ void WhatsAppProto::onGroupAddUser(const std::string& paramString1, const std::s void WhatsAppProto::onGroupRemoveUser(const std::string& paramString1, const std::string& paramString2) { debugLogA("%s - user: %s", paramString1.c_str(), paramString2.c_str()); - HCONTACT hContact = this->ContactIDToHContact(paramString1); + MCONTACT hContact = this->ContactIDToHContact(paramString1); if (!hContact) return; @@ -465,7 +465,7 @@ void WhatsAppProto::onLeaveGroup(const std::string& paramString) { // Won't be called for unknown reasons! debugLogA("%s", this->GetContactDisplayName(paramString).c_str()); - HCONTACT hContact = this->ContactIDToHContact(paramString); + MCONTACT hContact = this->ContactIDToHContact(paramString); if (hContact) setByte(hContact, "IsGroupMember", 0); } @@ -474,7 +474,7 @@ void WhatsAppProto::onGetParticipants(const std::string& gjid, const std::vector { debugLogA("%s", this->GetContactDisplayName(gjid).c_str()); - HCONTACT hUserContact, hContact = this->ContactIDToHContact(gjid); + MCONTACT hUserContact, hContact = this->ContactIDToHContact(gjid); if (!hContact) return; @@ -525,8 +525,8 @@ void WhatsAppProto::onGetParticipants(const std::string& gjid, const std::vector // Menu handler INT_PTR __cdecl WhatsAppProto::OnAddContactToGroup(WPARAM wParam, LPARAM, LPARAM lParam) { - string a = GetContactDisplayName((HCONTACT)wParam); - string b = GetContactDisplayName((HCONTACT)lParam); + string a = GetContactDisplayName((MCONTACT)wParam); + string b = GetContactDisplayName((MCONTACT)lParam); debugLogA("Request add user %s to group %s", a.c_str(), b.c_str()); if (!this->isOnline()) @@ -534,14 +534,14 @@ INT_PTR __cdecl WhatsAppProto::OnAddContactToGroup(WPARAM wParam, LPARAM, LPARAM DBVARIANT dbv; - if (getString((HCONTACT)wParam, "ID", &dbv)) + if (getString((MCONTACT)wParam, "ID", &dbv)) return NULL; std::vector participants; participants.push_back(string(dbv.pszVal)); db_free(&dbv); - if (getString((HCONTACT)lParam, "ID", &dbv)) + if (getString((MCONTACT)lParam, "ID", &dbv)) return NULL; this->connection->sendAddParticipants(string(dbv.pszVal), participants); @@ -553,8 +553,8 @@ INT_PTR __cdecl WhatsAppProto::OnAddContactToGroup(WPARAM wParam, LPARAM, LPARAM // Menu handler INT_PTR __cdecl WhatsAppProto::OnRemoveContactFromGroup(WPARAM wParam, LPARAM, LPARAM lParam) { - string a = GetContactDisplayName((HCONTACT)wParam); - string b = GetContactDisplayName((HCONTACT)lParam); + string a = GetContactDisplayName((MCONTACT)wParam); + string b = GetContactDisplayName((MCONTACT)lParam); debugLogA("Request remove user %s from group %s", a.c_str(), b.c_str()); if (!this->isOnline()) @@ -562,14 +562,14 @@ INT_PTR __cdecl WhatsAppProto::OnRemoveContactFromGroup(WPARAM wParam, LPARAM, L DBVARIANT dbv; - if (getString((HCONTACT)lParam, "ID", &dbv)) + if (getString((MCONTACT)lParam, "ID", &dbv)) return NULL; std::vector participants; participants.push_back(string(dbv.pszVal)); db_free(&dbv); - if (getString((HCONTACT)wParam, "ID", &dbv)) + if (getString((MCONTACT)wParam, "ID", &dbv)) return NULL; this->connection->sendRemoveParticipants(string(dbv.pszVal), participants); @@ -592,8 +592,8 @@ void WhatsAppProto::onParticipatingGroups(const std::vector& paramVector void WhatsAppProto::HandleReceiveGroups(const std::vector& groups, bool isOwned) { - HCONTACT hContact; - map isMember; // at the moment, only members of owning groups are stored + MCONTACT hContact; + map isMember; // at the moment, only members of owning groups are stored // This could take long time if there are many new groups which aren't // yet stored to the database. But that should be a rare case @@ -632,7 +632,7 @@ void WhatsAppProto::onGroupCreated(const std::string& paramString1, const std::s // Must be received after onOwningGroups() :/ debugLogA("%s / %s", paramString1.c_str(), paramString2.c_str()); string jid = paramString2 +string("@")+ paramString1; - HCONTACT hContact = this->AddToContactList(jid, 0, false, NULL, true); + MCONTACT hContact = this->AddToContactList(jid, 0, false, NULL, true); setByte(hContact, "SimpleChatRoom", 2); } @@ -659,7 +659,7 @@ void __cdecl WhatsAppProto::SendSetGroupNameWorker(void* data) string groupName(ibr->value); mir_free(ibr->value); DBVARIANT dbv; - if (!getString(*((HCONTACT*)ibr->userData), WHATSAPP_KEY_ID, &dbv) && this->isOnline()) + if (!getString(*((MCONTACT*)ibr->userData), WHATSAPP_KEY_ID, &dbv) && this->isOnline()) { this->connection->sendSetNewSubject(dbv.pszVal, groupName); db_free(&dbv); @@ -682,7 +682,7 @@ void __cdecl WhatsAppProto::SendCreateGroupWorker(void* data) INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); input_box* ib = new input_box; if (getTString(hContact, WHATSAPP_KEY_PUSH_NAME, &dbv)) @@ -698,7 +698,7 @@ INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam ib->thread = &WhatsAppProto::SendSetGroupNameWorker; ib->proto = this; - HCONTACT *hContactPtr = new HCONTACT(hContact); + MCONTACT *hContactPtr = new MCONTACT(hContact); ib->userData = (void*)hContactPtr; HWND hDlg = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_INPUTBOX), 0, WhatsAppInputBoxProc, @@ -710,7 +710,7 @@ INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam INT_PTR __cdecl WhatsAppProto::OnLeaveGroup(WPARAM wParam, LPARAM) { DBVARIANT dbv; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); if (this->isOnline() && !getString(hContact, WHATSAPP_KEY_ID, &dbv)) { setByte(hContact, "IsGroupMember", 0); diff --git a/protocols/WhatsApp/src/entities.h b/protocols/WhatsApp/src/entities.h index a2543cf20d..2be8cacd54 100644 --- a/protocols/WhatsApp/src/entities.h +++ b/protocols/WhatsApp/src/entities.h @@ -3,18 +3,18 @@ struct send_direct { - send_direct(HCONTACT hContact,const std::string &msg, HANDLE msgid, bool isChat = false) + send_direct(MCONTACT hContact,const std::string &msg, HANDLE msgid, bool isChat = false) : hContact(hContact), msg(msg), msgid(msgid) {} - HCONTACT hContact; + MCONTACT hContact; std::string msg; HANDLE msgid; }; struct send_typing { - send_typing(HCONTACT hContact,const int status) : hContact(hContact), status(status) {} - HCONTACT hContact; + send_typing(MCONTACT hContact,const int status) : hContact(hContact), status(status) {} + MCONTACT hContact; int status; }; diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index c5c911ade8..b051d20903 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -1,6 +1,6 @@ #include "common.h" -int WhatsAppProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int WhatsAppProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF); @@ -28,7 +28,7 @@ void WhatsAppProto::onMessageForMe(FMessage* paramFMessage, bool paramBoolean) msg->insert(0, std::string("[").append(paramFMessage->notifyname).append("]: ")); } - HCONTACT hContact = this->AddToContactList(paramFMessage->key->remote_jid, 0, false, + MCONTACT hContact = this->AddToContactList(paramFMessage->key->remote_jid, 0, false, isChatRoom ? NULL : paramFMessage->notifyname.c_str(), isChatRoom); PROTORECVEVENT recv = {0}; @@ -40,7 +40,7 @@ void WhatsAppProto::onMessageForMe(FMessage* paramFMessage, bool paramBoolean) this->connection->sendMessageReceived(paramFMessage); } -int WhatsAppProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int WhatsAppProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { debugLogA(""); int msgId = ++(this->msgId); @@ -120,7 +120,7 @@ void WhatsAppProto::RecvMsgWorker(void *p) void WhatsAppProto::onIsTyping(const std::string& paramString, bool paramBoolean) { - HCONTACT hContact = this->AddToContactList(paramString, 0, false); + MCONTACT hContact = this->AddToContactList(paramString, 0, false); if (hContact != NULL) { CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, (LPARAM) @@ -129,7 +129,7 @@ void WhatsAppProto::onIsTyping(const std::string& paramString, bool paramBoolean } -int WhatsAppProto::UserIsTyping(HCONTACT hContact,int type) +int WhatsAppProto::UserIsTyping(MCONTACT hContact,int type) { if (hContact && isOnline()) ForkThread(&WhatsAppProto::SendTypingWorker, new send_typing(hContact, type)); @@ -165,7 +165,7 @@ void WhatsAppProto::onMessageStatusUpdate(FMessage* fmsg) { debugLogA(""); - HCONTACT hContact = this->ContactIDToHContact(fmsg->key->remote_jid); + MCONTACT hContact = this->ContactIDToHContact(fmsg->key->remote_jid); if (hContact == 0) return; diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 1430969639..4b142f0d47 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -61,7 +61,7 @@ int WhatsAppProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) return 0; } -DWORD_PTR WhatsAppProto::GetCaps( int type, HCONTACT hContact ) +DWORD_PTR WhatsAppProto::GetCaps( int type, MCONTACT hContact ) { switch(type) { @@ -134,12 +134,12 @@ int WhatsAppProto::SetStatus( int new_status ) return 0; } -HCONTACT WhatsAppProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT WhatsAppProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { return NULL; } -int WhatsAppProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message) +int WhatsAppProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) { return this->RequestFriendship((WPARAM)hContact, NULL); } @@ -314,7 +314,7 @@ int WhatsAppProto::RequestFriendship(WPARAM wParam, LPARAM lParam) if (wParam == NULL || isOffline()) return 0; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); DBVARIANT dbv; if ( !getString(hContact, WHATSAPP_KEY_ID, &dbv)) @@ -363,7 +363,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, message, wParam, lParam); }; -void WhatsAppProto::NotifyEvent(const string& title, const string& info, HCONTACT contact, DWORD flags, TCHAR* url) +void WhatsAppProto::NotifyEvent(const string& title, const string& info, MCONTACT contact, DWORD flags, TCHAR* url) { TCHAR* rawTitle = mir_a2t_cp(title.c_str(), CP_UTF8); TCHAR* rawInfo = mir_a2t_cp(info.c_str(), CP_UTF8); @@ -372,7 +372,7 @@ void WhatsAppProto::NotifyEvent(const string& title, const string& info, HCONTAC mir_free(rawInfo); } -void WhatsAppProto::NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, TCHAR* szUrl) +void WhatsAppProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, TCHAR* szUrl) { int ret; int timeout; COLORREF colorBack = 0; COLORREF colorText = 0; diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 5b1862464a..4e0d36db42 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -32,23 +32,23 @@ public: //PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason ) { return 1; } - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ) { return 1; } - virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ) { return 1; } + virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ) { return NULL; } - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ) { return NULL; } - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ) { return 1; } - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ) { return 1; } + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ) { return NULL; } + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ) { return 1; } + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ) { return 1; } virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ) { return 1; } - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ) { return 1; } + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ) { return 1; } virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ) { return NULL; } @@ -56,25 +56,25 @@ public: virtual HWND __cdecl SearchAdvanced( HWND owner ) { return NULL; } virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ) { return NULL; } - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* ) { return 1; } - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* ) { return 1; } - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* ) { return 1; } + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT* ) { return 1; } + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT* ) { return 1; } + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* ) { return 1; } - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { return 1; } - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) { return NULL; } - virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg ); - virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url ) { return 1; } + virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) { return NULL; } + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ) { return 1; } - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ) { return 1; } + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode ) { return 1; } virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact ) { return NULL; } - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt ) { return 1; } - virtual int __cdecl SendAwayMsg(HCONTACT hContact, HANDLE hProcess, const char* msg ) { return 1; } + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact ) { return NULL; } + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt ) { return 1; } + virtual int __cdecl SendAwayMsg(MCONTACT hContact, HANDLE hProcess, const char* msg ) { return 1; } virtual int __cdecl SetAwayMsg( int iStatus, const PROTOCHAR* msg ) { return 1; } - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam ) { return 1; } @@ -120,18 +120,18 @@ public: void __cdecl SendCreateGroupWorker(void*); // Contacts handling - HCONTACT AddToContactList(const std::string& jid, BYTE type = 0, bool dont_check = false, + MCONTACT AddToContactList(const std::string& jid, BYTE type = 0, bool dont_check = false, const char *new_name = NULL, bool isChatRoom = false, bool isHidden = false); - bool IsMyContact(HCONTACT hContact, bool include_chat = false); - HCONTACT ContactIDToHContact(const std::string&); + bool IsMyContact(MCONTACT hContact, bool include_chat = false); + MCONTACT ContactIDToHContact(const std::string&); void SetAllContactStatuses(int status, bool reset_client = false); - void UpdateStatusMsg(HCONTACT hContact); - string GetContactDisplayName(HCONTACT hContact); + void UpdateStatusMsg(MCONTACT hContact); + string GetContactDisplayName(MCONTACT hContact); string GetContactDisplayName(const string& jid); void InitContactMenus(); void HandleReceiveGroups(const std::vector& groups, bool isOwned); - bool IsGroupChat(HCONTACT hC, bool checkIsAdmin = false) + bool IsGroupChat(MCONTACT hC, bool checkIsAdmin = false) { return getByte(hC, "SimpleChatRoom", 0) > (checkIsAdmin ? 1 : 0); } @@ -165,8 +165,8 @@ public: string phoneNumber; string jid; string nick; - std::map hContactByJid; - map> isMemberByGroupContact; + std::map hContactByJid; + map> isMemberByGroupContact; // WhatsApp Events virtual void onMessageForMe(FMessage* paramFMessage, bool paramBoolean); @@ -205,8 +205,8 @@ public: virtual void onLeaveGroup(const std::string& paramString); // Information providing - void NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, TCHAR* url = NULL); - void NotifyEvent(const string& title, const string& info, HCONTACT contact, DWORD flags, TCHAR* url = NULL); + void NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, TCHAR* url = NULL); + void NotifyEvent(const string& title, const string& info, MCONTACT contact, DWORD flags, TCHAR* url = NULL); }; #endif \ No newline at end of file diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index f76129f12d..ed1ef25743 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -40,7 +40,7 @@ char *GetIconDescription(const char* name) HGENMENU g_hContactMenuItems[CMITEMS_COUNT]; // Helper functions -static WhatsAppProto* GetInstanceByHContact(HCONTACT hContact) +static WhatsAppProto* GetInstanceByHContact(MCONTACT hContact) { char *proto = GetContactProto(hContact); if( !proto ) @@ -56,14 +56,14 @@ static WhatsAppProto* GetInstanceByHContact(HCONTACT hContact) template INT_PTR GlobalService(WPARAM wParam,LPARAM lParam) { - WhatsAppProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + WhatsAppProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? (proto->*Fcn)(wParam,lParam) : 0; } template INT_PTR GlobalServiceParam(WPARAM wParam,LPARAM lParam, LPARAM lParam2) { - WhatsAppProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + WhatsAppProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? (proto->*Fcn)(wParam,lParam,lParam2) : 0; } @@ -72,7 +72,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) for (size_t i=0; iOnPrebuildContactMenu(wParam,lParam) : 0; } @@ -104,7 +104,7 @@ void WhatsAppProto::InitContactMenus() int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); if (hContact) debugLogA(this->GetContactDisplayName(hContact).c_str()); else @@ -144,10 +144,10 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) svcName += "/AddContactToGroup_"; DBVARIANT dbv; - for (map>::iterator it = this->isMemberByGroupContact.begin(); + for (map>::iterator it = this->isMemberByGroupContact.begin(); it != this->isMemberByGroupContact.end(); ++it) { - map::iterator memberIt = it->second.find(hContact); + map::iterator memberIt = it->second.find(hContact); // Only, if current contact is not already member of this group if ((memberIt == it->second.end() || memberIt->second == false) && !getString(it->first, "ID", &dbv)) { @@ -184,7 +184,7 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) bool bShow = false; if (isOnline() && getByte(hContact, "IsGroupMember", 0) == 1) { - map>::iterator groupsIt = this->isMemberByGroupContact.find(hContact); + map>::iterator groupsIt = this->isMemberByGroupContact.find(hContact); if (groupsIt == this->isMemberByGroupContact.end()) { debugLogA("Group exists only on contact list"); @@ -199,7 +199,7 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) svcName += "/RemoveContactFromGroup_"; DBVARIANT dbv; - for (map::iterator it = groupsIt->second.begin(); it != groupsIt->second.end(); ++it) + for (map::iterator it = groupsIt->second.begin(); it != groupsIt->second.end(); ++it) { if (!getString(it->first, "ID", &dbv)) { diff --git a/protocols/Xfire/src/Xfire_avatar_loader.cpp b/protocols/Xfire/src/Xfire_avatar_loader.cpp index 674329f762..b27b755059 100644 --- a/protocols/Xfire/src/Xfire_avatar_loader.cpp +++ b/protocols/Xfire/src/Xfire_avatar_loader.cpp @@ -66,7 +66,7 @@ void Xfire_avatar_loader::loadThread(LPVOID lparam) { return; } -BOOL Xfire_avatar_loader::loadAvatar(HCONTACT hcontact,char*username,unsigned int userid) +BOOL Xfire_avatar_loader::loadAvatar(MCONTACT hcontact,char*username,unsigned int userid) { Xfire_avatar_process process={0}; diff --git a/protocols/Xfire/src/Xfire_avatar_loader.h b/protocols/Xfire/src/Xfire_avatar_loader.h index c6305270d1..92b89184e1 100644 --- a/protocols/Xfire/src/Xfire_avatar_loader.h +++ b/protocols/Xfire/src/Xfire_avatar_loader.h @@ -1,21 +1,21 @@ /* * Plugin of miranda IM(ICQ) for Communicating with users of the XFire Network. * - * Copyright (C) 2009 by - * dufte - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * Copyright (C) 2009 by + * dufte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * @@ -37,7 +37,7 @@ using namespace xfirelib; struct Xfire_avatar_process { - HCONTACT hcontact; + MCONTACT hcontact; char username[128]; unsigned int userid; }; @@ -50,7 +50,7 @@ private: public: vector list; BOOL threadrunning; - BOOL loadAvatar(HCONTACT hcontact,char*username,unsigned int userid); + BOOL loadAvatar(MCONTACT hcontact,char*username,unsigned int userid); Xfire_avatar_loader(xfirelib::Client* client); ~Xfire_avatar_loader(); }; diff --git a/protocols/Xfire/src/baseProtocol.h b/protocols/Xfire/src/baseProtocol.h index 64abc5720c..7bd05730a1 100644 --- a/protocols/Xfire/src/baseProtocol.h +++ b/protocols/Xfire/src/baseProtocol.h @@ -58,7 +58,7 @@ INT_PTR GetStatus(WPARAM wParam,LPARAM lParam); INT_PTR TMLoadIcon(WPARAM wParam,LPARAM lParam); INT_PTR SetNickName(WPARAM newnick, LPARAM lparam); -BOOL IsXFireContact(HCONTACT h); +BOOL IsXFireContact(MCONTACT h); int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hhicon=NULL); BOOL CreateToolTip(int toolID, HWND hDlg, CHAR* pText); void EnableDlgItem(HWND hwndDlg, UINT control, int state); @@ -155,7 +155,7 @@ struct XFire_FoundGame struct XFire_SetAvatar { - HCONTACT hContact; + MCONTACT hContact; char* username; }; diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp index a7f2ba8042..315c3e2a6e 100644 --- a/protocols/Xfire/src/buddylist.cpp +++ b/protocols/Xfire/src/buddylist.cpp @@ -36,7 +36,7 @@ //buddylist verarbeitung von der main in buddylist verschoben, um doppelte schleifenverarbeitung zuunterbinden #include "baseProtocol.h" -extern HCONTACT handlingBuddys(xfirelib::BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE); +extern MCONTACT handlingBuddys(xfirelib::BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE); extern void setBuddyStatusMsg(xfirelib::BuddyListEntry *entry); namespace xfirelib { diff --git a/protocols/Xfire/src/buddylist.h b/protocols/Xfire/src/buddylist.h index ee6f2a22b4..13fdd0b02d 100644 --- a/protocols/Xfire/src/buddylist.h +++ b/protocols/Xfire/src/buddylist.h @@ -83,7 +83,7 @@ namespace xfirelib { string gameinfo; long game; long game2; - HCONTACT hcontact; + MCONTACT hcontact; int clanid; //lastpopup diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 51d217717f..e331f44302 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -148,13 +148,13 @@ INT_PTR RecvMessage(WPARAM wParam, LPARAM lParam); INT_PTR SendMessage(WPARAM wParam, LPARAM lParam); int FillList(WPARAM wParam, LPARAM lParam); -HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan); -HCONTACT CList_FindContact (int uid); +MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan); +MCONTACT CList_FindContact (int uid); void CList_MakeAllOffline(); static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam); HANDLE LoadGameIcon(char* g, int id, HICON* ico,BOOL onyico=FALSE,char * gamename=NULL,int*uu=NULL); BOOL GetAvatar(char* username,XFireAvatar* av); -//void SetAvatar(HCONTACT hContact, char* username); +//void SetAvatar(MCONTACT hContact, char* username); static void SetAvatar(LPVOID lparam); static INT_PTR GetIPPort(WPARAM /*wParam*/,LPARAM lParam); static INT_PTR GetVIPPort(WPARAM /*wParam*/,LPARAM lParam); @@ -187,7 +187,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam); INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam); static INT_PTR GotoProfile2(WPARAM wParam,LPARAM lParam); -HCONTACT handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE); +MCONTACT handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE); int StatusIcon(WPARAM wParam,LPARAM lParam); void CreateGroup(char*grpn,char*field); //void CreateGroup(char*grp); @@ -221,7 +221,7 @@ class XFireClient : public PacketListener { void getBuddyList(); void sendmsg(char*usr,char*msg); void setNick(char*nnick); - void handlingBuddy(HCONTACT handle); + void handlingBuddy(MCONTACT handle); void CheckAvatar(BuddyListEntry* entry); private: @@ -259,7 +259,7 @@ void XFireClient::CheckAvatar(BuddyListEntry* entry) { } } -void XFireClient::handlingBuddy(HCONTACT handle) +void XFireClient::handlingBuddy(MCONTACT handle) { vector *entries = client->getBuddyList()->getEntries(); for(uint i = 0 ; i < entries->size() ; i ++) { @@ -515,7 +515,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) { db_free(&dbv); } CreateGroup(Translate(fofname),"fofgroup"); - HCONTACT hc=handlingBuddys(entry,-1,Translate(fofname)); + MCONTACT hc=handlingBuddys(entry,-1,Translate(fofname)); if (hc) { CheckAvatar(entry); @@ -609,7 +609,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) { xfire_newc.nick=(char*)invite->nick.c_str(); xfire_newc.id=0; - HCONTACT handle = CList_AddContact(xfire_newc,TRUE,TRUE,0); + MCONTACT handle = CList_AddContact(xfire_newc,TRUE,TRUE,0); if (handle) { // invite nachricht mitsenden string str = (char*)invite->msg.c_str(); @@ -999,7 +999,7 @@ int ExtraListRebuild(WPARAM wparam, LPARAM lparam) int ExtraImageApply1(WPARAM wparam, LPARAM lparam) { - HCONTACT hContact = (HCONTACT)wparam; + MCONTACT hContact = (MCONTACT)wparam; char *szProto = GetContactProto(hContact); if (szProto != NULL && !lstrcmpiA(szProto, protocolname) && db_get_w(hContact, protocolname, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) { int gameid = db_get_w(hContact, protocolname, "GameId", 0); @@ -1011,7 +1011,7 @@ int ExtraImageApply1(WPARAM wparam, LPARAM lparam) int ExtraImageApply2(WPARAM wparam, LPARAM lparam) { - HCONTACT hContact=(HCONTACT)wparam; + MCONTACT hContact=(MCONTACT)wparam; // TODO: maybe need to fix extra icons char *szProto = GetContactProto(hContact); if ( szProto != NULL && !lstrcmpiA( szProto, protocolname ) && db_get_w(hContact, protocolname, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) { @@ -1327,17 +1327,17 @@ static void SetStatusLate( LPVOID param ) static void SendAck( LPVOID param ) { - ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0); + ProtoBroadcastAck(protocolname, (MCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0); } static void SendBadAck( LPVOID param ) { - ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!"))); + ProtoBroadcastAck(protocolname, (MCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!"))); } static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (lParam==PROTOTYPE_SELFTYPING_ON) @@ -1595,15 +1595,15 @@ INT_PTR GetStatus(WPARAM wParam,LPARAM lParam) return ID_STATUS_OFFLINE; } -HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan) +MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan) { - HCONTACT hContact; + MCONTACT hContact; if (xfc.username == NULL) return 0; // here we create a new one since no one is to be found - hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); if ( hContact ) { CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)protocolname ); @@ -1665,7 +1665,7 @@ HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan return false; } -BOOL IsXFireContact(HCONTACT hContact) +BOOL IsXFireContact(MCONTACT hContact) { char *szProto = GetContactProto(hContact); if (szProto != NULL && !lstrcmpiA(szProto, protocolname)) @@ -1674,9 +1674,9 @@ BOOL IsXFireContact(HCONTACT hContact) return FALSE; } -HCONTACT CList_FindContact (int uid) +MCONTACT CList_FindContact (int uid) { - for (HCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) + for (MCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) if ( db_get_dw(hContact, protocolname, "UserId", -1) == uid) return hContact; @@ -1685,8 +1685,8 @@ HCONTACT CList_FindContact (int uid) void CList_MakeAllOffline() { - vector fhandles; - for (HCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) { + vector fhandles; + for (MCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) { //freunde von freunden in eine seperate liste setzen //nur wenn das nicht abgestellt wurde if (db_get_b(hContact,protocolname,"friendoffriend",0)==1 && db_get_b(NULL,protocolname,"fofdbremove",0)==1) @@ -1767,7 +1767,7 @@ void SetAvatar2(LPVOID lparam) { } void SetAvatar(LPVOID lparam) -//void SetAvatar(HCONTACT hContact, char* username) +//void SetAvatar(MCONTACT hContact, char* username) { //EnterCriticalSection(&avatarMutex); //WaitForSingleObject(hMutex, INFINITE); @@ -1929,14 +1929,14 @@ static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam) HGLOBAL clipbuffer; char* buffer; - if (db_get_w((HCONTACT)wParam, protocolname, "Port", -1)==0) + if (db_get_w((MCONTACT)wParam, protocolname, "Port", -1)==0) return 0; DBVARIANT dbv; - if (db_get_s((HCONTACT)wParam, protocolname, "ServerIP",&dbv)) + if (db_get_s((MCONTACT)wParam, protocolname, "ServerIP",&dbv)) return 0; - mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "Port", -1)); + mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((MCONTACT)wParam, protocolname, "Port", -1)); db_free(&dbv); @@ -1962,14 +1962,14 @@ static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam) HGLOBAL clipbuffer; char* buffer; - if (db_get_w((HCONTACT)wParam, protocolname, "VPort", -1)==0) + if (db_get_w((MCONTACT)wParam, protocolname, "VPort", -1)==0) return 0; DBVARIANT dbv; - if (db_get_s((HCONTACT)wParam, protocolname, "VServerIP",&dbv)) + if (db_get_s((MCONTACT)wParam, protocolname, "VServerIP",&dbv)) return 0; - mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "VPort", -1)); + mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((MCONTACT)wParam, protocolname, "VPort", -1)); db_free(&dbv); @@ -1994,7 +1994,7 @@ static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam) DBVARIANT dbv; char temp[64]=""; - if (db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv)) + if (db_get_s((MCONTACT)wParam, protocolname, "Username",&dbv)) return 0; strcpy(temp,"http://xfire.com/profile/"); @@ -2010,7 +2010,7 @@ static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) { DBVARIANT dbv; char temp[64]=""; - int clanid=db_get_dw((HCONTACT)wParam, protocolname, "Clan",-1); + int clanid=db_get_dw((MCONTACT)wParam, protocolname, "Clan",-1); mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clanid); if (db_get_s(NULL, protocolname, temp,&dbv)) @@ -2071,7 +2071,7 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam) int RebuildContactMenu( WPARAM wParam, LPARAM lParam ) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; bool bEnabled = true, bEnabled2 = true; DBVARIANT dbv; @@ -2685,9 +2685,9 @@ void setBuddyStatusMsg(BuddyListEntry *entry) } }*/ -HCONTACT handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan) +MCONTACT handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan) { - HCONTACT hContact; + MCONTACT hContact; string game; if (entry==NULL) @@ -3254,14 +3254,14 @@ INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam) int ContactDeleted(WPARAM wParam,LPARAM lParam) { - if (!db_get_b((HCONTACT)wParam, protocolname, "DontSendDenyPacket", 0)) - if (db_get_b((HCONTACT)wParam,"CList","NotOnList",0)) + if (!db_get_b((MCONTACT)wParam, protocolname, "DontSendDenyPacket", 0)) + if (db_get_b((MCONTACT)wParam,"CList","NotOnList",0)) { if (myClient!=NULL) if (myClient->client->connected) { DBVARIANT dbv2; - if (!db_get((HCONTACT)wParam,protocolname,"Username",&dbv2)) { + if (!db_get((MCONTACT)wParam,protocolname,"Username",&dbv2)) { SendDenyInvitationPacket deny; deny.name = dbv2.pszVal; myClient->client->send( &deny ); @@ -3294,7 +3294,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) char temp[256]; DBVARIANT dbv; - if (!db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv)) + if (!db_get_s((MCONTACT)wParam, protocolname, "Username",&dbv)) { mir_snprintf(temp, SIZEOF(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal); if (MessageBoxA(NULL,temp,Translate("Confirm Delete"),MB_YESNO|MB_ICONQUESTION)==IDYES) @@ -3305,7 +3305,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) { SendRemoveBuddyPacket removeBuddy; - removeBuddy.userid=db_get_dw((HCONTACT)wParam,protocolname,"UserId",0); + removeBuddy.userid=db_get_dw((MCONTACT)wParam,protocolname,"UserId",0); if (removeBuddy.userid!=0) { @@ -3323,7 +3323,7 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam) { DBVARIANT dbv; - if (!db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv)) + if (!db_get_s((MCONTACT)wParam, protocolname, "Username",&dbv)) { if (MessageBox(NULL,TranslateT("Block this user from ever contacting you again?"),TranslateT("Block Confirmation"),MB_YESNO|MB_ICONQUESTION)==IDYES) { @@ -3350,7 +3350,7 @@ INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) { xgamelist.Block(TRUE); //hole die gameid des spiels - int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0); + int id=db_get_w((MCONTACT)wParam, protocolname, "GameId",0); //hole passendes spielobjekt Xfire_game*game=xgamelist.getGamebyGameid(id); @@ -3370,7 +3370,7 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) { xgamelist.Block(TRUE); //hole die gameid des spiels - int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0); + int id=db_get_w((MCONTACT)wParam, protocolname, "GameId",0); //hole passendes spielobjekt Xfire_game*game=xgamelist.getGamebyGameid(id); @@ -3379,8 +3379,8 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) { if (game) { DBVARIANT dbv; //dbv.pszVal - int port=db_get_w((HCONTACT)wParam, protocolname, "Port",0); - if (!db_get_s((HCONTACT)wParam, protocolname, "ServerIP",&dbv)) + int port=db_get_w((MCONTACT)wParam, protocolname, "Port",0); + if (!db_get_s((MCONTACT)wParam, protocolname, "ServerIP",&dbv)) { //starte spiel mit netzwerk parametern game->start_game(dbv.pszVal,port); diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp index 28eb283f66..014894cf54 100644 --- a/protocols/Xfire/src/processbuddyinfo.cpp +++ b/protocols/Xfire/src/processbuddyinfo.cpp @@ -27,7 +27,7 @@ extern HANDLE XFireAvatarFolder; return h; }*/ -void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HCONTACT hcontact,char* username) { +void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,MCONTACT hcontact,char* username) { char temp[255] = ""; char filename[1024] = ""; BOOL dl=FALSE; diff --git a/protocols/Xfire/src/processbuddyinfo.h b/protocols/Xfire/src/processbuddyinfo.h index e4fad3b387..c9f3e396b9 100644 --- a/protocols/Xfire/src/processbuddyinfo.h +++ b/protocols/Xfire/src/processbuddyinfo.h @@ -4,4 +4,4 @@ #include "getbuddyinfo.h" #include "buddyinfo.h" -void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, HCONTACT hcontact,char* username); \ No newline at end of file +void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact,char* username); diff --git a/protocols/Xfire/src/recvremovebuddypacket.h b/protocols/Xfire/src/recvremovebuddypacket.h index 842163ad1a..c617215d66 100644 --- a/protocols/Xfire/src/recvremovebuddypacket.h +++ b/protocols/Xfire/src/recvremovebuddypacket.h @@ -47,7 +47,7 @@ namespace xfirelib { * (it will be set by the BuddyList, not when parsing the packet) */ std::string username; - HCONTACT handle; // handle eingefügt, damit ich schnell den buddy killen kann - dufte + MCONTACT handle; // handle eingefügt, damit ich schnell den buddy killen kann - dufte }; }; diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index d2301f4fe6..1db5474f2f 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -61,7 +61,7 @@ void LoadProfilStatus(LPVOID lparam) { delete[] lparam; } -void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HCONTACT hcontact,int type) +void SetItemTxt(HWND hwndDlg,int feldid,char*feld,MCONTACT hcontact,int type) { DBVARIANT dbv; if (!db_get(hcontact,protocolname,feld,&dbv)) { @@ -85,20 +85,20 @@ void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HCONTACT hcontact,int type) } } -static int GetIPPortUDetails(HCONTACT wParam,char* feld1,char* feld2) +static int GetIPPortUDetails(MCONTACT wParam,char* feld1,char* feld2) { char temp[255]; HGLOBAL clipbuffer; char* buffer; - if (db_get_w((HCONTACT)wParam, protocolname, feld2, -1)==0) + if (db_get_w((MCONTACT)wParam, protocolname, feld2, -1)==0) return 0; DBVARIANT dbv; - if (db_get_s((HCONTACT)wParam, protocolname, feld1,&dbv)) + if (db_get_s((MCONTACT)wParam, protocolname, feld1,&dbv)) return 0; - mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, feld2, -1)); + mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((MCONTACT)wParam, protocolname, feld2, -1)); db_free(&dbv); @@ -118,7 +118,7 @@ static int GetIPPortUDetails(HCONTACT wParam,char* feld1,char* feld2) return 0; } -void addToList(HWND listbox,HCONTACT hContact,char*key,char*val) +void addToList(HWND listbox,MCONTACT hContact,char*key,char*val) { DBVARIANT dbv; if (!db_get(hContact,protocolname,val,&dbv)) @@ -185,7 +185,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam static WCHAR wpath[256]; static HICON gameicon=0; static HICON voiceicon=0; - static HCONTACT uhandle=0; + static MCONTACT uhandle=0; static HWND listbox; LVCOLUMNA pcol; @@ -245,7 +245,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam case PSN_INFOCHANGED: { char* szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; uhandle=hContact; //handle sichern if (hContact == NULL) @@ -370,7 +370,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam case PSN_INFOCHANGED: { char* szProto; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact == NULL) szProto = protocolname; @@ -429,7 +429,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam int OnDetailsInit(WPARAM wParam,LPARAM lParam) { - if (!IsXFireContact((HCONTACT)lParam)) + if (!IsXFireContact((MCONTACT)lParam)) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 4eb38181ac..063231212a 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -171,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 hContact = getbuddyH(avt->who); + MCONTACT hContact = getbuddyH(avt->who); if (!hContact) { LOG(("ERROR: Can't find buddy: %s", avt->who)); @@ -258,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) { - HCONTACT hContact = 0; + MCONTACT hContact = 0; LOG(("[ext_yahoo_got_picture] for %s with url %s (checksum: %d) type: %d", who, pic_url, cksum, type)); @@ -450,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) { - HCONTACT hContact = 0; + MCONTACT hContact = 0; LOG(("ext_yahoo_got_picture_checksum for %s checksum: %d", who, cksum)); @@ -488,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) { - HCONTACT hContact = 0; + MCONTACT hContact = 0; LOG(("ext_got_picture_update for %s buddy_icon: %d", who, buddy_icon)); @@ -506,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) { - HCONTACT hContact = 0; + MCONTACT hContact = 0; LOG(("ext_yahoo_got_picture_status for %s buddy_icon: %d", who, buddy_icon)); @@ -572,7 +572,7 @@ void CYahooProto::ext_got_avatar_share(int buddy_icon) setByte("ShareAvatar", buddy_icon ); } -void CYahooProto::reset_avatar(HCONTACT hContact) +void CYahooProto::reset_avatar(MCONTACT hContact) { LOG(("[YAHOO_RESET_AVATAR]")); @@ -586,7 +586,7 @@ void CYahooProto::request_avatar(const char* who) return; } - HCONTACT hContact = getbuddyH(who); + MCONTACT hContact = getbuddyH(who); if (!hContact) return; @@ -606,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(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type) +void CYahooProto::GetAvatarFileName(MCONTACT 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 75dbf851ea..1130a248af 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); - HCONTACT hContact = getbuddyH(who); + MCONTACT hContact = getbuddyH(who); TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; GCDEST gcd = { m_szModuleName, idt, evt }; @@ -395,17 +395,17 @@ int __cdecl CYahooProto::OnGCMenuHook(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // Invite to chat dialog -static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg) +static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg) { bool root = !hItem; if (root) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) clist_chat_invite_send(hItemT, hwndList, who, room, ppro, msg); } @@ -429,7 +429,7 @@ static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, YList* &who, c } } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } if (root && who) @@ -451,23 +451,23 @@ static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, YList* &who, c } } -static void ClistValidateContact(HCONTACT hItem, HWND hwndList, CYahooProto* ppro) +static void ClistValidateContact(MCONTACT 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(HCONTACT hItem, HWND hwndList, CYahooProto* ppro) +static void ClistChatPrepare(MCONTACT hItem, HWND hwndList, CYahooProto* ppro) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) ClistChatPrepare(hItemT, 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((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); + ClistValidateContact((MCONTACT)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 e83f9d3836..4b2497574a 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, HCONTACT hContact, const char *who, const char *msg, +static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT 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)); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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) { - HCONTACT hContact; + MCONTACT 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(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) +HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) { DBVARIANT dbv; y_filetransfer *sf; @@ -763,7 +763,7 @@ HANDLE __cdecl CYahooProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescr //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CYahooProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE __cdecl CYahooProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { y_filetransfer *ft = (y_filetransfer *)hTransfer; size_t len; @@ -792,7 +792,7 @@ HANDLE __cdecl CYahooProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CYahooProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CYahooProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { debugLogA("[YahooFileCancel]"); @@ -815,7 +815,7 @@ int __cdecl CYahooProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CYahooProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR*) +int __cdecl CYahooProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR*) { /* deny file receive request.. just ignore it! */ y_filetransfer *ft = (y_filetransfer *)hTransfer; diff --git a/protocols/Yahoo/src/file_transfer.h b/protocols/Yahoo/src/file_transfer.h index cdbacd9c32..b57a56867d 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; - HCONTACT hContact; + MCONTACT hContact; int cancel; char *url; HANDLE hWaitEvent; diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index fc295a4a42..b85ce78357 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)); - HCONTACT hContact = add_buddy(who, who, protocol, PALF_TEMPORARY); + MCONTACT hContact = add_buddy(who, who, protocol, PALF_TEMPORARY); //setWord(hContact, "yprotoid", protocol); Set_Protocol(hContact, protocol); @@ -154,24 +154,24 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons void __cdecl CYahooProto::im_sendacksuccess(void *hContact) { - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0); } void __cdecl CYahooProto::im_sendackfail(void *hContact) { SleepEx(1000, TRUE); - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)Translate("The message send timed out.")); } void __cdecl CYahooProto::im_sendackfail_longmsg(void *hContact) { SleepEx(1000, TRUE); - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, + ProtoBroadcastAck((MCONTACT)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(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CYahooProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { if (!m_bLoggedIn) {/* don't send message if we not connected! */ ForkThread(&CYahooProto::im_sendackfail, (void*)hContact); @@ -207,7 +207,7 @@ int __cdecl CYahooProto::SendMsg(HCONTACT hContact, int flags, const char* pszSr //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CYahooProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CYahooProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { db_unset(hContact, "CList", "Hidden"); @@ -227,7 +227,7 @@ int __cdecl CYahooProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; debugLogA("[YAHOO_SENDNUDGE]"); diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp index d1136a507a..9aef65c76b 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; } - HCONTACT hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */ + MCONTACT 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/proto.cpp b/protocols/Yahoo/src/proto.cpp index b607385fa0..4987c50b34 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -99,7 +99,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -HCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) +MCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) { debugLogA("[YahooAddToList] Flags: %d", flags); @@ -114,7 +114,7 @@ HCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) } char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id) : mir_utf8encode((char*)psr->id); - HCONTACT hContact = getbuddyH(id); + MCONTACT 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); @@ -137,7 +137,7 @@ HCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) return hContact; } -HCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent ) +MCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent ) { debugLogA("[YahooAddToListByEvent]"); if (!m_bLoggedIn) @@ -166,7 +166,7 @@ HCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HAN return 0; } - HCONTACT hContact = DbGetAuthEventContact(&dbei); + MCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) debugLogA("Temp Buddy found at: %p ", hContact); else @@ -201,7 +201,7 @@ int CYahooProto::Authorize( HANDLE hdbe ) return 1; /* Need to remove the buddy from our Miranda Lists */ - HCONTACT hContact = DbGetAuthEventContact(&dbei); + MCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { ptrA who( getStringA(hContact, YAHOO_LOGINID)); if (who) { @@ -246,7 +246,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) } /* Need to remove the buddy from our Miranda Lists */ - HCONTACT hContact = DbGetAuthEventContact(&dbei); + MCONTACT hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { ptrA who( getStringA(hContact, YAHOO_LOGINID)); if (who) { @@ -264,7 +264,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CYahooProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CYahooProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { debugLogA("[YahooRecvAuth] "); db_unset(hContact,"CList","Hidden"); @@ -276,7 +276,7 @@ int __cdecl CYahooProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CYahooProto::AuthRequest(HCONTACT hContact, const TCHAR* msg ) +int __cdecl CYahooProto::AuthRequest(MCONTACT hContact, const TCHAR* msg ) { debugLogA("[YahooSendAuthRequest]"); @@ -299,7 +299,7 @@ HANDLE __cdecl CYahooProto::ChangeInfo( int /*iInfoType*/, void* ) //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CYahooProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CYahooProto::GetCaps(int type, MCONTACT hContact) { switch ( type ) { case PFLAGNUM_1: @@ -334,10 +334,10 @@ DWORD_PTR __cdecl CYahooProto::GetCaps(int type, HCONTACT hContact) void __cdecl CYahooProto::get_info_thread(void *hContact) { SleepEx(500, TRUE); - ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); + ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -int __cdecl CYahooProto::GetInfo(HCONTACT hContact, int /*infoType*/ ) +int __cdecl CYahooProto::GetInfo(MCONTACT hContact, int /*infoType*/ ) { ForkThread(&CYahooProto::get_info_thread, (void*)hContact); return 0; @@ -362,7 +362,7 @@ HANDLE __cdecl CYahooProto::SearchByName( const PROTOCHAR* nick, const PROTOCHAR //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CYahooProto::RecvContacts(HCONTACT/*hContact*/, PROTORECVEVENT*) +int __cdecl CYahooProto::RecvContacts(MCONTACT/*hContact*/, PROTORECVEVENT*) { return 1; } @@ -370,7 +370,7 @@ int __cdecl CYahooProto::RecvContacts(HCONTACT/*hContact*/, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CYahooProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) +int __cdecl CYahooProto::RecvFile(MCONTACT hContact, PROTORECVFILET* evt) { db_unset(hContact, "CList", "Hidden"); @@ -380,7 +380,7 @@ int __cdecl CYahooProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CYahooProto::RecvUrl(HCONTACT/*hContact*/, PROTORECVEVENT*) +int __cdecl CYahooProto::RecvUrl(MCONTACT/*hContact*/, PROTORECVEVENT*) { return 1; } @@ -388,7 +388,7 @@ int __cdecl CYahooProto::RecvUrl(HCONTACT/*hContact*/, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CYahooProto::SendContacts(HCONTACT/*hContact*/, int /*flags*/, int /*nContacts*/, HCONTACT* /*hContactsList*/) +int __cdecl CYahooProto::SendContacts(MCONTACT/*hContact*/, int /*flags*/, int /*nContacts*/, MCONTACT* /*hContactsList*/) { return 1; } @@ -396,7 +396,7 @@ int __cdecl CYahooProto::SendContacts(HCONTACT/*hContact*/, int /*flags*/, int / //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CYahooProto::SendUrl(HCONTACT/*hContact*/, int /*flags*/, const char* /*url*/) +int __cdecl CYahooProto::SendUrl(MCONTACT/*hContact*/, int /*flags*/, const char* /*url*/) { return 1; } @@ -404,7 +404,7 @@ int __cdecl CYahooProto::SendUrl(HCONTACT/*hContact*/, int /*flags*/, const char //////////////////////////////////////////////////////////////////////////////////////// // SetApparentMode - sets the visibility status -int __cdecl CYahooProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CYahooProto::SetApparentMode(MCONTACT hContact, int mode) { if (mode && mode != ID_STATUS_OFFLINE) return 1; @@ -524,7 +524,7 @@ void __cdecl CYahooProto::get_status_thread(void *param) int l; DBVARIANT dbv; char *gm = NULL, *sm = NULL, *fm; - HCONTACT hContact = (HCONTACT)param; + MCONTACT hContact = (MCONTACT)param; Sleep(150); @@ -583,7 +583,7 @@ void __cdecl CYahooProto::get_status_thread(void *param) ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)(TCHAR*)_A2T(fm)); } -HANDLE __cdecl CYahooProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CYahooProto::GetAwayMsg(MCONTACT hContact) { debugLogA("[YahooGetAwayMessage] "); @@ -601,7 +601,7 @@ HANDLE __cdecl CYahooProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CYahooProto::RecvAwayMsg(HCONTACT/*hContact*/, int /*statusMode*/, PROTORECVEVENT*) +int __cdecl CYahooProto::RecvAwayMsg(MCONTACT/*hContact*/, int /*statusMode*/, PROTORECVEVENT*) { return 1; } @@ -674,7 +674,7 @@ INT_PTR __cdecl CYahooProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // UserIsTyping - sends a UTN notification -int __cdecl CYahooProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CYahooProto::UserIsTyping(MCONTACT hContact, int type) { if (!m_bLoggedIn) return 0; diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 667473292b..d01daf5144 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -25,23 +25,23 @@ struct CYahooProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - 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 HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ); @@ -49,25 +49,25 @@ struct CYahooProto : public PROTO virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - 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 RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT 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(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); @@ -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(HCONTACT hContact); + void reset_avatar(MCONTACT hContact); void request_avatar(const char* who); void SendAvatar(const TCHAR *szFile); - void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type); + void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen, int type); //====| chat.cpp |==================================================================== void ChatRegister(void); @@ -223,20 +223,20 @@ struct CYahooProto : public PROTO int __cdecl OnUserInfoInit( WPARAM wParam, LPARAM lParam ); //====| util.cpp |==================================================================== - int GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* ); - DWORD SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue ); + int GetStringUtf(MCONTACT hContact, const char* name, DBVARIANT* ); + DWORD SetStringUtf(MCONTACT hContact, const char* valueName, const char* parValue ); - DWORD Set_Protocol(HCONTACT hContact, int protocol ); + DWORD Set_Protocol(MCONTACT 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(HCONTACT hContact); + bool IsMyContact(MCONTACT hContact); //====| yahoo.cpp |=================================================================== - HCONTACT add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags); + MCONTACT add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags); const char *find_buddy( const char *yahoo_id); - HCONTACT getbuddyH(const char *yahoo_id); + MCONTACT 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(HCONTACT hContact, const char *group, const TCHAR *msg); + void AddBuddy(MCONTACT 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 ebf142a7ab..dc28575a65 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT 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); @@ -83,7 +83,7 @@ void CYahooProto::BroadcastStatus(int s) int __cdecl CYahooProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; debugLogA("[YahooContactDeleted]"); @@ -254,11 +254,11 @@ INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM lParam) /** * We don't show profile for users using other IM clients through the IM server bridge */ - if (getWord((HCONTACT)wParam, "yprotoid", 0) != 0) { + if (getWord((MCONTACT)wParam, "yprotoid", 0) != 0) { return 0; } - if (getString((HCONTACT)wParam, YAHOO_LOGINID, &dbv)) + if (getString((MCONTACT)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 HCONTACT hContact = (HCONTACT)wParam; + const MCONTACT hContact = (MCONTACT)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 79a2c77c64..0f020adbd7 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; - HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + MCONTACT hContact = (MCONTACT)((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; - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)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 2cad148fb1..9550adf4d4 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(HCONTACT hContact, int protocol ) +DWORD CYahooProto::Set_Protocol(MCONTACT hContact, int protocol ) { char *s=NULL; @@ -59,11 +59,11 @@ DWORD CYahooProto::Set_Protocol(HCONTACT hContact, int protocol ) return 0; } -int CYahooProto::GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result) +int CYahooProto::GetStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result) { return db_get_utf(hContact, m_szModuleName, name, result); } -DWORD CYahooProto::SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue) +DWORD CYahooProto::SetStringUtf(MCONTACT 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((HCONTACT)wParam, YAHOO_LOGINID, &dbv)) { - int iAdd = (ID_STATUS_OFFLINE == getWord((HCONTACT)wParam, "ApparentMode", 0)); + if (!getString((MCONTACT)wParam, YAHOO_LOGINID, &dbv)) { + int iAdd = (ID_STATUS_OFFLINE == getWord((MCONTACT)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(HCONTACT hContact) +bool CYahooProto::IsMyContact(MCONTACT hContact) { if (!hContact) return false; diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index ef7fcfb7c0..fc4debb1f5 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(HCONTACT hContact, const char *group, const TCHAR *msg) +void CYahooProto::AddBuddy(MCONTACT 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(HCONTACT hContact, const char *group, const TCHAR *ms mir_free(u_msg); } -HCONTACT CYahooProto::getbuddyH(const char *yahoo_id) +MCONTACT CYahooProto::getbuddyH(const char *yahoo_id) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT 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 @@ HCONTACT CYahooProto::getbuddyH(const char *yahoo_id) return NULL; } -HCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags) +MCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags) { char *yid = NEWSTR_ALLOCA(yahoo_id); strlwr(yid); - HCONTACT hContact = getbuddyH(yid); + MCONTACT 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 @@ HCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in //not already there: add LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags)); - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)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 @@ HCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in const char* CYahooProto::find_buddy( const char *yahoo_id) { static char nick[128]; - HCONTACT hContact; + MCONTACT 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); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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)); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT 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) { - HCONTACT hContact; + MCONTACT 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)); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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) { - HCONTACT hContact=getbuddyH(who); + MCONTACT 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; - HCONTACT hContact = NULL; + MCONTACT 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)); - HCONTACT hContact = getbuddyH(who); + MCONTACT 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 */ - HCONTACT hContact = getbuddyH(who); + MCONTACT hContact = getbuddyH(who); if (!hContact) return; -- cgit v1.2.3