summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/avatars.cpp12
-rw-r--r--protocols/AimOscar/src/chat.cpp6
-rw-r--r--protocols/AimOscar/src/file.cpp4
-rw-r--r--protocols/AimOscar/src/file.h8
-rw-r--r--protocols/AimOscar/src/links.cpp4
-rw-r--r--protocols/AimOscar/src/proto.cpp42
-rw-r--r--protocols/AimOscar/src/proto.h71
-rw-r--r--protocols/AimOscar/src/server.cpp24
-rw-r--r--protocols/AimOscar/src/services.cpp21
-rw-r--r--protocols/AimOscar/src/theme.cpp16
-rw-r--r--protocols/AimOscar/src/theme.h2
-rw-r--r--protocols/AimOscar/src/ui.cpp60
-rw-r--r--protocols/AimOscar/src/utility.cpp40
-rw-r--r--protocols/EmLanProto/src/mlan.cpp27
-rw-r--r--protocols/EmLanProto/src/mlan.h6
-rw-r--r--protocols/FacebookRM/src/avatars.cpp2
-rw-r--r--protocols/FacebookRM/src/chat.cpp8
-rw-r--r--protocols/FacebookRM/src/communication.cpp2
-rw-r--r--protocols/FacebookRM/src/contacts.cpp32
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp19
-rw-r--r--protocols/FacebookRM/src/entities.h10
-rw-r--r--protocols/FacebookRM/src/events.cpp2
-rw-r--r--protocols/FacebookRM/src/json.cpp6
-rw-r--r--protocols/FacebookRM/src/messages.cpp12
-rw-r--r--protocols/FacebookRM/src/process.cpp14
-rw-r--r--protocols/FacebookRM/src/proto.cpp30
-rw-r--r--protocols/FacebookRM/src/proto.h64
-rw-r--r--protocols/FacebookRM/src/stubs.cpp26
-rw-r--r--protocols/FacebookRM/src/theme.cpp8
-rw-r--r--protocols/GTalkExt/src/avatar.cpp8
-rw-r--r--protocols/GTalkExt/src/db.cpp2
-rw-r--r--protocols/GTalkExt/src/handlers.cpp2
-rw-r--r--protocols/GTalkExt/src/notifications.cpp18
-rw-r--r--protocols/GTalkExt/src/notifications.h2
-rw-r--r--protocols/GTalkExt/src/stdafx.h2
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp32
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp52
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/gg.h4
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp38
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h64
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp30
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp32
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp30
-rw-r--r--protocols/IRCG/src/input.cpp10
-rw-r--r--protocols/IRCG/src/irc.h158
-rw-r--r--protocols/IRCG/src/irclib.cpp6
-rw-r--r--protocols/IRCG/src/irclib.h16
-rw-r--r--protocols/IRCG/src/ircproto.cpp48
-rw-r--r--protocols/IRCG/src/scripting.cpp6
-rw-r--r--protocols/IRCG/src/services.cpp42
-rw-r--r--protocols/IRCG/src/ui_utils.cpp4
-rw-r--r--protocols/IRCG/src/ui_utils.h4
-rw-r--r--protocols/IRCG/src/userinfo.cpp12
-rw-r--r--protocols/IcqOscarJ/src/UI/askauthentication.cpp4
-rw-r--r--protocols/IcqOscarJ/src/UI/userinfotab.cpp6
-rw-r--r--protocols/IcqOscarJ/src/capabilities.cpp12
-rw-r--r--protocols/IcqOscarJ/src/cookies.cpp17
-rw-r--r--protocols/IcqOscarJ/src/cookies.h6
-rw-r--r--protocols/IcqOscarJ/src/directpackets.cpp12
-rw-r--r--protocols/IcqOscarJ/src/fam_01service.cpp6
-rw-r--r--protocols/IcqOscarJ/src/fam_02location.cpp19
-rw-r--r--protocols/IcqOscarJ/src/fam_03buddy.cpp6
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp161
-rw-r--r--protocols/IcqOscarJ/src/fam_09bos.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_13servclist.cpp22
-rw-r--r--protocols/IcqOscarJ/src/fam_15icqserver.cpp10
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp12
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.h6
-rw-r--r--protocols/IcqOscarJ/src/icq_clients.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_db.cpp36
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.cpp14
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.h4
-rw-r--r--protocols/IcqOscarJ/src/icq_directmsg.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_filerequests.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_infoupdate.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_menu.cpp32
-rw-r--r--protocols/IcqOscarJ/src/icq_popups.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp46
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h359
-rw-r--r--protocols/IcqOscarJ/src/icq_rates.h2
-rw-r--r--protocols/IcqOscarJ/src/icq_server.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp117
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.h6
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp14
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp22
-rw-r--r--protocols/IcqOscarJ/src/icq_xtraz.cpp12
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp22
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp18
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.h4
-rw-r--r--protocols/IcqOscarJ/src/stdpackets.cpp26
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp88
-rw-r--r--protocols/IcqOscarJ/src/utilities.h10
-rw-r--r--protocols/JabberG/src/jabber.h6
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_api.cpp4
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp8
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp22
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp14
-rw-r--r--protocols/JabberG/src/jabber_events.cpp10
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp10
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp6
-rw-r--r--protocols/JabberG/src/jabber_iq.h4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp24
-rw-r--r--protocols/JabberG/src/jabber_list.h4
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp67
-rw-r--r--protocols/JabberG/src/jabber_message_manager.h4
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp26
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp4
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp12
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp61
-rw-r--r--protocols/JabberG/src/jabber_proto.h94
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_std.cpp4
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp6
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp22
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp24
-rw-r--r--protocols/JabberG/src/jabber_util.cpp14
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp28
-rw-r--r--protocols/JabberG/src/jabber_xstatus.h16
-rw-r--r--protocols/JabberG/src/ui_utils.cpp4
-rw-r--r--protocols/JabberG/src/ui_utils.h4
-rw-r--r--protocols/MRA/src/Mra.h20
-rw-r--r--protocols/MRA/src/MraAvatars.cpp16
-rw-r--r--protocols/MRA/src/MraChat.cpp24
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp6
-rw-r--r--protocols/MRA/src/MraPopUp.cpp4
-rw-r--r--protocols/MRA/src/MraProto.cpp44
-rw-r--r--protocols/MRA/src/MraProto.h158
-rw-r--r--protocols/MRA/src/MraSelectEMail.cpp6
-rw-r--r--protocols/MRA/src/MraSendCommand.cpp14
-rw-r--r--protocols/MRA/src/MraSendQueue.cpp8
-rw-r--r--protocols/MRA/src/MraSendQueue.h6
-rw-r--r--protocols/MRA/src/Mra_functions.cpp66
-rw-r--r--protocols/MRA/src/Mra_menus.cpp52
-rw-r--r--protocols/MRA/src/Mra_proto.cpp28
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp14
-rw-r--r--protocols/MSN/src/msn_avatar.cpp2
-rw-r--r--protocols/MSN/src/msn_chat.cpp34
-rw-r--r--protocols/MSN/src/msn_commands.cpp35
-rw-r--r--protocols/MSN/src/msn_contact.cpp13
-rw-r--r--protocols/MSN/src/msn_global.h148
-rw-r--r--protocols/MSN/src/msn_links.cpp12
-rw-r--r--protocols/MSN/src/msn_lists.cpp65
-rw-r--r--protocols/MSN/src/msn_mail.cpp4
-rw-r--r--protocols/MSN/src/msn_menu.cpp32
-rw-r--r--protocols/MSN/src/msn_misc.cpp22
-rw-r--r--protocols/MSN/src/msn_msgqueue.cpp4
-rw-r--r--protocols/MSN/src/msn_opts.cpp2
-rw-r--r--protocols/MSN/src/msn_p2ps.cpp8
-rw-r--r--protocols/MSN/src/msn_proto.cpp56
-rw-r--r--protocols/MSN/src/msn_proto.h110
-rw-r--r--protocols/MSN/src/msn_soapab.cpp8
-rw-r--r--protocols/MSN/src/msn_srv.cpp4
-rw-r--r--protocols/MSN/src/msn_std.cpp6
-rw-r--r--protocols/MSN/src/msn_svcs.cpp13
-rw-r--r--protocols/MSN/src/msn_switchboard.cpp2
-rw-r--r--protocols/MSN/src/msn_threads.cpp4
-rw-r--r--protocols/MSN/src/msn_ws.cpp4
-rw-r--r--protocols/Omegle/src/chat.cpp4
-rw-r--r--protocols/Omegle/src/messages.cpp2
-rw-r--r--protocols/Omegle/src/proto.cpp4
-rw-r--r--protocols/Omegle/src/proto.h38
-rw-r--r--protocols/Omegle/src/stubs.cpp34
-rw-r--r--protocols/Omegle/src/theme.cpp2
-rw-r--r--protocols/Skype/src/skype_avatars.cpp4
-rw-r--r--protocols/Skype/src/skype_blocked.cpp8
-rw-r--r--protocols/Skype/src/skype_chat.cpp102
-rw-r--r--protocols/Skype/src/skype_chat.h2
-rw-r--r--protocols/Skype/src/skype_contacts.cpp47
-rw-r--r--protocols/Skype/src/skype_database.cpp8
-rw-r--r--protocols/Skype/src/skype_dialogs.cpp4
-rw-r--r--protocols/Skype/src/skype_events.cpp8
-rw-r--r--protocols/Skype/src/skype_instances.cpp2
-rw-r--r--protocols/Skype/src/skype_menus.cpp12
-rw-r--r--protocols/Skype/src/skype_messages.cpp24
-rw-r--r--protocols/Skype/src/skype_profile.cpp36
-rw-r--r--protocols/Skype/src/skype_proto.cpp42
-rw-r--r--protocols/Skype/src/skype_proto.h128
-rw-r--r--protocols/Skype/src/skype_utils.cpp6
-rw-r--r--protocols/SkypeClassic/src/contacts.cpp44
-rw-r--r--protocols/SkypeClassic/src/contacts.h11
-rw-r--r--protocols/SkypeClassic/src/gchat.cpp28
-rw-r--r--protocols/SkypeClassic/src/gchat.h6
-rw-r--r--protocols/SkypeClassic/src/skype.cpp111
-rw-r--r--protocols/SkypeClassic/src/skype.h4
-rw-r--r--protocols/SkypeClassic/src/skypeapi.cpp28
-rw-r--r--protocols/SkypeClassic/src/skypeapi.h2
-rw-r--r--protocols/SkypeClassic/src/skypeopt.cpp4
-rw-r--r--protocols/SkypeClassic/src/voiceservice.cpp6
-rw-r--r--protocols/SkypeClassic/src/voiceservice.h2
-rw-r--r--protocols/Tlen/src/tlen.cpp10
-rw-r--r--protocols/Tlen/src/tlen.h50
-rw-r--r--protocols/Tlen/src/tlen_avatar.cpp14
-rw-r--r--protocols/Tlen/src/tlen_avatar.h2
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp16
-rw-r--r--protocols/Tlen/src/tlen_misc.cpp18
-rw-r--r--protocols/Tlen/src/tlen_muc.cpp12
-rw-r--r--protocols/Tlen/src/tlen_picture.cpp2
-rw-r--r--protocols/Tlen/src/tlen_picture.h2
-rw-r--r--protocols/Tlen/src/tlen_presence.cpp4
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp66
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp10
-rw-r--r--protocols/Tlen/src/tlen_userinfo.cpp8
-rw-r--r--protocols/Tlen/src/tlen_util.cpp2
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp6
-rw-r--r--protocols/Twitter/src/chat.cpp4
-rw-r--r--protocols/Twitter/src/connection.cpp18
-rw-r--r--protocols/Twitter/src/contacts.cpp34
-rw-r--r--protocols/Twitter/src/proto.cpp20
-rw-r--r--protocols/Twitter/src/proto.h50
-rw-r--r--protocols/Twitter/src/stubs.cpp28
-rw-r--r--protocols/Twitter/src/theme.cpp6
-rw-r--r--protocols/Twitter/src/ui.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp8
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp10
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp16
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp44
-rw-r--r--protocols/VKontakte/src/vk_proto.h48
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp10
-rw-r--r--protocols/WhatsApp/src/chat.cpp2
-rw-r--r--protocols/WhatsApp/src/contacts.cpp93
-rw-r--r--protocols/WhatsApp/src/entities.h8
-rw-r--r--protocols/WhatsApp/src/messages.cpp12
-rw-r--r--protocols/WhatsApp/src/proto.cpp10
-rw-r--r--protocols/WhatsApp/src/proto.h61
-rw-r--r--protocols/WhatsApp/src/theme.cpp18
-rw-r--r--protocols/Xfire/src/baseProtocol.h55
-rw-r--r--protocols/Xfire/src/buddylist.cpp2
-rw-r--r--protocols/Xfire/src/buddylist.h96
-rw-r--r--protocols/Xfire/src/main.cpp96
-rw-r--r--protocols/Xfire/src/processbuddyinfo.cpp2
-rw-r--r--protocols/Xfire/src/processbuddyinfo.h2
-rw-r--r--protocols/Xfire/src/socket.h8
-rw-r--r--protocols/Xfire/src/stdafx.h44
-rw-r--r--protocols/Xfire/src/userdetails.cpp16
-rw-r--r--protocols/Yahoo/src/avatar.cpp17
-rw-r--r--protocols/Yahoo/src/chat.cpp34
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp33
-rw-r--r--protocols/Yahoo/src/file_transfer.h2
-rw-r--r--protocols/Yahoo/src/im.cpp51
-rw-r--r--protocols/Yahoo/src/links.cpp2
-rw-r--r--protocols/Yahoo/src/main.cpp2
-rw-r--r--protocols/Yahoo/src/proto.cpp181
-rw-r--r--protocols/Yahoo/src/proto.h110
-rw-r--r--protocols/Yahoo/src/services.cpp24
-rw-r--r--protocols/Yahoo/src/user_info.cpp4
-rw-r--r--protocols/Yahoo/src/util.cpp12
-rw-r--r--protocols/Yahoo/src/yahoo.cpp34
257 files changed, 3084 insertions, 3193 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp
index 6e764e8b78..a4617dbd29 100644
--- a/protocols/AimOscar/src/avatars.cpp
+++ b/protocols/AimOscar/src/avatars.cpp
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void __cdecl CAimProto::avatar_request_thread(void* param)
{
- HANDLE hContact = (HANDLE)param;
+ HCONTACT hContact = (HCONTACT)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(HANDLE hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested
+void CAimProto::avatar_request_handler(HCONTACT hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested
{
if (hContact == NULL)
{
@@ -99,15 +99,13 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const
AI.hContact = contact_from_sn(sn);
- if (data_len > 0)
- {
+ if (data_len > 0) {
const TCHAR *type;
AI.format = ProtoGetBufferFormat(data, &type);
get_avatar_filename(AI.hContact, AI.filename, SIZEOF(AI.filename), type);
int fileId = _topen(AI.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
- if (fileId >= 0)
- {
+ if (fileId >= 0) {
_write(fileId, data, data_len);
_close(fileId);
res = true;
@@ -123,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(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
+int CAimProto::get_avatar_filename(HCONTACT 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 f58f824016..7ba14d4e84 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);
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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 ae5f3b8698..8d4972e3e4 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 <file_transfer>(10) {};
-file_transfer* ft_list_type::find_by_cookie(char* cookie, HANDLE hContact)
+file_transfer* ft_list_type::find_by_cookie(char* cookie, HCONTACT 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(HANDLE hCont, char* nick, char* cookie)
+file_transfer::file_transfer(HCONTACT 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 591e86b75b..61bc3e9d13 100644
--- a/protocols/AimOscar/src/file.h
+++ b/protocols/AimOscar/src/file.h
@@ -23,7 +23,7 @@ struct CAimProto;
struct file_transfer
{
- HANDLE hContact;
+ HCONTACT hContact;
char* sn;
char icbm_cookie[8];
@@ -56,7 +56,7 @@ struct file_transfer
bool requester;
bool success;
- file_transfer(HANDLE hCont, char* nick, char* cookie);
+ file_transfer(HCONTACT hCont, char* nick, char* cookie);
~file_transfer();
void listen(CAimProto* ppro);
@@ -68,8 +68,8 @@ struct ft_list_type : OBJLIST <file_transfer>
{
ft_list_type();
- file_transfer* find_by_handle(HANDLE hContact);
- file_transfer* find_by_cookie(char* cookie, HANDLE hContact);
+ file_transfer* find_by_handle(HCONTACT hContact);
+ file_transfer* find_by_cookie(char* cookie, HCONTACT 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 9c8766872f..a4ca30f868 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 */
{
- HANDLE hContact = proto->contact_from_sn(sn, true);
+ HCONTACT 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 */
- HANDLE hContact = proto->contact_from_sn(sn, true, true);
+ HCONTACT 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 ebe3659655..8789f548e2 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -131,7 +131,7 @@ HANDLE 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);
- HANDLE hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0);
+ HCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0);
mir_free(sn);
return hContact; //See authrequest for serverside addition
}
@@ -160,7 +160,7 @@ int CAimProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CAimProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
+int __cdecl CAimProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt)
{
return 1;
}
@@ -168,7 +168,7 @@ int __cdecl CAimProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CAimProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+int __cdecl CAimProto::AuthRequest(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE __cdecl CAimProto::FileAllow(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const PRO
////////////////////////////////////////////////////////////////////////////////////////
// FileCancel - cancels a file transfer
-int __cdecl CAimProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int __cdecl CAimProto::FileCancel(HCONTACT 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(HANDLE hContact, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CAimProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/)
+int __cdecl CAimProto::FileDeny(HCONTACT 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, HANDLE hContact)
+DWORD_PTR __cdecl CAimProto::GetCaps(int type, HCONTACT hContact)
{
switch (type)
{
@@ -345,7 +345,7 @@ DWORD_PTR __cdecl CAimProto::GetCaps(int type, HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CAimProto::GetInfo(HANDLE hContact, int infoType)
+int __cdecl CAimProto::GetInfo(HCONTACT hContact, int infoType)
{
return 1;
}
@@ -421,7 +421,7 @@ HWND __cdecl CAimProto::CreateExtendedSearchUI(HWND owner)
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CAimProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CAimProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -429,7 +429,7 @@ int __cdecl CAimProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CAimProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
+int __cdecl CAimProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -437,7 +437,7 @@ int __cdecl CAimProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CAimProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CAimProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
{
char *omsg = pre->szMessage;
char *bbuf = NULL;
@@ -458,7 +458,7 @@ int __cdecl CAimProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CAimProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CAimProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -466,7 +466,7 @@ int __cdecl CAimProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CAimProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CAimProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
return 1;
}
@@ -474,7 +474,7 @@ int __cdecl CAimProto::SendContacts(HANDLE hContact, int flags, int nContacts, H
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CAimProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE __cdecl CAimProto::SendFile(HCONTACT 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(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CAimProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
if (pszSrc == NULL) return 0;
@@ -626,7 +626,7 @@ int __cdecl CAimProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CAimProto::SendUrl(HANDLE hContact, int flags, const char* url)
+int __cdecl CAimProto::SendUrl(HCONTACT hContact, int flags, const char* url)
{
return 1;
}
@@ -634,7 +634,7 @@ int __cdecl CAimProto::SendUrl(HANDLE hContact, int flags, const char* url)
////////////////////////////////////////////////////////////////////////////////////////
// SetApparentMode - sets the visibility m_iStatus
-int __cdecl CAimProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CAimProto::SetApparentMode(HCONTACT hContact, int mode)
{
return 0;
}
@@ -715,7 +715,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg)
{
Sleep(150);
- const HANDLE hContact = arg;
+ HCONTACT hContact = (HCONTACT)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(HANDLE hContact)
+HANDLE __cdecl CAimProto::GetAwayMsg(HCONTACT hContact)
{
if (state != 1)
return 0;
@@ -746,7 +746,7 @@ HANDLE __cdecl CAimProto::GetAwayMsg(HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG
-int __cdecl CAimProto::RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* pre)
+int __cdecl CAimProto::RecvAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int __cdecl CAimProto::UserIsTyping(HCONTACT hContact, int type)
{
if (state != 1) return 0;
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h
index 041a78694c..bdd1dd42e7 100644
--- a/protocols/AimOscar/src/proto.h
+++ b/protocols/AimOscar/src/proto.h
@@ -33,18 +33,18 @@ struct CAimProto : public PROTO<CAimProto>
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
@@ -52,24 +52,24 @@ struct CAimProto : public PROTO<CAimProto>
virtual HWND __cdecl SearchAdvanced( HWND owner );
virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTOFILEEVENT* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* );
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
- virtual int __cdecl SetApparentMode( HANDLE hContact, int mode );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode );
virtual int __cdecl SetStatus( int iNewStatus );
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type );
virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
@@ -213,9 +213,9 @@ struct CAimProto : public PROTO<CAimProto>
void __cdecl avatar_request_thread( void* param );
void __cdecl avatar_upload_thread( void* param );
- void avatar_request_handler(HANDLE hContact, char* hash, unsigned char type);
+ void avatar_request_handler(HCONTACT 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(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
+ int get_avatar_filename(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
//////////////////////////////////////////////////////////////////////////////////////
// away.cpp
@@ -414,36 +414,37 @@ struct CAimProto : public PROTO<CAimProto>
//////////////////////////////////////////////////////////////////////////////////////
// utilities.cpp
- struct msg_ack_param { HANDLE hContact; const char *msg; int id; bool success; };
+ struct msg_ack_param { HCONTACT 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);
+
void broadcast_status(int status);
bool wait_conn(HANDLE& hConn, HANDLE& hEvent, unsigned short service);
- bool is_my_contact(HANDLE hContact);
- HANDLE find_chat_contact(const char * room);
- HANDLE contact_from_sn(const char* sn, bool addIfNeeded = false, bool temporary = false);
- void add_contact_to_group(HANDLE hContact, const char* group);
- void set_local_nick(HANDLE hContact, char* nick, char* note);
+ 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);
void upload_nicks(void);
void update_server_group(const char* group, unsigned short group_id);
void offline_contacts(void);
- void offline_contact(HANDLE hContact, bool remove_settings);
+ void offline_contact(HCONTACT 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(HANDLE hContact, int i);
- unsigned short getGroupId(HANDLE hContact, int i);
- void setBuddyId(HANDLE hContact, int i, unsigned short id);
- void setGroupId(HANDLE hContact, int i, unsigned short id);
- int deleteBuddyId(HANDLE hContact, int i);
- int deleteGroupId(HANDLE hContact, int i);
+ 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 search_for_free_item_id(HANDLE hbuddy);
+ unsigned short search_for_free_item_id(HCONTACT 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 d45fd61412..2702a5af90 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);
- HANDLE hContact = contact_from_sn(sn, true);
+ HCONTACT 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);
- HANDLE hContact=contact_from_sn(buddy, true);
+ HCONTACT 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
{
- HANDLE hContact = contact_from_sn(name, true);
+ HCONTACT 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
{
- HANDLE hContact = contact_from_sn(name, true);
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(name);
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(sn, true, true), hMsgContact = NULL;
+ HCONTACT 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);
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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");
- HANDLE hContact = contact_from_sn(sn);
+ HCONTACT 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;
- HANDLE hContact = contact_from_sn(sn, true, true);
+ HCONTACT 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);
- HANDLE hContact=contact_from_sn(sn);
+ HCONTACT 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];
- HANDLE hContact;
+ HCONTACT 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 05ab61d12e..3a484527b3 100644
--- a/protocols/AimOscar/src/services.cpp
+++ b/protocols/AimOscar/src/services.cpp
@@ -91,8 +91,7 @@ INT_PTR CAimProto::GetProfile(WPARAM wParam, LPARAM lParam)
return 0;
DBVARIANT dbv;
- if (!getString((HANDLE)wParam, AIM_KEY_SN, &dbv))
- {
+ if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv)) {
request_HTML_profile = 1;
aim_query_profile(hServerConn, seqno, dbv.pszVal);
db_free(&dbv);
@@ -106,7 +105,7 @@ INT_PTR CAimProto::GetHTMLAwayMsg(WPARAM wParam, LPARAM /*lParam*/)
return 0;
DBVARIANT dbv;
- if (!getString((HANDLE)wParam, AIM_KEY_SN, &dbv))
+ if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv))
{
request_away_message = 1;
aim_query_away_message(hServerConn, seqno, dbv.pszVal);
@@ -120,7 +119,7 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
if (strcmp(cws->szModule, MOD_KEY_CL) == 0 && state == 1 && wParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (strcmp(cws->szSetting, AIM_KEY_NL) == 0)
{
if (cws->value.type == DBVT_DELETED)
@@ -170,7 +169,7 @@ int CAimProto::OnContactDeleted(WPARAM wParam,LPARAM /*lParam*/)
{
if (state != 1) return 0;
- const HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0))
return 0;
@@ -204,8 +203,8 @@ int CAimProto::OnGroupChange(WPARAM wParam,LPARAM lParam)
{
if (state != 1 || !getByte(AIM_KEY_MG, 1)) return 0;
- const HANDLE hContact = (HANDLE)wParam;
- const CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
+ CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam;
if (hContact == NULL)
{
@@ -255,7 +254,7 @@ INT_PTR CAimProto::AddToServerList(WPARAM wParam, LPARAM /*lParam*/)
{
if (state != 1) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
@@ -271,7 +270,7 @@ INT_PTR CAimProto::BlockBuddy(WPARAM wParam, LPARAM /*lParam*/)
{
if (state != 1) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
unsigned short item_id;
DBVARIANT dbv;
if (getString(hContact, AIM_KEY_SN, &dbv)) return 0;
@@ -329,7 +328,7 @@ INT_PTR CAimProto::OnJoinChat(WPARAM wParam, LPARAM /*lParam*/)
{
if (state != 1) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
if (!getString(hContact, "ChatRoomID", &dbv))
@@ -345,7 +344,7 @@ INT_PTR CAimProto::OnLeaveChat(WPARAM wParam, LPARAM /*lParam*/)
{
if (state != 1) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
if (!getString(hContact, "ChatRoomID", &dbv))
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 0a553f1d55..711dd27b9d 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, HANDLE hContact)
+static void set_AT_icon(CAimProto* ppro, HCONTACT hContact)
{
if (ppro->isChatRoom(hContact)) return;
@@ -128,7 +128,7 @@ static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
ExtraIcon_SetIcon(hExtraAT, hContact, (i < 5) ? GetIconHandle(extra_AT_icon_name[i]) : NULL);
}
-static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
+static void set_ES_icon(CAimProto* ppro, HCONTACT hContact)
{
if (ppro->isChatRoom(hContact)) return;
@@ -136,7 +136,7 @@ static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
ExtraIcon_SetIcon(hExtraAT, hContact, (i < 2) ? GetIconHandle(extra_ES_icon_name[i]) : NULL);
}
-void set_contact_icon(CAimProto* ppro, HANDLE hContact)
+void set_contact_icon(CAimProto* ppro, HCONTACT 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, HANDLE hContact)
void remove_AT_icons(CAimProto* ppro)
{
- for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
+ for (HCONTACT 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*/)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 8c520ceb75..c2e8093ce9 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, HANDLE hContact);
+void set_contact_icon(CAimProto* ppro, HCONTACT hContact);
#endif
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index acbdfc7557..fd4dba0bea 100644
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -1326,25 +1326,21 @@ INT_PTR CALLBACK join_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
/////////////////////////////////////////////////////////////////////////////////////////
// Invite to chat dialog
-static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg)
+static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
- while (hItem)
- {
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) clist_chat_invite_send(hItemT, hwndList, item, ppro, msg);
+ while (hItem) {
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ clist_chat_invite_send(hItemT, hwndList, item, ppro, msg);
}
- else
- {
+ else {
int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- if (chk)
- {
- if (IsHContactInfo(hItem))
- {
+ if (chk) {
+ if (IsHContactInfo(hItem)) {
TCHAR buf[128] = _T("");
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
@@ -1353,11 +1349,9 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, chat_list_item*
item->cookie, item->exchange, item->instance, sn, msg);
mir_free(sn);
}
- else
- {
+ else {
DBVARIANT dbv;
- if (!ppro->getString(hItem, AIM_KEY_SN, &dbv))
- {
+ if (!ppro->getString(hItem, AIM_KEY_SN, &dbv)) {
ppro->aim_chat_invite(ppro->hServerConn, ppro->seqno,
item->cookie, item->exchange, item->instance, dbv.pszVal, msg);
db_free(&dbv);
@@ -1365,30 +1359,28 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, chat_list_item*
}
}
}
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
}
}
-static void clist_validate_contact(HANDLE hItem, HWND hwndList, CAimProto* ppro)
+static void clist_validate_contact(HCONTACT 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(HANDLE hItem, HWND hwndList, CAimProto* ppro)
+static void clist_chat_prepare(HCONTACT hItem, HWND hwndList, CAimProto* ppro)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
-
- while (hItem)
- {
- HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
-
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) clist_chat_prepare(hItemT, hwndList, ppro);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+
+ while (hItem) {
+ HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ clist_chat_prepare(hItemT, hwndList, ppro);
}
else if (IsHContactContact(hItem))
clist_validate_contact(hItem, hwndList, ppro);
@@ -1397,13 +1389,11 @@ static void clist_chat_prepare(HANDLE hItem, HWND hwndList, CAimProto* ppro)
}
}
-
INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
invite_chat_param* param = (invite_chat_param*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -1433,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(nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
+ clist_validate_contact((HCONTACT)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 58ca76cb0e..7df2eccaaf 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(HANDLE hContact)
+bool CAimProto::is_my_contact(HCONTACT hContact)
{
const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
}
-HANDLE CAimProto::find_chat_contact(const char* room)
+HCONTACT CAimProto::find_chat_contact(const char* room)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
if (!getString(hContact, "ChatRoomID", &dbv)) {
bool found = !strcmp(room, dbv.pszVal);
@@ -180,11 +180,11 @@ HANDLE CAimProto::find_chat_contact(const char* room)
return NULL;
}
-HANDLE CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary)
+HCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary)
{
ptrA norm_sn( normalize_name(sn));
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
if (!getString(hContact, AIM_KEY_SN, &dbv)) {
bool found = !strcmp(norm_sn, dbv.pszVal);
@@ -195,7 +195,7 @@ HANDLE CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempora
}
if (addIfNeeded) {
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)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(HANDLE hContact, const char* new_group)
+void CAimProto::add_contact_to_group(HCONTACT hContact, const char* new_group)
{
if (new_group == NULL) return;
@@ -300,7 +300,7 @@ void CAimProto::add_contact_to_group(HANDLE hContact, const char* new_group)
db_free(&dbv);
}
-void CAimProto::offline_contact(HANDLE hContact, bool remove_settings)
+void CAimProto::offline_contact(HCONTACT hContact, bool remove_settings)
{
if (remove_settings)
{
@@ -318,7 +318,7 @@ void CAimProto::offline_contact(HANDLE hContact, bool remove_settings)
void CAimProto::offline_contacts(void)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
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(HANDLE hbuddy)//returns a free item id and links the id to the buddy
+unsigned short CAimProto::search_for_free_item_id(HCONTACT hbuddy)//returns a free item id and links the id to the buddy
{
unsigned short id;
retry:
id = get_random();
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
if ( !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(HANDLE hContact, char* nick, char* note)
+void CAimProto::set_local_nick(HCONTACT 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(HANDLE hContact, int i)
+unsigned short CAimProto::getBuddyId(HCONTACT 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(HANDLE hContact, int i, unsigned short id)
+void CAimProto::setBuddyId(HCONTACT 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(HANDLE hContact, int i)
+int CAimProto::deleteBuddyId(HCONTACT 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(HANDLE hContact, int i)
+unsigned short CAimProto::getGroupId(HCONTACT 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(HANDLE hContact, int i, unsigned short id)
+void CAimProto::setGroupId(HCONTACT 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(HANDLE hContact, int i)
+int CAimProto::deleteGroupId(HCONTACT 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 1b84fb79c7..32bdd1a2da 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 (HANDLE hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) {
+ for (HCONTACT 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;
- HANDLE hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false);
+ HCONTACT 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;
}
-HANDLE CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status)
+HCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status)
{
- for (HANDLE res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) {
+ for (HCONTACT 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 @@ HANDLE CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, boo
}
if (add_to_list) {
- HANDLE res=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ HCONTACT res=(HCONTACT)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;
- HANDLE hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false);
+ HCONTACT 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)
{
- HANDLE hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false);
+ HCONTACT 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)
{
- HANDLE hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false);
+ HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false);
// Removed - it causes that whoisreadingawaymessage plugin was not working
// if (hContact)
// {
@@ -459,9 +459,8 @@ int CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr)
bool TempAdd = flags&PALF_TEMPORARY;
- HANDLE contact = FindContact(addr, psr->hdr.nick, true, !TempAdd, !TempAdd, psr->stat);
- if (contact!=NULL)
- {
+ HCONTACT 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 );
}
@@ -569,7 +568,7 @@ void CMLan::SearchExt(TDataHolder* hold)
void CMLan::SendMessageExt(TDataHolder* hold)
{
Sleep(0);
- if (db_get_w((HANDLE)hold->hContact, PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE)
+ if (db_get_w((HCONTACT)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);
@@ -578,7 +577,7 @@ void CMLan::SendMessageExt(TDataHolder* hold)
{
TPacket pak;
ZeroMemory(&pak, sizeof(pak));
- u_long addr = db_get_dw((HANDLE)hold->hContact, PROTONAME, "ipaddr", 0);
+ u_long addr = db_get_dw((HCONTACT)hold->hContact, PROTONAME, "ipaddr", 0);
pak.strMessage = hold->msg;
pak.idMessage = hold->id;
if (hold->op==LEXT_SENDURL)
@@ -595,7 +594,7 @@ void CMLan::GetAwayMsgExt(TDataHolder* hold)
TPacket pak;
ZeroMemory(&pak, sizeof(pak));
pak.idReqAwayMessage = hold->id;
- u_long addr = db_get_dw((HANDLE)hold->hContact, PROTONAME, "ipaddr", 0);
+ u_long addr = db_get_dw((HCONTACT)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 4ec8993b23..41bde7544b 100644
--- a/protocols/EmLanProto/src/mlan.h
+++ b/protocols/EmLanProto/src/mlan.h
@@ -30,7 +30,7 @@ public:
long id;
long op;
- HANDLE hContact;
+ HCONTACT 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);
- HANDLE FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status = ID_STATUS_ONLINE);
+ HCONTACT 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;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
char* m_szDescription;
char** m_szFiles;
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index 196497a291..8e3006a12a 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(HANDLE hContact, std::string image_url)
+void FacebookProto::CheckAvatarChange(HCONTACT 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 9b4dd11a58..6a4884090c 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);
- HANDLE hContact = ContactIDToHContact(sn);
+ HCONTACT 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);
- HANDLE hContact = ContactIDToHContact(sn);
+ HCONTACT hContact = ContactIDToHContact(sn);
mir_free(sn);
switch (hook->dwData)
@@ -194,7 +194,7 @@ void FacebookProto::RemoveChatContact(const TCHAR *tchat_id, const char *id)
char *FacebookProto::GetChatUsers(const TCHAR *chat_id)
{
GC_INFO gci = {0};
- gci.Flags = USERS;
+ gci.Flags = GCF_USERS;
gci.pszModule = m_szModuleName;
gci.pszID = chat_id;
CallService(MS_GC_GETINFO, 0, (LPARAM)&gci);
@@ -248,7 +248,7 @@ void FacebookProto::AddChat(const TCHAR *tid, const TCHAR *tname)
INT_PTR FacebookProto::OnJoinChat(WPARAM wParam,LPARAM suppress)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// TODO: load info from server + old history,...
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index fb2f712265..92333f3d1f 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
{
- HANDLE hContact = parent->ContactIDToHContact(message_recipient);
+ HCONTACT 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 f225c5b8c7..fde9b8f678 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
-void FacebookProto::SaveName(HANDLE hContact, const facebook_user *fbu)
+void FacebookProto::SaveName(HCONTACT hContact, const facebook_user *fbu)
{
if (fbu->real_name.empty()) {
delSetting(hContact, FACEBOOK_KEY_NICK);
@@ -55,7 +55,7 @@ void FacebookProto::SaveName(HANDLE hContact, const facebook_user *fbu)
}
}
-bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat)
+bool FacebookProto::IsMyContact(HCONTACT hContact, bool include_chat)
{
const char *proto = GetContactProto(hContact);
if (proto && !strcmp(m_szModuleName, proto)) {
@@ -66,9 +66,9 @@ bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat)
return false;
}
-HANDLE FacebookProto::ChatIDToHContact(std::tstring chat_id)
+HCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (!IsMyContact(hContact, true))
continue;
@@ -80,9 +80,9 @@ HANDLE FacebookProto::ChatIDToHContact(std::tstring chat_id)
return 0;
}
-HANDLE FacebookProto::ContactIDToHContact(std::string user_id)
+HCONTACT FacebookProto::ContactIDToHContact(std::string user_id)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (!IsMyContact(hContact))
continue;
@@ -98,7 +98,7 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id)
{
std::string user_id;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (!IsMyContact(hContact))
continue;
@@ -138,9 +138,9 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id)
return user_id;
}
-HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check)
+HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (!dont_check) {
// First, check if this contact exists
@@ -150,7 +150,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo
}
// If not, make a new contact!
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if(hContact)
{
if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0)
@@ -193,7 +193,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo
void FacebookProto::SetAllContactStatuses(int status)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact))
continue;
@@ -228,7 +228,7 @@ void FacebookProto::DeleteContactFromServer(void *data)
if (fbu != NULL)
fbu->deleted = true;
- HANDLE hContact = ContactIDToHContact(id);
+ HCONTACT 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) {
- HANDLE hContact = ContactIDToHContact(id);
+ HCONTACT 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;
- HANDLE hContact = (*(HANDLE*)data);
+ HCONTACT hContact = *(HCONTACT*)data;
delete data;
std::string post_data = "fb_dtsg=" + facy.dtsg_;
@@ -310,7 +310,7 @@ void FacebookProto::CancelFriendsRequest(void *data)
if (data == NULL)
return;
- HANDLE hContact = (*(HANDLE*)data);
+ HCONTACT hContact = *(HCONTACT*)data;
delete data;
std::string query = "phstamp=0&confirmed=1";
@@ -370,7 +370,7 @@ void FacebookProto::SendPokeWorker(void *p)
}
-HANDLE FacebookProto::GetAwayMsg(HANDLE hContact)
+HANDLE FacebookProto::GetAwayMsg(HCONTACT hContact)
{
return 0; // Status messages are disabled
}
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index 49bb562c39..e35c52f3b9 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -120,20 +120,21 @@ 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, HANDLE hItem, HWND hwndList)
+void ClistPrepare(FacebookProto *proto, HCONTACT hItem, HWND hwndList)
{
if (hItem == NULL)
- hItem = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem)
{
- HANDLE hItemN = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ HCONTACT hItemN = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
if (IsHContactGroup(hItem)) {
- HANDLE hItemT = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ HCONTACT hItemT = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItemT)
ClistPrepare(proto, hItemT, hwndList);
- } else if (IsHContactContact(hItem)) {
+ }
+ else if (IsHContactContact(hItem)) {
if (!proto->IsMyContact(hItem) || ptrA(proto->getStringA(hItem, FACEBOOK_KEY_ID)) == NULL)
SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
}
@@ -142,14 +143,14 @@ void ClistPrepare(FacebookProto *proto, HANDLE hItem, HWND hwndList)
}
}
-void GetSelectedContacts(FacebookProto *proto, HANDLE hItem, HWND hwndList, std::vector<facebook_user*> *contacts)
+void GetSelectedContacts(FacebookProto *proto, HCONTACT hItem, HWND hwndList, std::vector<facebook_user*> *contacts)
{
if (hItem == NULL)
- hItem = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem) {
if (IsHContactGroup(hItem)) {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItemT)
GetSelectedContacts(proto, hItemT, hwndList, contacts);
} else {
@@ -160,7 +161,7 @@ void GetSelectedContacts(FacebookProto *proto, HANDLE hItem, HWND hwndList, std:
contacts->push_back(fu);
}
}
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
}
}
diff --git a/protocols/FacebookRM/src/entities.h b/protocols/FacebookRM/src/entities.h
index a924324019..6909b6d611 100644
--- a/protocols/FacebookRM/src/entities.h
+++ b/protocols/FacebookRM/src/entities.h
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct facebook_user
{
- HANDLE handle;
+ HCONTACT handle;
std::string user_id;
std::string real_name;
@@ -164,16 +164,16 @@ struct send_chat
struct send_direct
{
- send_direct(HANDLE hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {}
- HANDLE hContact;
+ send_direct(HCONTACT hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {}
+ HCONTACT hContact;
std::string msg;
HANDLE msgid;
};
struct send_typing
{
- send_typing(HANDLE hContact,const int status) : hContact(hContact), status(status) {}
- HANDLE hContact;
+ send_typing(HCONTACT hContact,const int status) : hContact(hContact), status(status) {}
+ HCONTACT hContact;
int status;
};
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index 676522cc87..81c54f3fd8 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
-void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string *url, std::string *notification_id)
+void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT 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 06118a9381..28e102b46e 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -438,7 +438,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa
}
}
} else { // classic contact
- HANDLE hContact = proto->ContactIDToHContact(json_as_pstring(reader));
+ HCONTACT 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
}
}
- HANDLE hChatContact = NULL;
+ HCONTACT 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);
- HANDLE hContact = proto->AddToContactList(&fbu, CONTACT_FRIEND);
+ HCONTACT 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 667692a4c9..051cb9cd39 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
-int FacebookProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int FacebookProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
ForkThread(&FacebookProto::ReadMessageWorker, hContact);
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF);
@@ -76,7 +76,7 @@ void FacebookProto::SendChatMsgWorker(void *p)
send_chat *data = static_cast<send_chat*>(p);
std::string err_message = "";
- HANDLE hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str())));
+ HCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str())));
if (hContact) {
std::string tid;
DBVARIANT dbv;
@@ -107,7 +107,7 @@ void FacebookProto::SendChatMsgWorker(void *p)
delete data;
}
-int FacebookProto::SendMsg(HANDLE hContact, int flags, const char *msg)
+int FacebookProto::SendMsg(HCONTACT 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)
@@ -118,7 +118,7 @@ int FacebookProto::SendMsg(HANDLE hContact, int flags, const char *msg)
return facy.msgid_;
}
-int FacebookProto::UserIsTyping(HANDLE hContact,int type)
+int FacebookProto::UserIsTyping(HCONTACT hContact,int type)
{
if (hContact && isOnline())
ForkThread(&FacebookProto::SendTypingWorker, new send_typing(hContact, type));
@@ -168,7 +168,7 @@ void FacebookProto::ReadMessageWorker(void *p)
if (p == NULL)
return;
- HANDLE hContact = static_cast<HANDLE>(p);
+ HCONTACT hContact = static_cast<HCONTACT>(p);
if (getBool(FACEBOOK_KEY_KEEP_UNREAD, 0) || getBool(hContact, FACEBOOK_KEY_KEEP_UNREAD, 0))
return;
@@ -186,7 +186,7 @@ void FacebookProto::ReadMessageWorker(void *p)
facy.flap(REQUEST_MARK_READ, &data);
}
-void FacebookProto::ParseSmileys(std::string message, HANDLE hContact)
+void FacebookProto::ParseSmileys(std::string message, HCONTACT 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 777ce172db..c06e9b562a 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)
{
- HANDLE hContact = fbu->handle;
+ HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if ( isChatRoom(hContact))
continue;
@@ -243,7 +243,7 @@ void FacebookProto::ProcessFriendList(void* data)
facebook_user *fbu = iter->second;
if (!fbu->deleted)
- HANDLE hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now
+ HCONTACT 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<std::string, facebook_chatroom*>::iterator it = chatrooms.begin(); it != chatrooms.end(); ) {
facebook_chatroom *room = it->second;
- HANDLE hChatContact = NULL;
+ HCONTACT 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?
- HANDLE hContact = AddToContactList(&fbu, CONTACT_NONE);
+ HCONTACT 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;
- HANDLE hContact = AddToContactList(&fbu, CONTACT_NONE);
+ HCONTACT 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())
{
- HANDLE hContact = AddToContactList(fbu, CONTACT_APPROVE);
+ HCONTACT 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 bbe948120d..5e05071dec 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, HANDLE hContact)
+DWORD_PTR FacebookProto::GetCaps(int type, HCONTACT hContact)
{
switch(type)
{
@@ -261,7 +261,7 @@ HANDLE FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return NULL;
}
- HANDLE hContact = AddToContactList(&fbu, CONTACT_NONE);
+ HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE);
if (hContact) {
if (flags & PALF_TEMPORARY) {
db_set_b(hContact, "Clist", "Hidden", 1);
@@ -276,7 +276,7 @@ HANDLE FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return hContact;
}
-int FacebookProto::AuthRequest(HANDLE hContact,const PROTOCHAR *message)
+int FacebookProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message)
{
return RequestFriendship((WPARAM)hContact, NULL);
}
@@ -286,7 +286,7 @@ int FacebookProto::Authorize(HANDLE hDbEvent)
if (!hDbEvent || isOffline())
return 1;
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -298,7 +298,7 @@ int FacebookProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason)
if (!hDbEvent || isOffline())
return 1;
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -450,7 +450,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM lParam)
if (!isOnline())
return 1;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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);
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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;
}
-HANDLE FacebookProto::HContactFromAuthEvent(HANDLE hEvent)
+HCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent)
{
DWORD body[2];
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -641,13 +641,13 @@ HANDLE FacebookProto::HContactFromAuthEvent(HANDLE hEvent)
dbei.pBlob = (PBYTE)&body;
if (db_event_get(hEvent, &dbei))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (strcmp(dbei.szModule, m_szModuleName))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
return DbGetAuthEventContact(&dbei);
}
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index 3d056a92c4..9b5b550253 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -54,11 +54,11 @@ public:
__forceinline INT_PTR getStringUtf(const char *name, DBVARIANT *result) {
return db_get_utf(NULL, m_szModuleName, name, result); }
- __forceinline INT_PTR getStringUtf(HANDLE hContact, const char *name, DBVARIANT *result) {
+ __forceinline INT_PTR getStringUtf(HCONTACT 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(HANDLE hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); }
+ __forceinline void setStringUtf(HCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); }
//PROTO_INTERFACE
@@ -67,18 +67,18 @@ public:
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
@@ -86,24 +86,24 @@ public:
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT 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(HANDLE, bool include_chat = false);
- HANDLE ContactIDToHContact(std::string);
- HANDLE ChatIDToHContact(std::tstring);
+ bool IsMyContact(HCONTACT, bool include_chat = false);
+ HCONTACT ContactIDToHContact(std::string);
+ HCONTACT ChatIDToHContact(std::tstring);
std::string ThreadIDToContactID(std::string thread_id);
- HANDLE AddToContactList(facebook_user*, ContactType type, bool dont_check = false);
- void SetAllContactStatuses(int status);
- HANDLE HContactFromAuthEvent(HANDLE hEvent);
+ HCONTACT AddToContactList(facebook_user*, ContactType type, bool dont_check = false);
+ void SetAllContactStatuses(int status);
+ HCONTACT 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(HANDLE hContact, std::string image_url);
+ void CheckAvatarChange(HCONTACT hContact, std::string image_url);
void ToggleStatusMenuItems(BOOL bEnable);
- void ParseSmileys(std::string message, HANDLE hContact);
+ void ParseSmileys(std::string message, HCONTACT hContact);
void OpenUrl(std::string url);
- void SaveName(HANDLE hContact, const facebook_user *fbu);
+ void SaveName(HCONTACT 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<HANDLE> avatar_queue;
+ std::vector<HCONTACT> avatar_queue;
static void CALLBACK APC_callback(ULONG_PTR p);
// Information providing
- void NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL);
+ void NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT 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 1689b89f3f..34412fe8b3 100644
--- a/protocols/FacebookRM/src/stubs.cpp
+++ b/protocols/FacebookRM/src/stubs.cpp
@@ -27,7 +27,7 @@ HANDLE FacebookProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
return NULL;
}
-int FacebookProto::AuthRecv(HANDLE hContact,PROTORECVEVENT *)
+int FacebookProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
@@ -38,17 +38,17 @@ HANDLE FacebookProto::ChangeInfo(int type,void *info_data)
return NULL;
}
-HANDLE FacebookProto::FileAllow(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *path)
+HANDLE FacebookProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path)
{
return NULL;
}
-int FacebookProto::FileCancel(HANDLE hContact,HANDLE hTransfer)
+int FacebookProto::FileCancel(HCONTACT hContact,HANDLE hTransfer)
{
return 1;
}
-int FacebookProto::FileDeny(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *reason)
+int FacebookProto::FileDeny(HCONTACT 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(HANDLE hContact, int infoType)
+int FacebookProto::GetInfo(HCONTACT 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(HANDLE hContact,PROTORECVEVENT *)
+int FacebookProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int FacebookProto::RecvFile(HANDLE hContact,PROTORECVFILET *)
+int FacebookProto::RecvFile(HCONTACT hContact,PROTORECVFILET *)
{
return 1;
}
-int FacebookProto::RecvUrl(HANDLE hContact,PROTORECVEVENT *)
+int FacebookProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int FacebookProto::SendContacts(HANDLE hContact,int flags,int nContacts,HANDLE *hContactsList)
+int FacebookProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
return 1;
}
-HANDLE FacebookProto::SendFile(HANDLE hContact,const PROTOCHAR *desc, PROTOCHAR **files)
+HANDLE FacebookProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files)
{
return NULL;
}
-int FacebookProto::SendUrl(HANDLE hContact,int flags,const char *url)
+int FacebookProto::SendUrl(HCONTACT hContact,int flags,const char *url)
{
return 1;
}
-int FacebookProto::SetApparentMode(HANDLE hContact,int mode)
+int FacebookProto::SetApparentMode(HCONTACT hContact,int mode)
{
return 1;
}
-int FacebookProto::RecvAwayMsg(HANDLE hContact,int mode,PROTORECVEVENT *evt)
+int FacebookProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt)
{
return 1;
}
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index 6177f46b96..e0b7fd134e 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(HANDLE hContact)
+static FacebookProto * GetInstanceByHContact(HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if(!proto)
@@ -69,7 +69,7 @@ static FacebookProto * GetInstanceByHContact(HANDLE hContact)
template<INT_PTR (__cdecl FacebookProto::*Fcn)(WPARAM,LPARAM)>
INT_PTR GlobalService(WPARAM wParam,LPARAM lParam)
{
- FacebookProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ FacebookProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? (proto->*Fcn)(wParam,lParam) : 0;
}
@@ -78,7 +78,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam)
for (size_t i=0; i<SIZEOF(g_hContactMenuItems); i++)
Menu_ShowItem(g_hContactMenuItems[i], false);
- FacebookProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ FacebookProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? proto->OnPrebuildContactMenu(wParam,lParam) : 0;
}
@@ -152,7 +152,7 @@ void UninitContactMenus()
int FacebookProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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 74359484f9..744b990e96 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;
- HANDLE hContact;
+ HCONTACT 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((HANDLE)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
+ if (!lParam && db_get_b((HCONTACT)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
BOOL enqueued = FALSE;
AVACHANGED *ach = (AVACHANGED*)malloc(sizeof(AVACHANGED));
__try {
- ach->hContact = (HANDLE)wParam;
+ ach->hContact = (HCONTACT)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(HANDLE hContact)
+void SetAvatar(HCONTACT hContact)
{
mir_cslock lck(g_csSetAvatar);
diff --git a/protocols/GTalkExt/src/db.cpp b/protocols/GTalkExt/src/db.cpp
index a652babe49..661bce4409 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 4643a26275..087a38e2aa 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 30321de558..4e66154ac0 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;
- HANDLE hContact;
+ HCONTACT hContact;
LPTSTR jid;
LPTSTR url;
};
@@ -65,7 +65,7 @@ LPCSTR GetJidAcc(LPCTSTR jid)
return NULL;
}
-void MarkEventRead(HANDLE hCnt, HANDLE hEvt)
+void MarkEventRead(HCONTACT hCnt, HANDLE hEvt)
{
DWORD settings = (DWORD)TlsGetValue(itlsSettings);
if ( ReadCheckbox(0, IDC_POPUPSENABLED, settings) &&
@@ -77,7 +77,7 @@ void MarkEventRead(HANDLE hCnt, HANDLE hEvt)
int OnEventDeleted(WPARAM hContact, LPARAM hDbEvent, LPARAM wnd)
{
- if (db_get_b((HANDLE)hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
+ if (db_get_b((HCONTACT)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); //!!!!!!!!!!!
}
-HANDLE SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName)
+HCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName)
{
- HANDLE result = (HANDLE)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0);
+ HCONTACT result = (HCONTACT)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0);
if (!result || !db_get_b(result, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
- result = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ result = (HCONTACT)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 @@ HANDLE SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR
return result;
}
-HANDLE AddCListNotification(HANDLE hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
+HANDLE AddCListNotification(HCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
{
mir_ptr<char> 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)
{
- HANDLE hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]);
+ HCONTACT 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)
{
- HANDLE hContact = (HANDLE)db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0);
+ HCONTACT hContact = (HCONTACT)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 456cb3d366..43de74607d 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);
-HANDLE SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName = NULL);
+HCONTACT 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 7e8bc5669b..fd47c8a964 100644
--- a/protocols/GTalkExt/src/stdafx.h
+++ b/protocols/GTalkExt/src/stdafx.h
@@ -72,5 +72,5 @@
extern HINSTANCE g_hInst;
extern LIST<GoogleTalkAcc> g_accs;
-void SetAvatar(HANDLE hContact);
+void SetAvatar(HCONTACT hContact);
BOOL InitAvaUnit(BOOL init);
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index e97d3a319f..6cadef414a 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -26,7 +26,7 @@
//////////////////////////////////////////////////////////
// Avatars support
-void GGPROTO::getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen)
+void GGPROTO::getAvatarFilename(HCONTACT 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(HANDLE hContact, char *szAvatarURL)
+void GGPROTO::requestAvatarTransfer(HCONTACT 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(HANDLE hContact, char *szAvatarURL)
gg_LeaveCriticalSection(&avatar_mutex, "requestAvatarTransfer", 1, 1, "avatar_mutex", 1);
}
-void GGPROTO::requestAvatarInfo(HANDLE hContact, int iWaitFor)
+void GGPROTO::requestAvatarInfo(HCONTACT 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;
- HANDLE hContact = data->hContact;
+ HCONTACT 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 938e1dead2..562468c5e9 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;
- HANDLE hContact = (res->seq == GG_SEQ_CHINFO) ? NULL : getcontact(uin, 0, 0, NULL);
+ HCONTACT 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:
{
- HANDLE hContact = getcontact(e->event.status60.uin, 0, 0, NULL);
+ HCONTACT 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)
{
- HANDLE hContact = getcontact(e->event.image_reply.sender, 1, 0, NULL);
+ HCONTACT 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(dcc7->contact, &pre);
+ ProtoChainRecvFile((HCONTACT)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(dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free dcc
gg_dcc7_free(dcc7);
@@ -1186,7 +1186,7 @@ retry:
case GG_EVENT_TYPING_NOTIFICATION:
{
- HANDLE hContact = getcontact(e->event.typing_notification.uin, 0, 0, NULL);
+ HCONTACT 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)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
setWord(hContact, 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(HANDLE hContact, int refresh)
+void GGPROTO::notifyuser(HCONTACT hContact, int refresh)
{
uin_t uin;
if (!hContact) return;
@@ -1469,7 +1469,7 @@ void GGPROTO::notifyuser(HANDLE hContact, int refresh)
void GGPROTO::notifyall()
{
- HANDLE hContact;
+ HCONTACT hContact;
int count = 0, cc = 0;
uin_t *uins;
char *types;
@@ -1522,13 +1522,13 @@ void GGPROTO::notifyall()
////////////////////////////////////////////////////////////
// Get contact by uin
-HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
+HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) {
if (inlist) {
db_unset(hContact, "CList", "NotOnList");
@@ -1540,7 +1540,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
if (!create)
return NULL;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)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
- HANDLE hContact = getcontact(uin, 0, 0, NULL);
+ HCONTACT 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 2e9093015c..e0f39d35dc 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, HANDLE hContact, char *szModule, char *szSetting, int special, int disableIfUndef)
+static void SetValue(HWND hwndDlg, int idCtrl, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT 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=(HANDLE)lParam;
+ dat->hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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)
{
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
char* pszTemplate;
if (hContact == NULL){
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 761b5a7747..38a38bf22c 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;
- HANDLE hContact = getcontact(uin, 0, 0, NULL);
+ HCONTACT 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
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hProcess;
};
@@ -103,7 +103,7 @@ void __cdecl GGPROTO::ftfailthread(void *param)
debugLogA("ftfailthread(): end.");
}
-HANDLE ftfail(GGPROTO *gg, HANDLE hContact)
+HANDLE ftfail(GGPROTO *gg, HCONTACT 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 = (HANDLE)local_dcc->contact;
+ pfts.hContact = (HCONTACT)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(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)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 = (HANDLE)local_dcc->contact;
+ pfts.hContact = (HCONTACT)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(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)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(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0);
+ ProtoBroadcastAck((HCONTACT)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(local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0);
+ ProtoBroadcastAck((HCONTACT)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(local_dcc->contact, &pre);
+ ProtoChainRecvFile((HCONTACT)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 = (HANDLE)local_dcc7->contact;
+ pfts.hContact = (HCONTACT)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(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)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 = (HANDLE)local_dcc7->contact;
+ pfts.hContact = (HCONTACT)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(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((HCONTACT)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(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((HCONTACT)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(dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((HCONTACT)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(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE GGPROTO::FileAllow(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* sz
////////////////////////////////////////////////////////////
// File transfer canceled
-int GGPROTO::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int GGPROTO::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -888,7 +888,7 @@ int GGPROTO::FileCancel(HANDLE hContact, HANDLE hTransfer)
////////////////////////////////////////////////////////////
// File receiving denied
-int GGPROTO::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+int GGPROTO::FileDeny(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReas
////////////////////////////////////////////////////////////
// Called when received an file
-int GGPROTO::RecvFile(HANDLE hContact, PROTOFILEEVENT* pre)
+int GGPROTO::RecvFile(HCONTACT hContact, PROTOFILEEVENT* pre)
{
return Proto_RecvFile(hContact, pre);
}
@@ -912,7 +912,7 @@ int GGPROTO::RecvFile(HANDLE hContact, PROTOFILEEVENT* pre)
////////////////////////////////////////////////////////////
// Called when user sends a file
-HANDLE GGPROTO::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE GGPROTO::SendFile(HCONTACT 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 674ebe146d..2945c3c96c 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(HANDLE hContact)
+static GGPROTO* gg_getprotoinstance(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -213,7 +213,7 @@ static GGPROTO* gg_getprotoinstance(HANDLE hContact)
// Handles PrebuildContactMenu event
static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)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 HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)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 2acf921ec1..d5babd7e52 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -122,13 +122,13 @@ typedef struct
struct GGREQUESTAVATARDATA
{
- HANDLE hContact;
+ HCONTACT hContact;
int iWaitFor;
};
struct GGGETAVATARDATA
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szAvatarURL;
};
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 69b3afc0f9..24e8c40aa8 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -127,16 +127,16 @@ GGPROTO::~GGPROTO()
HANDLE 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(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::AuthRequest(HANDLE hContact, const TCHAR *szMessage) { return 1; }
+int GGPROTO::AuthRecv(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
+int GGPROTO::AuthRequest(HCONTACT 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(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::RecvUrl(HANDLE hContact, PROTORECVEVENT *pre) { return 1; }
-int GGPROTO::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE *hContactsList) { return 1; }
-int GGPROTO::SendUrl(HANDLE hContact, int flags, const char *url) { return 1; }
-int GGPROTO::RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT *evt) { return 1; }
+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; }
//////////////////////////////////////////////////////////
// when contact is added to list
@@ -160,7 +160,7 @@ HANDLE GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr)
//////////////////////////////////////////////////////////
// checks proto capabilities
-DWORD_PTR GGPROTO::GetCaps(int type, HANDLE hContact)
+DWORD_PTR GGPROTO::GetCaps(int type, HCONTACT 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, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE) 1, 0);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
debugLogA("cmdgetinfothread(): end.");
}
-int GGPROTO::GetInfo(HANDLE hContact, int infoType)
+int GGPROTO::GetInfo(HCONTACT hContact, int infoType)
{
gg_pubdir50_t req;
@@ -570,7 +570,7 @@ HWND GGPROTO::CreateExtendedSearchUI(HWND owner)
//////////////////////////////////////////////////////////
// when messsage received
-int GGPROTO::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int GGPROTO::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
return Proto_RecvMessage(hContact, pre);
}
@@ -580,7 +580,7 @@ int GGPROTO::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
int seq;
} GG_SEQ_ACK;
@@ -592,7 +592,7 @@ void __cdecl GGPROTO::sendackthread(void *ack)
mir_free(ack);
}
-int GGPROTO::SendMsg(HANDLE hContact, int flags, const char *msg)
+int GGPROTO::SendMsg(HCONTACT 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(HANDLE hContact, int flags, const char *msg)
//////////////////////////////////////////////////////////
// visible lists
-int GGPROTO::SetApparentMode(HANDLE hContact, int mode)
+int GGPROTO::SetApparentMode(HCONTACT 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, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
+ if (!db_get_s((HCONTACT)hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
{
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) dbv.ptszVal);
+ ProtoBroadcastAck((HCONTACT)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, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) NULL);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL);
}
debugLogA("getawaymsgthread(): end");
}
-HANDLE GGPROTO::GetAwayMsg(HANDLE hContact)
+HANDLE GGPROTO::GetAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int GGPROTO::UserIsTyping(HCONTACT 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 acc9c1b395..4aa8a54ca4 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -36,18 +36,18 @@ struct GGPROTO : public PROTO<GGPROTO>
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason );
+ 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 int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const TCHAR* id );
virtual HANDLE __cdecl SearchByEmail( const TCHAR* email );
@@ -55,24 +55,24 @@ struct GGPROTO : public PROTO<GGPROTO>
virtual HWND __cdecl SearchAdvanced( HWND owner );
virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode( HANDLE hContact, int mode );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode );
virtual int __cdecl SetStatus( int iNewStatus );
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type );
virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
@@ -110,10 +110,10 @@ struct GGPROTO : public PROTO<GGPROTO>
void gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
/* Global GG functions */
- void notifyuser(HANDLE hContact, int refresh);
+ void notifyuser(HCONTACT hContact, int refresh);
void setalloffline();
void disconnect();
- HANDLE getcontact(uin_t uin, int create, int inlist, TCHAR *nick);
+ HCONTACT 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<GGPROTO>
void menus_init();
/* Avatar functions */
- void getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen);
- void requestAvatarTransfer(HANDLE hContact, char *szAvatarURL);
- void requestAvatarInfo(HANDLE hContact, int iWaitFor);
+ void getAvatarFilename(HCONTACT hContact, TCHAR *pszDest, int cbLen);
+ void requestAvatarTransfer(HCONTACT hContact, char *szAvatarURL);
+ void requestAvatarInfo(HCONTACT 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<GGPROTO>
void __cdecl setavatarthread(void*);
/* File transfer functions */
- HANDLE fileallow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- int filecancel(HANDLE hContact, HANDLE hTransfer);
- int filedeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
- int recvfile(HANDLE hContact, PROTOFILEEVENT* pre);
- HANDLE sendfile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ 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 dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath);
HANDLE dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath);
@@ -187,8 +187,8 @@ struct GGPROTO : public PROTO<GGPROTO>
int img_sendonrequest(gg_event* e);
BOOL img_opened(uin_t uin);
void *img_loadpicture(gg_event* e, TCHAR *szFileName);
- int img_display(HANDLE hContact, void *img);
- int img_displayasmsg(HANDLE hContact, void *img);
+ int img_display(HCONTACT hContact, void *img);
+ int img_displayasmsg(HCONTACT hContact, void *img);
void __cdecl img_dlgcallthread(void *param);
@@ -211,7 +211,7 @@ struct GGPROTO : public PROTO<GGPROTO>
int gc_destroy();
TCHAR * gc_getchat(uin_t sender, uin_t *recipients, int recipients_count);
GGGC *gc_lookup(const TCHAR *id);
- int gc_changenick(HANDLE hContact, TCHAR *ptszNick);
+ int gc_changenick(HCONTACT 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 5fb2027896..676b7abbe5 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 (HANDLE hContact = db_find_first(); hContact; ) {
- HANDLE hNext = db_find_next(hContact);
+ for (HCONTACT hContact = db_find_first(); hContact; ) {
+ HCONTACT 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)
{
- HANDLE hContact = NULL;
+ HCONTACT 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++) {
- HANDLE hContact = getcontact(chat->recipients[i], 1, 0, NULL);
+ HCONTACT 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 HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact)
+static HCONTACT gg_getsubcontact(GGPROTO* gg, HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
char* szMetaProto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
@@ -397,10 +397,8 @@ static HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact)
if (szProto && szMetaProto && (INT_PTR)szMetaProto != CALLSERVICE_NOTFOUND && !lstrcmpA(szProto, szMetaProto))
{
int nSubContacts = (int)CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0), i;
- HANDLE hMetaContact;
- for (i = 0; i < nSubContacts; i++)
- {
- hMetaContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
+ for (i = 0; i < nSubContacts; i++) {
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
szProto = GetContactProto(hMetaContact);
if (szProto && !lstrcmpA(szProto, gg->m_szModuleName))
return hMetaContact;
@@ -425,7 +423,7 @@ static void gg_gc_resetclistopts(HWND hwndList)
static int gg_gc_countcheckmarks(HWND hwndList)
{
int count = 0;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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++;
@@ -477,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 (HANDLE hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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)) {
- HANDLE hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
+ HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
participants[i++] = db_get_dw(hMetaContact ? hMetaContact : hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
}
@@ -526,10 +524,10 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
if (!gg) break;
// Delete non-gg contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- HANDLE hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
+ HCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
if (hMetaContact) {
szProto = gg->m_szModuleName;
uin = (uin_t)gg->getDword(hMetaContact, GG_KEY_UIN, 0);
@@ -620,7 +618,7 @@ INT_PTR GGPROTO::gc_openconf(WPARAM wParam, LPARAM lParam)
return 1;
}
-int GGPROTO::gc_changenick(HANDLE hContact, TCHAR *ptszNick)
+int GGPROTO::gc_changenick(HCONTACT 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 15006095aa..607edfdb37 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -49,7 +49,7 @@ typedef struct _GGIMAGEENTRY
typedef struct
{
- HANDLE hContact;
+ HCONTACT 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, HANDLE hContact)
+GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, HCONTACT 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(HANDLE hContact, void *img)
+int GGPROTO::img_displayasmsg(HCONTACT 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(HANDLE hContact, void *img)
+int GGPROTO::img_display(HCONTACT 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 1ac699ffcd..e4954fc14c 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 (HANDLE hContact = db_find_first(gg->m_szModuleName); hContact; hContact = db_find_next(hContact, gg->m_szModuleName)) {
+ for (HCONTACT 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)
{
- HANDLE hContact = getcontact(uin, 1, 1, _A2T(strNick));
+ HCONTACT 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 2e6238a963..f241938c5a 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))
{
- HANDLE hContact = gg->getcontact(uin, 1, 0, NULL);
+ HCONTACT 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 f666244462..4b6d8610df 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 f95dc36351..54ade38cac 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -24,14 +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)
{
- HANDLE hContact;
- HANDLE hc;
+ HCONTACT hContact;
TCHAR szNick[256];
char szService[256];
bool bFlag = false;
CONTACT usertemp = { (TCHAR*)name.c_str(), NULL, NULL, false, false, true };
- hc = CList_FindContact(&usertemp);
+ HCONTACT hc = CList_FindContact(&usertemp);
if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && db_get_b(hc, "CList", "Hidden", 0) == 0)
bFlag = true;
@@ -63,9 +62,8 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), name.c_str());
}
else {
- CLISTEVENT cle = { 0 };
- cle.cbSize = sizeof(cle);
- cle.hContact = (HANDLE)hContact;
+ CLISTEVENT cle = { sizeof(cle) };
+ cle.hContact = hContact;
cle.hDbEvent = (HANDLE)"dccchat";
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadIconEx(IDI_DCC);
@@ -82,12 +80,12 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
return TRUE;
}
-HANDLE CIrcProto::CList_AddContact(CONTACT * user, bool InList, bool SetOnline)
+HCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline)
{
if (user->name == NULL)
return 0;
- HANDLE hContact = CList_FindContact(user);
+ HCONTACT hContact = CList_FindContact(user);
if (hContact) {
if (InList)
db_unset(hContact, "CList", "NotOnList");
@@ -99,7 +97,7 @@ HANDLE CIrcProto::CList_AddContact(CONTACT * user, bool InList, bool SetOnline)
}
// here we create a new one since no one is to be found
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
@@ -118,9 +116,9 @@ HANDLE CIrcProto::CList_AddContact(CONTACT * user, bool InList, bool SetOnline)
return false;
}
-HANDLE CIrcProto::CList_SetOffline(struct CONTACT * user)
+HCONTACT CIrcProto::CList_SetOffline(CONTACT *user)
{
- HANDLE hContact = CList_FindContact(user);
+ HCONTACT hContact = CList_FindContact(user);
if (hContact) {
DBVARIANT dbv;
if (!getTString(hContact, "Default", &dbv)) {
@@ -142,7 +140,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo)
DisconnectAllDCCSessions(false);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact))
continue;
@@ -162,7 +160,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo)
return true;
}
-HANDLE CIrcProto::CList_FindContact(CONTACT* user)
+HCONTACT CIrcProto::CList_FindContact(CONTACT *user)
{
if (!user || !user->name)
return 0;
@@ -170,11 +168,11 @@ HANDLE CIrcProto::CList_FindContact(CONTACT* user)
TCHAR* lowercasename = mir_tstrdup(user->name);
CharLower(lowercasename);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact))
continue;
- HANDLE hContact_temp = NULL;
+ HCONTACT hContact_temp = NULL;
ptrT DBNick(getTStringA(hContact, "Nick"));
ptrT DBUser(getTStringA(hContact, "UUser"));
ptrT DBHost(getTStringA(hContact, "UHost"));
@@ -185,7 +183,7 @@ HANDLE CIrcProto::CList_FindContact(CONTACT* user)
CharLower(DBWildcard);
if (IsChannel(user->name)) {
if (DBDefault && !lstrcmpi(DBDefault, user->name))
- hContact_temp = (HANDLE)-1;
+ hContact_temp = (HCONTACT)-1;
}
else if (user->ExactNick && DBNick && !lstrcmpi(DBNick, user->name))
hContact_temp = hContact;
@@ -210,7 +208,7 @@ HANDLE CIrcProto::CList_FindContact(CONTACT* user)
if (hContact_temp != NULL) {
mir_free(lowercasename);
- if (hContact_temp != (HANDLE)-1)
+ if (hContact_temp != (HCONTACT)-1)
return hContact_temp;
return 0;
}
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index c67304d98d..41556d434e 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -98,7 +98,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
int count = (int)CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)ppro->m_szModuleName);
for (int i = 0; i < count; i++) {
GC_INFO gci = { 0 };
- gci.Flags = BYINDEX | NAME | TYPE | COUNT;
+ gci.Flags = GCF_BYINDEX | GCF_NAME | GCF_TYPE | GCF_COUNT;
gci.iItem = i;
gci.pszModule = ppro->m_szModuleName;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
@@ -140,7 +140,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (name.IsEmpty() && name2.IsEmpty()) {
DBVARIANT dbv;
- for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
+ for (HCONTACT 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(HANDLE hContact, TCHAR* msg)
+int CIrcProto::AddOutgoingMessageToDB(HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT hContact = CList_FindContact(&user);
if (hContact) {
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_ONLINE);
@@ -615,7 +615,7 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
S2 = pmsg->parameters[0].c_str();
else {
GC_INFO gci = { 0 };
- gci.Flags = BYID | TYPE;
+ gci.Flags = GCF_BYID | GCF_TYPE;
gci.pszModule = m_szModuleName;
CMString S3 = GetWord(pmsg->parameters[1].c_str(), 0);
@@ -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'))) {
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT hContact = CList_FindContact(&user);
if (!hContact || (hContact && db_get_b(hContact, "CList", "Hidden", 0) == 1))
return true;
}
- HANDLE hContact = CList_AddContact(&user, false, true);
+ HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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;
- HANDLE hContact = CList_AddContact(&user, false, true);
+ HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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();
- HANDLE hContact = CList_FindContact(&finduser);
+ HCONTACT 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());
@@ -2370,7 +2370,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
int count = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
for (int i = 0; i < count; i++) {
GC_INFO gci = { 0 };
- gci.Flags = BYINDEX | DATA | NAME | TYPE;
+ gci.Flags = GCF_BYINDEX | GCF_DATA | GCF_NAME | GCF_TYPE;
gci.iItem = i;
gci.pszModule = m_szModuleName;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM) {
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index b11400f6d2..a78fabf304 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, HANDLE hContact)
+BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HCONTACT hContact)
{
TCHAR temp[30];
lstrcpyn(temp, GetWord(text.c_str(), 0).c_str(), 29);
@@ -371,7 +371,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HANDLE hContact
TCHAR szTemp[40];
CMString S = MakeWndID(window);
GC_INFO gci = { 0 };
- gci.Flags = BYID | NAME | COUNT;
+ gci.Flags = GCF_BYID | GCF_NAME | GCF_COUNT;
gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
@@ -628,7 +628,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HANDLE hContact
if (ulAdr) {
CONTACT user = { (TCHAR*)two.c_str(), NULL, NULL, false, false, true };
- HANDLE hContact = CList_AddContact(&user, false, false);
+ HCONTACT hContact = CList_AddContact(&user, false, false);
if (hContact) {
CMString s;
@@ -679,7 +679,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, HANDLE hContact
if (ulAdr) {
CMString contact = two; contact += _T(DCCSTRING);
CONTACT user = { (TCHAR*)contact.c_str(), NULL, NULL, false, false, true };
- HANDLE hContact = CList_AddContact(&user, false, false);
+ HCONTACT 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, HANDLE hContact, const TCHAR* szBuf)
+bool CIrcProto::PostIrcMessageWnd(TCHAR* window, HCONTACT hContact, const TCHAR* szBuf)
{
DBVARIANT dbv;
TCHAR windowname[256];
diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h
index 4e963e743c..cf351b65a5 100644
--- a/protocols/IRCG/src/irc.h
+++ b/protocols/IRCG/src/irc.h
@@ -217,76 +217,76 @@ struct CIrcProto : public PROTO<CIrcProto>
virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
- virtual int __cdecl Authorize( HANDLE hContact );
- virtual int __cdecl AuthDeny( HANDLE hContact, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ 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 HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
+ virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData);
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason );
- virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
+ 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 int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
- virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
- virtual HANDLE __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
- virtual HWND __cdecl SearchAdvanced( HWND owner );
- virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
+ virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
+ virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
+ virtual HANDLE __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName);
+ virtual HWND __cdecl SearchAdvanced(HWND owner);
+ virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode( HANDLE hContact, int mode );
- virtual int __cdecl SetStatus( int iNewStatus );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
+ virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
- virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
+ virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
// Services
- INT_PTR __cdecl SvcCreateAccMgrUI( WPARAM, LPARAM );
- INT_PTR __cdecl GetMyAwayMsg( WPARAM, LPARAM );
-
- INT_PTR __cdecl OnChangeNickMenuCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnDoubleclicked( WPARAM, LPARAM );
- INT_PTR __cdecl OnJoinChat( WPARAM, LPARAM );
- INT_PTR __cdecl OnJoinMenuCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnLeaveChat( WPARAM, LPARAM );
- INT_PTR __cdecl OnMenuChanSettings( WPARAM, LPARAM );
+ INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
+ INT_PTR __cdecl GetMyAwayMsg(WPARAM, LPARAM);
+
+ INT_PTR __cdecl OnChangeNickMenuCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnDoubleclicked(WPARAM, LPARAM);
+ INT_PTR __cdecl OnJoinChat(WPARAM, LPARAM);
+ INT_PTR __cdecl OnJoinMenuCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnLeaveChat(WPARAM, LPARAM);
+ INT_PTR __cdecl OnMenuChanSettings(WPARAM, LPARAM);
INT_PTR __cdecl OnMenuDisconnect( WPARAM , LPARAM );
- INT_PTR __cdecl OnMenuIgnore( WPARAM, LPARAM );
- INT_PTR __cdecl OnMenuWhois( WPARAM, LPARAM );
+ INT_PTR __cdecl OnMenuIgnore(WPARAM, LPARAM);
+ INT_PTR __cdecl OnMenuWhois(WPARAM, LPARAM);
INT_PTR __cdecl OnQuickConnectMenuCommand(WPARAM, LPARAM );
- INT_PTR __cdecl OnShowListMenuCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnShowServerMenuCommand( WPARAM, LPARAM );
+ INT_PTR __cdecl OnShowListMenuCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnShowServerMenuCommand(WPARAM, LPARAM);
// Events
- int __cdecl OnContactDeleted( WPARAM, LPARAM );
- int __cdecl OnInitOptionsPages( WPARAM, LPARAM );
- int __cdecl OnInitUserInfo( WPARAM, LPARAM );
- int __cdecl OnModulesLoaded( WPARAM, LPARAM );
- int __cdecl OnMenuPreBuild( WPARAM, LPARAM );
- int __cdecl OnPreShutdown( WPARAM, LPARAM );
- int __cdecl OnDbSettingChanged( WPARAM, LPARAM );
+ int __cdecl OnContactDeleted(WPARAM, LPARAM);
+ int __cdecl OnInitOptionsPages(WPARAM, LPARAM);
+ int __cdecl OnInitUserInfo(WPARAM, LPARAM);
+ int __cdecl OnModulesLoaded(WPARAM, LPARAM);
+ int __cdecl OnMenuPreBuild(WPARAM, LPARAM);
+ int __cdecl OnPreShutdown(WPARAM, LPARAM);
+ int __cdecl OnDbSettingChanged(WPARAM, LPARAM);
- int __cdecl GCEventHook( WPARAM, LPARAM );
- int __cdecl GCMenuHook( WPARAM, LPARAM );
+ int __cdecl GCEventHook(WPARAM, LPARAM);
+ int __cdecl GCMenuHook(WPARAM, LPARAM);
// Data
@@ -389,46 +389,46 @@ struct CIrcProto : public PROTO<CIrcProto>
CDlgBase::CreateParam OptCreateAccount, OptCreateConn, OptCreateIgnore, OptCreateOther;
//clist.cpp
- HANDLE CList_AddContact(struct CONTACT * user, bool InList, bool SetOnline);
- bool CList_SetAllOffline(BYTE ChatsToo);
- HANDLE CList_SetOffline(struct CONTACT * user);
+ HCONTACT CList_AddContact(CONTACT *user, bool InList, bool SetOnline);
+ bool CList_SetAllOffline(BYTE ChatsToo);
+ HCONTACT CList_SetOffline(CONTACT *user);
- bool CList_AddEvent(struct CONTACT * user, HICON Icon, HANDLE event, const char * tooltip, int type ) ;
- HANDLE CList_FindContact (struct CONTACT * user);
- BOOL CList_AddDCCChat(const CMString& name, const CMString& hostmask, unsigned long adr, int port) ;
+ bool CList_AddEvent(CONTACT *user, HICON Icon, HANDLE event, const char *tooltip, int type ) ;
+ HCONTACT 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(HANDLE hContact, TCHAR* msg);
+ int AddOutgoingMessageToDB(HCONTACT hContact, TCHAR *msg);
bool DoOnConnect(const CIrcMessage *pmsg);
- int DoPerform(const char* event);
- void __cdecl ResolveIPThread( void* di );
+ int DoPerform(const char *event);
+ void __cdecl ResolveIPThread(void *di);
- bool AddIgnore(const TCHAR* mask, const TCHAR* mode, const TCHAR* network) ;
- int IsIgnored(const CMString& nick, const CMString& address, const CMString& host, char type) ;
+ bool AddIgnore(const TCHAR *mask, const TCHAR *mode, const TCHAR *network) ;
+ int IsIgnored(const CMString &nick, const CMString &address, const CMString &host, char type) ;
int IsIgnored(CMString user, char type);
- bool RemoveIgnore(const TCHAR* mask) ;
+ bool RemoveIgnore(const TCHAR *mask) ;
//input.cpp
CMString DoAlias( const TCHAR *text, TCHAR *window);
- BOOL DoHardcodedCommand( CMString text, TCHAR* window, HANDLE hContact );
- CMString DoIdentifiers( CMString text, const TCHAR* window );
- void FormatMsg(CMString& text);
- bool PostIrcMessageWnd(TCHAR* pszWindow, HANDLE hContact,const TCHAR* szBuf);
- bool PostIrcMessage( const TCHAR* fmt, ...);
+ BOOL DoHardcodedCommand(CMString text, TCHAR *window, HCONTACT hContact);
+ CMString DoIdentifiers(CMString text, const TCHAR *window);
+ void FormatMsg(CMString &text);
+ bool PostIrcMessageWnd(TCHAR *pszWindow, HCONTACT hContact, const TCHAR *szBuf);
+ bool PostIrcMessage(const TCHAR *fmt, ...);
// irclib.cpp
UINT_PTR DCCTimer;
- void SendIrcMessage( const TCHAR*, bool bNotify = true, int codepage = -1 );
+ void SendIrcMessage(const TCHAR*, bool bNotify = true, int codepage = -1);
// ircproto.cpp
- void __cdecl AckBasicSearch( void* param );
- void __cdecl AckMessageFail( void* info );
- void __cdecl AckMessageFailDcc( void* info );
- void __cdecl AckMessageSuccess( void* info );
+ void __cdecl AckBasicSearch(void* param);
+ void __cdecl AckMessageFail(void* info);
+ void __cdecl AckMessageFailDcc(void* info);
+ void __cdecl AckMessageSuccess(void* info);
- int SetStatusInternal( int iNewStatus, bool bIsInternal );
+ int SetStatusInternal(int iNewStatus, bool bIsInternal);
//options.cpp
HWND m_hwndConnect;
@@ -501,12 +501,12 @@ struct CIrcProto : public PROTO<CIrcProto>
////////////////////////////////////////////////////////////////////////////////////////
// former CIrcSession class
- void AddDCCSession(HANDLE hContact, CDccSession* dcc);
+ void AddDCCSession(HCONTACT hContact, CDccSession* dcc);
void AddDCCSession(DCCINFO* pdci, CDccSession* dcc);
- void RemoveDCCSession(HANDLE hContact);
+ void RemoveDCCSession(HCONTACT hContact);
void RemoveDCCSession(DCCINFO* pdci);
- CDccSession* FindDCCSession(HANDLE hContact);
+ CDccSession* FindDCCSession(HCONTACT 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 f1daa53f6a..b1e97a4212 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(HANDLE, CDccSession* dcc)
+void CIrcProto::AddDCCSession(HCONTACT, CDccSession* dcc)
{
EnterCriticalSection(&m_dcc);
@@ -479,7 +479,7 @@ void CIrcProto::AddDCCSession(DCCINFO*, CDccSession* dcc)
LeaveCriticalSection(&m_dcc);
}
-void CIrcProto::RemoveDCCSession(HANDLE hContact)
+void CIrcProto::RemoveDCCSession(HCONTACT hContact)
{
EnterCriticalSection(&m_dcc);
@@ -505,7 +505,7 @@ void CIrcProto::RemoveDCCSession(DCCINFO* pdci)
LeaveCriticalSection(&m_dcc);
}
-CDccSession* CIrcProto::FindDCCSession(HANDLE hContact)
+CDccSession* CIrcProto::FindDCCSession(HCONTACT hContact)
{
EnterCriticalSection(&m_dcc);
diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h
index 7dcb5a4c01..d0efcd6fcf 100644
--- a/protocols/IRCG/src/irclib.h
+++ b/protocols/IRCG/src/irclib.h
@@ -35,20 +35,20 @@ namespace irc {
struct DCCINFO : public MZeroedObject
{
- DWORD dwAdr;
+ DWORD dwAdr;
unsigned __int64 dwSize;
- DWORD iType;
+ DWORD iType;
CMString sToken;
- int iPort;
- BOOL bTurbo;
- BOOL bSSL;
- BOOL bSender;
- BOOL bReverse;
+ int iPort;
+ BOOL bTurbo;
+ BOOL bSSL;
+ BOOL bSender;
+ BOOL bReverse;
CMString sPath;
CMString sFile;
CMString sFileAndPath;
CMString sHostmask;
- HANDLE hContact;
+ HCONTACT hContact;
CMString sContactName;
};
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 06d2ae0397..e1a26116f4 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -327,7 +327,7 @@ HANDLE __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 };
- HANDLE hContact = CList_AddContact(&user, true, false);
+ HCONTACT hContact = CList_AddContact(&user, true, false);
if (hContact) {
DBVARIANT dbv1;
@@ -383,7 +383,7 @@ int __cdecl CIrcProto::AuthDeny(HANDLE, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CIrcProto::AuthRecv(HANDLE, PROTORECVEVENT*)
+int __cdecl CIrcProto::AuthRecv(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -391,7 +391,7 @@ int __cdecl CIrcProto::AuthRecv(HANDLE, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIrcProto::AuthRequest(HANDLE, const TCHAR*)
+int __cdecl CIrcProto::AuthRequest(HCONTACT, const TCHAR*)
{
return 1;
}
@@ -407,7 +407,7 @@ HANDLE __cdecl CIrcProto::ChangeInfo(int, void*)
////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CIrcProto::FileAllow(HANDLE, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIrcProto::FileAllow(HCONTACT, HANDLE hTransfer, const TCHAR* szPath)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -428,7 +428,7 @@ HANDLE __cdecl CIrcProto::FileAllow(HANDLE, HANDLE hTransfer, const TCHAR* szPat
////////////////////////////////////////////////////////////////////////////////////////
// FileCancel - cancels a file transfer
-int __cdecl CIrcProto::FileCancel(HANDLE, HANDLE hTransfer)
+int __cdecl CIrcProto::FileCancel(HCONTACT, HANDLE hTransfer)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -444,7 +444,7 @@ int __cdecl CIrcProto::FileCancel(HANDLE, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CIrcProto::FileDeny(HANDLE, HANDLE hTransfer, const TCHAR*)
+int __cdecl CIrcProto::FileDeny(HCONTACT, 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, HANDLE)
+DWORD_PTR __cdecl CIrcProto::GetCaps(int type, HCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -531,7 +531,7 @@ DWORD_PTR __cdecl CIrcProto::GetCaps(int type, HANDLE)
////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CIrcProto::GetInfo(HANDLE, int)
+int __cdecl CIrcProto::GetInfo(HCONTACT, int)
{
return 1;
}
@@ -599,7 +599,7 @@ HWND __cdecl CIrcProto::SearchAdvanced(HWND)
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CIrcProto::RecvContacts(HANDLE, PROTORECVEVENT*)
+int __cdecl CIrcProto::RecvContacts(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -607,7 +607,7 @@ int __cdecl CIrcProto::RecvContacts(HANDLE, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CIrcProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
+int __cdecl CIrcProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -615,7 +615,7 @@ int __cdecl CIrcProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CIrcProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
+int __cdecl CIrcProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt)
{
return Proto_RecvMessage(hContact, evt);
}
@@ -623,7 +623,7 @@ int __cdecl CIrcProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CIrcProto::RecvUrl(HANDLE, PROTORECVEVENT*)
+int __cdecl CIrcProto::RecvUrl(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -631,7 +631,7 @@ int __cdecl CIrcProto::RecvUrl(HANDLE, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CIrcProto::SendContacts(HANDLE, int, int, HANDLE*)
+int __cdecl CIrcProto::SendContacts(HCONTACT, int, int, HCONTACT*)
{
return 1;
}
@@ -639,7 +639,7 @@ int __cdecl CIrcProto::SendContacts(HANDLE, int, int, HANDLE*)
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIrcProto::SendFile(HANDLE hContact, const TCHAR*, TCHAR** ppszFiles)
+HANDLE __cdecl CIrcProto::SendFile(HCONTACT hContact, const TCHAR*, TCHAR** ppszFiles)
{
DCCINFO* dci = NULL;
int iPort = 0;
@@ -780,22 +780,22 @@ HANDLE __cdecl CIrcProto::SendFile(HANDLE hContact, const TCHAR*, TCHAR** ppszFi
struct TFakeAckParam
{
- __inline TFakeAckParam(HANDLE _hContact, int _msgid) :
+ __inline TFakeAckParam(HCONTACT _hContact, int _msgid) :
hContact(_hContact), msgid(_msgid)
{}
- HANDLE hContact;
+ HCONTACT hContact;
int msgid;
};
void __cdecl CIrcProto::AckMessageFail(void *info)
{
- ProtoBroadcastAck(info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
+ ProtoBroadcastAck((HCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
}
void __cdecl CIrcProto::AckMessageFailDcc(void *info)
{
- ProtoBroadcastAck(info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active"));
+ ProtoBroadcastAck((HCONTACT)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(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CIrcProto::SendMsg(HCONTACT 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(HANDLE hContact, int flags, const char* pszSrc)
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CIrcProto::SendUrl(HANDLE, int, const char*)
+int __cdecl CIrcProto::SendUrl(HCONTACT, int, const char*)
{
return 1;
}
@@ -854,7 +854,7 @@ int __cdecl CIrcProto::SendUrl(HANDLE, int, const char*)
////////////////////////////////////////////////////////////////////////////////////////
// SetApparentMode - sets the visibility status
-int __cdecl CIrcProto::SetApparentMode(HANDLE, int)
+int __cdecl CIrcProto::SetApparentMode(HCONTACT, 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(HANDLE hContact)
+HANDLE __cdecl CIrcProto::GetAwayMsg(HCONTACT hContact)
{
WhoisAwayReply = _T("");
DBVARIANT dbv;
@@ -963,7 +963,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG
-int __cdecl CIrcProto::RecvAwayMsg(HANDLE, int, PROTORECVEVENT*)
+int __cdecl CIrcProto::RecvAwayMsg(HCONTACT, 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(HANDLE, int)
+int __cdecl CIrcProto::UserIsTyping(HCONTACT, int)
{
return 0;
}
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index e472e2259f..84dfcc8203 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -188,7 +188,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
else if (sRequest == "usercount" && !sChannel.IsEmpty()) {
CMString S = MakeWndID(sChannel.c_str());
GC_INFO gci = { 0 };
- gci.Flags = BYID | COUNT;
+ gci.Flags = GCF_BYID | GCF_COUNT;
gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
@@ -200,7 +200,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
else if (sRequest == "userlist" && !sChannel.IsEmpty()) {
CMString S = MakeWndID(sChannel.c_str());
GC_INFO gci = { 0 };
- gci.Flags = BYID | USERS;
+ gci.Flags = GCF_BYID | GCF_USERS;
gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
@@ -213,7 +213,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
int j = 0;
while (j < i) {
GC_INFO gci = { 0 };
- gci.Flags = BYINDEX | ID;
+ gci.Flags = GCF_BYINDEX | GCF_ID;
gci.pszModule = m_szModuleName;
gci.iItem = j;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 2fe0fd2c81..8e82c02da0 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(HANDLE hContact)
+static CIrcProto* IrcGetInstanceByHContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -105,25 +105,25 @@ static CIrcProto* IrcGetInstanceByHContact(HANDLE hContact)
static INT_PTR IrcMenuChanSettings(WPARAM wParam, LPARAM lParam)
{
- CIrcProto *ppro = IrcGetInstanceByHContact((HANDLE)wParam);
+ CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnMenuChanSettings(wParam, lParam) : 0;
}
static INT_PTR IrcMenuWhois(WPARAM wParam, LPARAM lParam)
{
- CIrcProto *ppro = IrcGetInstanceByHContact((HANDLE)wParam);
+ CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnMenuWhois(wParam, lParam) : 0;
}
static INT_PTR IrcMenuDisconnect(WPARAM wParam, LPARAM lParam)
{
- CIrcProto *ppro = IrcGetInstanceByHContact((HANDLE)wParam);
+ CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnMenuDisconnect(wParam, lParam) : 0;
}
static INT_PTR IrcMenuIgnore(WPARAM wParam, LPARAM lParam)
{
- CIrcProto *ppro = IrcGetInstanceByHContact((HANDLE)wParam);
+ CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)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((HANDLE)wParam);
+ CIrcProto *ppro = IrcGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnMenuPreBuild(wParam, lParam) : 0;
}
@@ -196,7 +196,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam)
CLISTEVENT* pcle = (CLISTEVENT*)lParam;
- if (getByte((HANDLE)pcle->hContact, "DCC", 0) != 0) {
+ if (getByte(pcle->hContact, "DCC", 0) != 0) {
DCCINFO* pdci = (DCCINFO*)pcle->lParam;
CMessageBoxDlg* dlg = new CMessageBoxDlg(this, pdci);
dlg->Show();
@@ -213,7 +213,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam)
int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM)
{
- HANDLE hContact = (HANDLE)wp;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wp, "DCC", 0);
+ BYTE bDCC = getByte((HCONTACT)wp, "DCC", 0);
if (bDCC) {
- CDccSession* dcc = FindDCCSession((HANDLE)wp);
+ CDccSession* dcc = FindDCCSession((HCONTACT)wp);
if (dcc)
dcc->Disconnect();
}
@@ -252,8 +252,8 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM)
return 0;
DBVARIANT dbv;
- if (!getTString((HANDLE)wp, "Nick", &dbv)) {
- if (getByte((HANDLE)wp, "ChatRoom", 0) == GCW_CHATROOM)
+ if (!getTString((HCONTACT)wp, "Nick", &dbv)) {
+ if (getByte((HCONTACT)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((HANDLE)wp, "Nick", &dbv)) {
- if (getByte((HANDLE)wp, "ChatRoom", 0) == GCW_CHATROOM) {
+ if (!getTString((HCONTACT)wp, "Nick", &dbv)) {
+ if (getByte((HCONTACT)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;
- HANDLE hContact = (HANDLE)wp;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wp, "Nick", &dbv)) {
+ if (!getTString((HCONTACT)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((HANDLE)wp);
+ CDccSession* dcc = FindDCCSession((HCONTACT)wp);
if (dcc)
dcc->Disconnect();
return 0;
@@ -321,7 +321,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM)
if (!wp)
return 0;
- HANDLE hContact = (HANDLE)wp;
+ HCONTACT hContact = (HCONTACT)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 };
- HANDLE hContact = CList_FindContact(&user);
+ HCONTACT 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL || !IsConnected())
return 0;
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp
index 2e6943b123..a62a7fbc5d 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(HANDLE hContact)
+void CCtrlClc::AddContact(HCONTACT 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(HANDLE hContact)
+HANDLE CCtrlClc::FindContact(HCONTACT 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 b5fe9dadb4..c42ea6a668 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(HANDLE hContact);
+ void AddContact(HCONTACT 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(HANDLE hContact);
+ HANDLE FindContact(HCONTACT 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 7ed1fc12a0..dc4a5c8b14 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, HANDLE _info ) :
- ppro( _pro ),
- hContact( _info )
+ UserDetailsDlgProcParam(CIrcProto* _pro, HCONTACT _info) :
+ ppro(_pro),
+ hContact(_info)
{}
CIrcProto *ppro;
- HANDLE hContact;
+ HCONTACT 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, (HANDLE)lParam);
+ p = new UserDetailsDlgProcParam(NULL, (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)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 818d5ce6de..76e290f704 100644
--- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp
+++ b/protocols/IcqOscarJ/src/UI/askauthentication.cpp
@@ -32,7 +32,7 @@
struct AskAuthParam
{
CIcqProto* ppro;
- HANDLE hContact;
+ HCONTACT 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, (HANDLE)wParam };
+ AskAuthParam param = { this, (HCONTACT)wParam };
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)&param);
return 0;
}
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
index 04c785fc87..1c0bcb67f4 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, HANDLE hContact, char* szModule, char* szSetting, int special)
+static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HCONTACT 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;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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((HANDLE)lParam)) && lParam)
+ if ((!IsICQContact((HCONTACT)lParam)) && lParam)
return 0;
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp
index e1b8b47a94..91e464b561 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(HANDLE hContact)
+void CIcqProto::ClearAllContactCapabilities(HCONTACT hContact)
{
setDword(hContact, DBSETTING_CAPABILITIES, 0);
}
// Deletes one or many oscar capabilities for a given contact
-void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+void CIcqProto::ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -129,7 +129,7 @@ void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
// Sets one or many oscar capabilities for a given contact
-void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+void CIcqProto::SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -149,7 +149,7 @@ void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
// Returns true if the given contact supports the requested capabilites
-BOOL CIcqProto::CheckContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
+BOOL CIcqProto::CheckContactCapabilities(HCONTACT 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(HANDLE hContact, BYTE *pBuffer, int nLength)
+void CIcqProto::AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength)
{
// Get current capability flags
DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
@@ -241,7 +241,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nL
// Scans a binary buffer for oscar capabilities and adds them to the contact.
// You probably want to call ClearAllContactCapabilities() first.
-void CIcqProto::SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength, BOOL bReset)
+void CIcqProto::SetCapabilitiesFromBuffer(HCONTACT 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 36aa83c329..f5e7999a77 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, HANDLE hContact, void *pvExtra)
+DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, HCONTACT hContact, void *pvExtra)
{
icq_lock l(cookieMutex);
@@ -96,13 +96,12 @@ int CIcqProto::GetCookieType(DWORD dwCookie)
}
-int CIcqProto::FindCookie(DWORD dwCookie, HANDLE *phContact, void **ppvExtra)
+int CIcqProto::FindCookie(DWORD dwCookie, HCONTACT *phContact, void **ppvExtra)
{
icq_lock l(cookieMutex);
- int i = cookies.getIndex(( icq_cookie_info* )&dwCookie );
- if (i != INVALID_COOKIE_INDEX)
- {
+ int i = cookies.getIndex((icq_cookie_info*)&dwCookie);
+ if (i != INVALID_COOKIE_INDEX) {
if (phContact)
*phContact = cookies[i]->hContact;
if (ppvExtra)
@@ -116,7 +115,7 @@ int CIcqProto::FindCookie(DWORD dwCookie, HANDLE *phContact, void **ppvExtra)
}
-int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phContact)
+int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HCONTACT *phContact)
{
icq_lock l(cookieMutex);
@@ -138,7 +137,7 @@ int CIcqProto::FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phConta
}
-int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact, void** ppvExtra)
+int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HCONTACT *phContact, void** ppvExtra)
{
icq_lock l(cookieMutex);
@@ -162,7 +161,7 @@ int CIcqProto::FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact,
}
-int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HANDLE *phContact, cookie_message_data **ppvExtra)
+int CIcqProto::FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HCONTACT *phContact, cookie_message_data **ppvExtra)
{
icq_lock l(cookieMutex);
@@ -278,7 +277,7 @@ cookie_message_data* CIcqProto::CreateMessageCookie(WORD bMsgType, BYTE bAckType
}
-cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HANDLE hContact, DWORD dwUin, int bUseSrvRelay)
+cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HCONTACT 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 05e0d170eb..a6017d174c 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;
- HANDLE hContact;
+ HCONTACT hContact;
void *pvExtra;
time_t dwTime;
BYTE bType;
@@ -114,7 +114,7 @@ struct cookie_search
struct cookie_avatar
{
DWORD dwUin;
- HANDLE hContact;
+ HCONTACT hContact;
unsigned int hashlen;
BYTE *hash;
unsigned int cbData;
@@ -124,7 +124,7 @@ struct cookie_avatar
struct cookie_reverse_connect: public cookie_message_data
{
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwUin;
int type;
void *ft;
diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp
index d4eb61dbc2..fa42c76c7b 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(HANDLE hContact, int type)
+DWORD CIcqProto::icq_sendGetAwayMsgDirect(HCONTACT 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(HANDLE hContact, filetransfer* ft)
+void CIcqProto::icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer* ft)
{
// v7 packet
icq_packet packet;
@@ -144,7 +144,7 @@ void CIcqProto::icq_sendFileAcceptDirect(HANDLE hContact, filetransfer* ft)
}
-void CIcqProto::icq_sendFileDenyDirect(HANDLE hContact, filetransfer *ft, const char *szReason)
+void CIcqProto::icq_sendFileDenyDirect(HCONTACT 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(HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap)
+DWORD CIcqProto::icq_SendDirectMessage(HCONTACT 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(HANDLE hContact, const char *szMessage, i
return 0; // Failure
}
-void CIcqProto::icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType)
+void CIcqProto::icq_sendXtrazRequestDirect(HCONTACT hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType)
{
icq_packet packet;
@@ -272,7 +272,7 @@ void CIcqProto::icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char
SendDirectMessage(hContact, &packet);
}
-void CIcqProto::icq_sendXtrazResponseDirect(HANDLE hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType)
+void CIcqProto::icq_sendXtrazResponseDirect(HCONTACT 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 3314f6bdef..a2f5ec6ac4 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, HANDLE* hContactResume)
+char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HCONTACT *hContactResume)
{
char* szList;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wCurrentLen = 0;
DWORD dwUIN;
uid_str szUID;
@@ -611,7 +611,7 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HANDLE* hContactResume)
void CIcqProto::sendEntireListServ(WORD wFamily, WORD wSubtype, int listType)
{
- HANDLE hResumeContact = NULL;
+ HCONTACT 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 e360b9dc8b..d5d6ec590a 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;
- HANDLE hCookieContact;
+ HCONTACT hCookieContact;
cookie_fam15_data *pCookieData;
@@ -101,12 +101,10 @@ static char* AimApplyEncoding(char* pszStr, const char* pszEncoding)
void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie)
{
- HANDLE hContact;
DWORD dwUIN;
uid_str szUID;
WORD wTLVCount;
WORD wWarningLevel;
- HANDLE hCookieContact;
WORD status;
cookie_message_data *pCookieData;
@@ -126,33 +124,30 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie
wLen -= 2;
// Determine contact
- hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
// Ignore away status if the user is not already on our list
- if (hContact == INVALID_HANDLE_VALUE)
- {
+ if (hContact == INVALID_HANDLE_VALUE) {
#ifdef _DEBUG
debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID));
#endif
return;
}
- if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData))
- {
+ HCONTACT hCookieContact;
+ if (!FindCookie(dwCookie, &hCookieContact, (void**)&pCookieData)) {
debugLogA("Error: Received unexpected away reply from %s", strUID(dwUIN, szUID));
return;
}
- if (hContact != hCookieContact)
- {
+ if (hContact != hCookieContact) {
debugLogA("Error: Away reply Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
}
- switch (GetCookieType(dwCookie))
- {
+ switch (GetCookieType(dwCookie)) {
case CKT_FAMILYSPECIAL:
{
ReleaseCookie(dwCookie);
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp
index 94f5e1c930..d443919e6c 100644
--- a/protocols/IcqOscarJ/src/fam_03buddy.cpp
+++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp
@@ -196,7 +196,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
wLen -= 2;
// Ignore status notification if the user is not already on our list
- HANDLE hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
#ifdef _DEBUG
@@ -618,7 +618,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
}
// Determine contact
- HANDLE hContact = HContactFromUID(dwUIN, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
// Skip contacts that are not already on our list or are already offline
if (hContact != INVALID_HANDLE_VALUE)
@@ -666,7 +666,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
}
-void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar_tlv_chain *pChain)
+void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HCONTACT 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 ed84dad0dc..bd53d9c045 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(HANDLE hContact, const char *szMsg)
+char* CIcqProto::convertMsgToUserSpecificUtf(HCONTACT 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;
- HANDLE hContact = HContactFromUID(dwUin, szUID, &bAdded);
+ HCONTACT 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
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (wCommand == 1)
{
@@ -575,7 +575,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
unpackLEDWord(&buf, &dwUin);
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT hContact = HContactFromUIN(dwUin, NULL);
if (hContact == INVALID_HANDLE_VALUE)
{
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, HANDLE hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType)
+void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType)
{
WORD wId;
@@ -886,7 +886,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
}
-void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE 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, HCONTACT 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, HANDLE hCont
void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (wCommand == 0)
{ // received contacts
@@ -1231,10 +1231,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
else if (wCommand == 2)
{ // acknowledgement
DWORD dwCookie;
- HANDLE hCookieContact;
-
- if (FindMessageCookie(dwID1, dwID2, &dwCookie, &hCookieContact, NULL))
- {
+ HCONTACT 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);
@@ -1242,8 +1240,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, WORD wLen, DWORD dwUin, cha
ReleaseCookie(dwCookie);
}
- else
- debugLogA("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
+ else debugLogA("Warning: Unexpected Contact Transfer ack from %s", strUID(dwUin, szUID));
}
}
@@ -1622,7 +1619,7 @@ void packPluginTypeId(icq_packet *packet, int nTypeID)
}
-void CIcqProto::handleStatusMsgReply(const char *szPrefix, HANDLE hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
+void CIcqProto::handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
{
if (hContact == INVALID_HANDLE_VALUE) {
debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin);
@@ -1652,10 +1649,10 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD
{
if (bFlags == 3)
{
- HANDLE hCookieContact;
+ HCONTACT hCookieContact;
cookie_message_data *pCookieData = NULL;
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
{
@@ -1687,7 +1684,7 @@ HANDLE CIcqProto::handleMessageAck(DWORD dwUin, char *szUID, WORD wCookie, WORD
/* this function send all acks from handleMessageTypes */
-void CIcqProto::sendMessageTypesAck(HANDLE hContact, int bUnicode, message_ack_params *pArgs)
+void CIcqProto::sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs)
{
if (pArgs)
{
@@ -1712,7 +1709,7 @@ void CIcqProto::sendMessageTypesAck(HANDLE hContact, int bUnicode, message_ack_p
/* 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)
{
- HANDLE hContact = INVALID_HANDLE_VALUE;
+ HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
BOOL bThruDC = (nMsgFlags & MTF_DIRECT) == MTF_DIRECT;
int bAdded;
@@ -2189,7 +2186,6 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
WORD bMsgType = 0;
BYTE bFlags;
WORD wLength;
- HANDLE hCookieContact;
DWORD dwMsgID1, dwMsgID2;
WORD wVersion = 0;
cookie_message_data *pCookieData = NULL;
@@ -2209,40 +2205,38 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL);
buf += 2; // 3. unknown
wLen -= 2;
- if (!FindMessageCookie(dwMsgID1, dwMsgID2, &dwCookie, &hCookieContact, &pCookieData))
- {
+ HCONTACT 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;
}
- if (IsValidOscarTransfer(pCookieData))
- { // it is OFT response
+ if (IsValidOscarTransfer(pCookieData)) {
+ // it is OFT response
handleRecvServResponseOFT(buf, wLen, dwUin, szUid, pCookieData);
return;
}
- if (!dwUin)
- { // AIM cannot send this - just sanity
+ if (!dwUin) {
+ // AIM cannot send this - just sanity
debugLogA("Error: Invalid UID in message response.");
return;
}
// Length of sub chunk?
- if (wLen >= 2)
- {
+ if (wLen >= 2) {
unpackLEWord(&buf, &wLength);
wLen -= 2;
}
- else
- wLength = 0;
+ else wLength = 0;
- if (wLength == 0x1b && pCookieData->bMessageType != MTYPE_REVERSE_REQUEST)
- { // this can be v8 greeting message reply
+ if (wLength == 0x1b && pCookieData->bMessageType != MTYPE_REVERSE_REQUEST) {
+ // this can be v8 greeting message reply
WORD wCookie;
unpackLEWord(&buf, &wVersion);
@@ -2270,8 +2264,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
buf += 2;
wLen -= 2;
- if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData))
- { // use old reliable method
+ if (!FindCookie(wCookie, &hCookieContact, (void**)&pCookieData)) {
+ // use old reliable method
debugLogA("Warning: Invalid cookie in %s from (%u)", "message response", dwUin);
if (pCookieData->bMessageType != MTYPE_AUTOAWAY && bFlags == 3)
@@ -2282,8 +2276,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
- else if (bMsgType != MTYPE_PLUGIN && pCookieData->bMessageType != MTYPE_AUTOAWAY)
- { // just because some clients break it...
+ else if (bMsgType != MTYPE_PLUGIN && pCookieData->bMessageType != MTYPE_AUTOAWAY) {
+ // just because some clients break it...
dwCookie = wCookie;
if (bMsgType != pCookieData->bMessageType)
@@ -2291,45 +2285,35 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
bMsgType = pCookieData->bMessageType;
}
- else if (pCookieData->bMessageType == MTYPE_AUTOAWAY && bMsgType != MTYPE_PLUGIN)
- {
+ else if (pCookieData->bMessageType == MTYPE_AUTOAWAY && bMsgType != MTYPE_PLUGIN) {
if (bMsgType != pCookieData->nAckType)
debugLogA("Warning: Invalid message type in %s from (%u)", "message response", dwUin);
}
}
- else
- {
+ else {
bMsgType = pCookieData->bMessageType;
bFlags = 0;
}
- if (hCookieContact != hContact)
- {
+ if (hCookieContact != hContact) {
debugLogA("SNAC(4.B) Ack Contact does not match Cookie Contact(0x%x != 0x%x)", hContact, hCookieContact);
-
ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
return;
}
if (bFlags == 3) // A status message reply
- {
handleStatusMsgReply("SNAC(4.B) ", hContact, dwUin, wVersion, bMsgType, (WORD)dwCookie, (char*)(buf + 2), 0);
- }
- else
- { // An ack of some kind
+ else {
+ // An ack of some kind
int ackType;
-
- if (hContact == NULL || hContact == INVALID_HANDLE_VALUE)
- {
+ if (hContact == NULL || hContact == INVALID_HANDLE_VALUE) {
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;
}
switch (bMsgType) {
-
case MTYPE_FILEREQ:
{
char* szMsg;
@@ -2340,8 +2324,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
wLen -= 2;
szMsg = (char *)_alloca(wMsgLen + 1);
szMsg[wMsgLen] = '\0';
- if (wMsgLen > 0)
- {
+ if (wMsgLen > 0) {
memcpy(szMsg, buf, wMsgLen);
buf += wMsgLen;
wLen -= wMsgLen;
@@ -2361,8 +2344,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
WORD wFunctionId;
- if (wLength != 0x1B)
- {
+ if (wLength != 0x1B) {
debugLogA("Invalid Greeting %s", "message response");
ReleaseCookie(dwCookie);
@@ -2378,22 +2360,18 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
wLen -= wMsgLen;
// This packet is malformed. Possibly a file accept from Miranda IM 0.1.2.1
- if (wLen < 20)
- {
+ if (wLen < 20) {
ReleaseCookie(dwCookie);
return;
}
- if (!unpackPluginTypeId(&buf, &wLen, &typeId, &wFunctionId, FALSE))
- {
+ if (!unpackPluginTypeId(&buf, &wLen, &typeId, &wFunctionId, FALSE)) {
ReleaseCookie(dwCookie);
return;
}
- if (wLen < 4)
- {
+ if (wLen < 4) {
debugLogA("Error: Invalid greeting %s", "message response");
-
ReleaseCookie(dwCookie);
return;
}
@@ -2407,12 +2385,10 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
else
dwDataLen = 0;
-
- switch (typeId)
- {
+ switch (typeId) {
case MTYPE_PLAIN:
- if (pCookieData && pCookieData->bMessageType == MTYPE_AUTOAWAY && dwLengthToEnd >= 4)
- { // ICQ 6 invented this
+ if (pCookieData && pCookieData->bMessageType == MTYPE_AUTOAWAY && dwLengthToEnd >= 4) {
+ // ICQ 6 invented this
char *szMsg = (char*)_alloca(dwDataLen + 1);
if (dwDataLen > 0)
@@ -2423,8 +2399,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
ReleaseCookie(dwCookie);
return;
}
- else
- ackType = ACKTYPE_MESSAGE;
+ ackType = ACKTYPE_MESSAGE;
break;
case MTYPE_URL:
@@ -2436,9 +2411,8 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
break;
case MTYPE_FILEREQ:
+ debugLogA("This is file ack");
{
- debugLogA("This is file ack");
-
char *szMsg = (char *)_alloca(dwDataLen + 1);
if (dwDataLen > 0)
@@ -2537,21 +2511,18 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
}
if ((ackType == MTYPE_PLAIN && pCookieData && (pCookieData->nAckType == ACKTYPE_CLIENT)) || ackType != MTYPE_PLAIN)
- {
ProtoBroadcastAck(hContact, ackType, ACKRESULT_SUCCESS, (HANDLE)(WORD)dwCookie, 0);
- }
}
ReleaseCookie(dwCookie);
}
-
// A response to a CLI_SENDMSG
void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSequence)
{
WORD wError;
char *pszErrorMessage;
- HANDLE hContact;
+ HCONTACT hContact;
cookie_message_data *pCookieData = NULL;
int nMessageType;
@@ -2559,13 +2530,13 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
if (wLen < 2)
return;
- if (FindCookie((WORD)dwSequence, &hContact, (void**)&pCookieData))
- { // all packet cookies from msg family has command 0 in the queue
+ if (FindCookie((WORD)dwSequence, &hContact, (void**)&pCookieData)) {
+ // all packet cookies from msg family has command 0 in the queue
DWORD dwUin;
uid_str szUid;
- if (getContactUid(hContact, &dwUin, &szUid))
- { // Invalid contact
+ if (getContactUid(hContact, &dwUin, &szUid)) {
+ // Invalid contact
FreeCookie((WORD)dwSequence);
return;
}
@@ -2573,8 +2544,8 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
// Error code
unpackWord(&buf, &wError);
- if (wError == 9 && pCookieData->bMessageType == MTYPE_AUTOAWAY)
- { // we failed to request away message the normal way, try it AIM way
+ if (wError == 9 && pCookieData->bMessageType == MTYPE_AUTOAWAY) {
+ // we failed to request away message the normal way, try it AIM way
icq_packet packet;
serverPacketInit(&packet, (WORD)(13 + getUINLen(dwUin)));
@@ -2589,7 +2560,6 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
// Not all of these are actually used in family 4
// This will be moved into a special error handling function later
switch (wError) {
-
case 0x0002: // Server rate limit exceeded
pszErrorMessage = Translate("You are sending too fast. Wait a while and try again.\r\nSNAC(4.1) Error x02");
break;
@@ -2599,10 +2569,9 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
break;
case 0x0004: // Recipient is not logged in (resend in a offline message)
- if (pCookieData->bMessageType == MTYPE_PLAIN)
- {
- if (pCookieData->isOffline)
- { // offline failed - most probably to AIM contact
+ if (pCookieData->bMessageType == MTYPE_PLAIN) {
+ if (pCookieData->isOffline) {
+ // offline failed - most probably to AIM contact
pszErrorMessage = Translate("The contact does not support receiving offline messages.");
break;
}
@@ -2683,23 +2652,17 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
}
if (nMessageType != -1)
- {
ProtoBroadcastAck(hContact, nMessageType, ACKRESULT_FAILED, (HANDLE)(WORD)dwSequence, (LPARAM)pszErrorMessage);
- }
else
- {
debugLogA("Error: Message delivery to %u failed: %s", dwUin, pszErrorMessage);
- }
FreeCookie((WORD)dwSequence);
if (pCookieData->bMessageType != MTYPE_FILEREQ)
SAFE_FREE((void**)&pCookieData);
}
- else
- {
+ else {
unpackWord(&buf, &wError);
-
LogFamilyError(ICQ_MSG_FAMILY, wError);
}
}
@@ -2712,9 +2675,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque
WORD wChannel;
cookie_message_data *pCookieData;
-
- if (wLen < 13)
- {
+ if (wLen < 13) {
debugLogA("Ignoring SNAC(4,C) Packet to short");
return;
}
@@ -2729,7 +2690,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque
// Sender
if (!unpackUID(&buf, &wLen, &dwUin, &szUID)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUID, NULL);
if (FindCookie((WORD)dwSequence, NULL, (void**)&pCookieData))
{
@@ -2928,7 +2889,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR
// Sender
if (!unpackUID(&buf, &wLen, &dwUin, &szUid)) return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, NULL);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL);
if (hContact == INVALID_HANDLE_VALUE) return;
@@ -2973,7 +2934,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR
}
-void CIcqProto::sendTypingNotification(HANDLE hContact, WORD wMTNCode)
+void CIcqProto::sendTypingNotification(HCONTACT 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 882ded41aa..203ba13b00 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(HANDLE hContact)
+void CIcqProto::makeContactTemporaryVisible(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp
index 049d3c1cab..fa83b408cd 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)
}
-HANDLE CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded)
+HCONTACT CIcqProto::HContactFromRecordName(const char* szRecordName, int *bAdded)
{
- HANDLE hContact = INVALID_HANDLE_VALUE;
+ HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
if (!IsStringUIN(szRecordName))
{ // probably AIM contact
@@ -904,7 +904,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
case SSI_ITEM_BUDDY:
{
/* this is a contact */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1172,7 +1172,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* item on visible list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1211,7 +1211,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* Item on invisible list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1269,7 +1269,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* item on ignore list */
/* wItemId not related to contact ID */
/* pszRecordName is the UIN */
- HANDLE hContact;
+ HCONTACT hContact;
int bAdded;
hContact = HContactFromRecordName(szRecordName, &bAdded);
@@ -1471,7 +1471,7 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId
void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData)
{
- HANDLE hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
+ HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
{ // a contact was updated on server
@@ -1586,7 +1586,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGroupId, WORD wItemId, WORD wItemType, oscar_tlv_chain *pItemData)
{
- HANDLE hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
+ HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
{ // a contact was removed from our list
@@ -1632,7 +1632,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen)
if (wReasonLen > wLen)
return;
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT 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;
}
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded);
cbBlob=sizeof(DWORD)*2+4;
@@ -1782,7 +1782,7 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen)
return;
}
- HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded);
+ HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded);
if (hContact != INVALID_HANDLE_VALUE) szNick = NickFromHandle(hContact);
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
index 327e6cbc35..78759c03d8 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)
{
- HANDLE hContact;
+ HCONTACT hContact;
cookie_fam15_data *pCookieData = NULL;
int foundCookie = FindCookie(wCookie, &hContact, (void**)&pCookieData);
@@ -578,7 +578,7 @@ UserInfoRecordItem rInterest[] = {
};
-int CIcqProto::parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords)
+int CIcqProto::parseUserInfoRecord(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
// check request cookie
if (!FindCookie(wCookie, &hContact, (void**)&pCookieData) || !pCookieData)
{
@@ -843,7 +843,7 @@ static int calcAgeFromBirthDate(double dDate)
}
-void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType)
+void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType)
{
oscar_tlv *pTLV;
WORD wRecordCount;
@@ -1152,7 +1152,7 @@ void CIcqProto::handleDirectoryUpdateResponse(BYTE *databuf, WORD wPacketLen, WO
}
cookie_directory_data *pCookieData;
- HANDLE hContact;
+ HCONTACT 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 f5eb6ce4e0..a8eba258f9 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(HANDLE hContact, const BYTE *pHash, int nHashLen)
+int CIcqProto::IsAvatarChanged(HCONTACT 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, HANDLE hContact, BYTE *pHash, int nHashLen, WORD wOldStatus)
+void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT hContact, BYTE *pHash, int nHashLen, WORD wOldStatus)
{
int bJob = FALSE;
BOOL avatarInfoPresent = FALSE;
@@ -696,7 +696,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
// request avatar data from server
-int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file)
+int CIcqProto::GetAvatarData(HCONTACT 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(HANDLE hContact, DWORD dwUin, const char *szUid, co
// upload avatar data to server
-int CIcqProto::SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen)
+int CIcqProto::SetAvatarData(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file)
+DWORD avatars_server_connection::sendGetAvatarRequest(HCONTACT 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(HANDLE hContact, DWORD dwU
}
-DWORD avatars_server_connection::sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen)
+DWORD avatars_server_connection::sendUploadAvatarRequest(HCONTACT 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 26d805d397..e989640d93 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.h
+++ b/protocols/IcqOscarJ/src/icq_avatar.h
@@ -85,8 +85,8 @@ public:
__inline BOOL isPending() { return !isLoggedIn; };
__inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
- DWORD sendGetAvatarRequest(HANDLE hContact, DWORD dwUin, char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
- DWORD sendUploadAvatarRequest(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
+ DWORD sendGetAvatarRequest(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);
};
__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;
- HANDLE hContact;
+ HCONTACT 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 c836b16e3c..2ea61ae5e2 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(HANDLE hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient,
+const char* CIcqProto::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, /* 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 8841ce24fc..c54d389a53 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(HANDLE hContact, const char *szSetting, DBVARIANT *dbv)
+int CIcqProto::getSetting(HCONTACT hContact, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0);
}
-double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, double dDef)
+double CIcqProto::getSettingDouble(HCONTACT hContact, const char *szSetting, double dDef)
{
DBVARIANT dbv = {DBVT_DELETED};
double dRes;
@@ -51,12 +51,12 @@ double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, doubl
return dRes;
}
-DWORD CIcqProto::getContactUin(HANDLE hContact)
+DWORD CIcqProto::getContactUin(HCONTACT hContact)
{
return getDword(hContact, UNIQUEIDSETTING, 0);
}
-int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
+int CIcqProto::getContactUid(HCONTACT hContact, DWORD *pdwUin, uid_str *ppszUid)
{
DBVARIANT dbv = {DBVT_DELETED};
int iRes = 1;
@@ -82,7 +82,7 @@ int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
return iRes;
}
-char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef)
+char* CIcqProto::getSettingStringUtf(HCONTACT 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(HANDLE hContact, const char *szModule, cons
return szRes;
}
-char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szSetting, char *szDef)
+char* CIcqProto::getSettingStringUtf(HCONTACT hContact, const char *szSetting, char *szDef)
{
return getSettingStringUtf(hContact, m_szModuleName, szSetting, szDef);
}
-WORD CIcqProto::getContactStatus(HANDLE hContact)
+WORD CIcqProto::getContactStatus(HCONTACT hContact)
{
return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
-int CIcqProto::getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len)
+int CIcqProto::getSettingStringStatic(HCONTACT 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(HANDLE hContact, const char *szSetting, ch
return db_get_static_utf(hContact, m_szModuleName, szSetting, dest, dest_len);
}
-int CIcqProto::setSettingDouble(HANDLE hContact, const char *szSetting, double dValue)
+int CIcqProto::setSettingDouble(HCONTACT hContact, const char *szSetting, double dValue)
{
return setSettingBlob(hContact, szSetting, (BYTE*)&dValue, sizeof(double));
}
-int CIcqProto::setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue)
+int CIcqProto::setSettingBlob(HCONTACT hContact, const char *szSetting, const BYTE *pValue, const int cbValue)
{
return db_set_blob(hContact, m_szModuleName, szSetting, (void*)pValue, cbValue);
}
-int CIcqProto::setContactHidden(HANDLE hContact, BYTE bHidden)
+int CIcqProto::setContactHidden(HCONTACT hContact, BYTE bHidden)
{
int nResult = db_set_b(hContact, "CList", "Hidden", bHidden);
if (!bHidden) // clear zero setting
@@ -132,7 +132,7 @@ int CIcqProto::setContactHidden(HANDLE hContact, BYTE bHidden)
return nResult;
}
-void CIcqProto::setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi)
+void CIcqProto::setStatusMsgVar(HCONTACT hContact, char* szStatusMsg, bool isAnsi)
{
if (szStatusMsg && szStatusMsg[0]) {
if (isAnsi) {
@@ -171,14 +171,14 @@ void CIcqProto::setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi)
else db_unset(hContact, "CList", "StatusMsg");
}
-int CIcqProto::IsICQContact(HANDLE hContact)
+int CIcqProto::IsICQContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
return !strcmpnull(szProto, m_szModuleName);
}
-HANDLE CIcqProto::AddEvent(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+HANDLE CIcqProto::AddEvent(HCONTACT 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(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flag
return db_event_add(hContact, &dbei);
}
-HANDLE CIcqProto::FindFirstContact()
+HCONTACT CIcqProto::FindFirstContact()
{
- HANDLE hContact = db_find_first(m_szModuleName);
+ HCONTACT hContact = db_find_first(m_szModuleName);
if (IsICQContact(hContact))
return hContact;
@@ -200,7 +200,7 @@ HANDLE CIcqProto::FindFirstContact()
return FindNextContact(hContact);
}
-HANDLE CIcqProto::FindNextContact(HANDLE hContact)
+HCONTACT CIcqProto::FindNextContact(HCONTACT hContact)
{
hContact = db_find_next(hContact, m_szModuleName);
while (hContact != NULL)
@@ -212,7 +212,7 @@ HANDLE CIcqProto::FindNextContact(HANDLE hContact)
return hContact;
}
-char* CIcqProto::getContactCListGroup(HANDLE hContact)
+char* CIcqProto::getContactCListGroup(HCONTACT hContact)
{
return getSettingStringUtf(hContact, "CList", "Group", NULL);
}
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp
index 69a610f1b4..4229777b5a 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
- HANDLE hContact; // Only valid for outgoing connections
+ HCONTACT 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(HANDLE hContact)
+void CIcqProto::CloseContactDirectConns(HCONTACT hContact)
{
icq_lock l(directConnListMutex);
@@ -116,7 +116,7 @@ int CIcqProto::sendDirectPacket(directconnect* dc, icq_packet* pkt)
return nResult;
}
-directthreadstartinfo* CreateDTSI(HANDLE hContact, HANDLE hConnection, int type)
+directthreadstartinfo* CreateDTSI(HCONTACT hContact, HANDLE hConnection, int type)
{
directthreadstartinfo* dtsi = (directthreadstartinfo*)SAFE_MALLOC(sizeof(directthreadstartinfo));
dtsi->hContact = hContact;
@@ -131,7 +131,7 @@ directthreadstartinfo* CreateDTSI(HANDLE hContact, HANDLE hConnection, int type)
// Check if we have an open and initialized DC with type
// 'type' to the specified contact
-BOOL CIcqProto::IsDirectConnectionOpen(HANDLE hContact, int type, int bPassive)
+BOOL CIcqProto::IsDirectConnectionOpen(HCONTACT 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(HANDLE hContact, int type, void* pvExtra)
+void CIcqProto::OpenDirectConnection(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
if (wLen != 0x30)
{
@@ -1009,7 +1009,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
}
// This should be called only if connection already exists
-int CIcqProto::SendDirectMessage(HANDLE hContact, icq_packet *pkt)
+int CIcqProto::SendDirectMessage(HCONTACT 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 3cf91cb493..76ccd0d2dc 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;
- HANDLE hContact;
+ HCONTACT hContact;
char *szFilename;
char *szDescription;
char *szSavePath;
@@ -68,7 +68,7 @@ struct filetransfer: public basic_filetransfer
struct directconnect
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
DWORD dwConnectionCookie;
int type;
diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp
index ecf9f24af6..d5a4ccdced 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
{
- HANDLE hCookieContact;
+ HCONTACT 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)
{
- HANDLE hCookieContact;
+ HCONTACT 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 2d426a5fb5..fa4c3942d1 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;
- HANDLE hCookieContact;
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, int nVersion)
+filetransfer* CIcqProto::CreateFileTransfer(HCONTACT 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;
- HANDLE hContact = HContactFromUIN(dwUin, &bAdded);
+ HCONTACT 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(HANDLE hContact, filetransfer* ft)
+void CIcqProto::icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft)
{
DWORD dwCookie;
diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp
index 58ed0ec592..969607b6be 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(HANDLE hContact)
+BOOL CIcqProto::icq_QueueUser(HCONTACT hContact)
{
if ( !infoUpdateMutex )
return FALSE;
@@ -155,7 +155,7 @@ void CIcqProto::icq_RescanInfoUpdate()
bInfoUpdateEnabled = 0; // freeze thread
// Queue all outdated users
- HANDLE hContact = FindFirstContact();
+ HCONTACT 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 93e85a6965..5538103a41 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<CIcqProto> g_Instances(1, sttCompareProtocols);
-static CIcqProto* IcqGetInstanceByHContact(HANDLE hContact)
+static CIcqProto* IcqGetInstanceByHContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -54,37 +54,37 @@ static CIcqProto* IcqGetInstanceByHContact(HANDLE hContact)
static INT_PTR IcqMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->RequestAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->GrantAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleRevokeAuth(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->RevokeAuthorization(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleAddServContact(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->AddServerContact(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleXStatusDetails(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->ShowXStatusDetails(wParam, lParam) : 0;
}
static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam)
{
- CIcqProto* ppro = IcqGetInstanceByHContact((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)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((HANDLE)wParam);
+ CIcqProto* ppro = IcqGetInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->OnPreBuildContactMenu(wParam, lParam) : 0;
}
@@ -177,7 +177,7 @@ void g_MenuUninit(void)
INT_PTR CIcqProto::OpenWebProfile(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -197,18 +197,18 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM)
DWORD dwUin = getContactUin(hContact);
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REQUEST],
- dwUin && (bCtrlPressed || (getByte((HANDLE)wParam, "Auth", 0) && getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0))));
- Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getByte((HANDLE)wParam, "Grant", 0)));
+ dwUin && (bCtrlPressed || (getByte(hContact, "Auth", 0) && getWord(hContact, DBSETTING_SERVLIST_ID, 0))));
+ Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getByte(hContact, "Grant", 0)));
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REVOKE],
- dwUin && (bCtrlPressed || (getByte("PrivacyItems", 0) && !getByte((HANDLE)wParam, "Grant", 0))));
+ dwUin && (bCtrlPressed || (getByte("PrivacyItems", 0) && !getByte(hContact, "Grant", 0))));
Menu_ShowItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST],
- m_bSsiEnabled && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) &&
- !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0) &&
+ m_bSsiEnabled && !getWord(hContact, DBSETTING_SERVLIST_ID, 0) &&
+ !getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0) &&
!db_get_b(hContact, "CList", "NotOnList", 0));
}
Menu_ShowItem(g_hContactMenuItems[ICMI_OPEN_PROFILE],getContactUin(hContact) != 0);
- BYTE bXStatus = getContactXStatus((HANDLE)wParam);
+ BYTE bXStatus = getContactXStatus(hContact);
Menu_ShowItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
if (bXStatus && !m_bHideXStatusUI) {
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp
index fdaa77cb30..ba3572b61f 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(HANDLE hContact, const char *szTitle, const char *szMsg, BYTE bType)
+int CIcqProto::ShowPopupMsg(HCONTACT 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 e23420b326..d347223323 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);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact != NULL) {
DWORD bXStatus = getContactXStatus(hContact);
if (bXStatus > 0)
@@ -420,7 +420,7 @@ HANDLE __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv
int CIcqProto::Authorize(HANDLE hDbEvent)
{
if (icqOnline() && hDbEvent) {
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -446,7 +446,7 @@ int CIcqProto::Authorize(HANDLE hDbEvent)
int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
{
if (icqOnline() && hDbEvent) {
- HANDLE hContact = HContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -470,7 +470,7 @@ int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CIcqProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::AuthRecv(HCONTACT 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(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIcqProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+int __cdecl CIcqProto::AuthRequest(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIcqProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
{
DWORD dwUin;
uid_str szUid;
@@ -558,7 +558,7 @@ HANDLE __cdecl CIcqProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCH
////////////////////////////////////////////////////////////////////////////////////////
// PS_FileCancel - cancels a file transfer
-int __cdecl CIcqProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int __cdecl CIcqProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
DWORD dwUin;
uid_str szUid;
@@ -588,7 +588,7 @@ int __cdecl CIcqProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// PS_FileDeny - denies a file transfer
-int __cdecl CIcqProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason)
+int __cdecl CIcqProto::FileDeny(HCONTACT 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, HANDLE hContact)
+DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HCONTACT hContact)
{
DWORD_PTR nReturn = 0;
@@ -742,7 +742,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CIcqProto::GetInfo(HANDLE hContact, int infoType)
+int __cdecl CIcqProto::GetInfo(HCONTACT hContact, int infoType)
{
if (icqOnline()) {
DWORD dwUin;
@@ -923,7 +923,7 @@ HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg)
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CIcqProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre)
{
ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage;
int i;
@@ -974,7 +974,7 @@ int __cdecl CIcqProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CIcqProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
+int __cdecl CIcqProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -983,7 +983,7 @@ int __cdecl CIcqProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CIcqProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CIcqProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
{
DWORD cbBlob;
DWORD flags = 0;
@@ -1009,7 +1009,7 @@ int __cdecl CIcqProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CIcqProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CIcqProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -1018,7 +1018,7 @@ int __cdecl CIcqProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CIcqProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CIcqProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
if (hContact && hContactsList) {
int i;
@@ -1289,7 +1289,7 @@ int __cdecl CIcqProto::SendContacts(HANDLE hContact, int flags, int nContacts, H
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIcqProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CIcqProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
{
if (!icqOnline())
return 0;
@@ -1391,7 +1391,7 @@ HANDLE __cdecl CIcqProto::SendFile(HANDLE hContact, const TCHAR* szDescription,
////////////////////////////////////////////////////////////////////////////////////////
// PS_SendMessage - sends a message
-int __cdecl CIcqProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CIcqProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
if (hContact == NULL || pszSrc == NULL)
return NULL;
@@ -1581,7 +1581,7 @@ int __cdecl CIcqProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CIcqProto::SendUrl(HANDLE hContact, int flags, const char* url)
+int __cdecl CIcqProto::SendUrl(HCONTACT hContact, int flags, const char* url)
{
if (hContact == NULL || url == NULL)
return 0;
@@ -1646,7 +1646,7 @@ int __cdecl CIcqProto::SendUrl(HANDLE hContact, int flags, const char* url)
////////////////////////////////////////////////////////////////////////////////////////
// PS_SetApparentMode - sets the visibility status
-int __cdecl CIcqProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CIcqProto::SetApparentMode(HCONTACT hContact, int mode)
{
DWORD uin;
uid_str uid;
@@ -1840,7 +1840,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
struct status_message_thread_data
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact)
+HANDLE __cdecl CIcqProto::GetAwayMsg(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUID;
@@ -1949,7 +1949,7 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG - processes received status mode message
-int __cdecl CIcqProto::RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
+int __cdecl CIcqProto::RecvAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int __cdecl CIcqProto::UserIsTyping(HCONTACT 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 836eaafb51..9b9986d06d 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -41,7 +41,7 @@
struct userinfo
{
DWORD dwUin;
- HANDLE hContact;
+ HCONTACT hContact;
time_t queued;
};
@@ -54,50 +54,50 @@ struct CIcqProto : public PROTO<CIcqProto>
// PROTO_INTERFACE
//====================================================================================
- virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
+ virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent);
- virtual int __cdecl Authorize( HANDLE hContact );
- virtual int __cdecl AuthDeny( HANDLE hContact, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ 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 HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
+ virtual HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData);
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason );
- virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
+ 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 int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic( const PROTOCHAR *id );
- virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR *email );
+ virtual HANDLE __cdecl SearchBasic(const PROTOCHAR *id);
+ virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR *email);
virtual HANDLE __cdecl SearchByName(const PROTOCHAR *nick, const PROTOCHAR *firstName, const PROTOCHAR *lastName);
- virtual HWND __cdecl SearchAdvanced( HWND owner );
- virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
+ virtual HWND __cdecl SearchAdvanced(HWND owner);
+ virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode( HANDLE hContact, int mode );
- virtual int __cdecl SetStatus( int iNewStatus );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
+ virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
- virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
+ virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
//====| Services |====================================================================
INT_PTR __cdecl AddServerContact(WPARAM wParam, LPARAM lParam);
@@ -127,22 +127,22 @@ struct CIcqProto : public PROTO<CIcqProto>
INT_PTR __cdecl OnCreateAccMgrUI(WPARAM, LPARAM);
//====| Events |======================================================================
- void __cdecl OnAddContactForever( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- int __cdecl OnIdleChanged( WPARAM, LPARAM );
- int __cdecl OnModernOptInit( WPARAM, LPARAM );
- int __cdecl OnModulesLoaded( WPARAM, LPARAM );
- int __cdecl OnOptionsInit( WPARAM, LPARAM );
- int __cdecl OnPreShutdown( WPARAM, LPARAM );
- int __cdecl OnPreBuildContactMenu( WPARAM, LPARAM );
- int __cdecl OnMsgUserTyping( WPARAM, LPARAM );
- int __cdecl OnProcessSrmmIconClick( WPARAM, LPARAM );
- int __cdecl OnProcessSrmmEvent( WPARAM, LPARAM );
- int __cdecl OnReloadIcons( WPARAM, LPARAM );
- void __cdecl OnRenameContact( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- void __cdecl OnRenameGroup( DBCONTACTWRITESETTING* cws, HANDLE hContact );
- int __cdecl OnUserInfoInit( WPARAM, LPARAM );
-
- int __cdecl OnPreBuildStatusMenu( WPARAM, LPARAM );
+ void __cdecl OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact);
+ int __cdecl OnIdleChanged(WPARAM, LPARAM);
+ int __cdecl OnModernOptInit(WPARAM, LPARAM);
+ int __cdecl OnModulesLoaded(WPARAM, LPARAM);
+ int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnPreShutdown(WPARAM, LPARAM);
+ int __cdecl OnPreBuildContactMenu(WPARAM, LPARAM);
+ int __cdecl OnMsgUserTyping(WPARAM, LPARAM);
+ 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);
+ int __cdecl OnUserInfoInit(WPARAM, LPARAM);
+
+ int __cdecl OnPreBuildStatusMenu(WPARAM, LPARAM);
//====| Data |========================================================================
HANDLE m_hDirectNetlibUser;
@@ -182,22 +182,22 @@ struct CIcqProto : public PROTO<CIcqProto>
//----| capabilities.cpp |------------------------------------------------------------
// Deletes all oscar capabilities for a given contact.
- void ClearAllContactCapabilities(HANDLE hContact);
+ void ClearAllContactCapabilities(HCONTACT hContact);
// Deletes one or many oscar capabilities for a given contact.
- void ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ void ClearContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Sets one or many oscar capabilities for a given contact.
- void SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ void SetContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Returns true if the given contact supports the requested capabilites.
- BOOL CheckContactCapabilities(HANDLE hContact, DWORD fdwCapabilities);
+ BOOL CheckContactCapabilities(HCONTACT hContact, DWORD fdwCapabilities);
// Scans a binary buffer for oscar capabilities and adds them to the contact.
- void AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength);
+ void AddCapabilitiesFromBuffer(HCONTACT hContact, BYTE *pBuffer, int nLength);
// Scans a binary buffer for oscar capabilities and sets them to the contact.
- void SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength, BOOL bReset);
+ void SetCapabilitiesFromBuffer(HCONTACT 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<CIcqProto>
LIST<icq_cookie_info> cookies;
WORD wCookieSeq;
- DWORD AllocateCookie(BYTE bType, WORD wIdent, HANDLE hContact, void *pvExtra);
+ DWORD AllocateCookie(BYTE bType, WORD wIdent, HCONTACT 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<CIcqProto>
int GetCookieType(DWORD dwCookie);
- int FindCookie(DWORD wCookie, HANDLE *phContact, void **ppvExtra);
- int FindCookieByData(void *pvExtra, DWORD *pdwCookie, HANDLE *phContact);
- int FindCookieByType(BYTE bType, DWORD *pdwCookie, HANDLE *phContact, void **ppvExtra);
- int FindMessageCookie(DWORD dwMsgID1, DWORD dwMsgID2, DWORD *pdwCookie, HANDLE *phContact, cookie_message_data **ppvExtra);
+ 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);
void InitMessageCookie(cookie_message_data *pCookie);
cookie_message_data* CreateMessageCookie(WORD bMsgType, BYTE bAckType);
- cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HANDLE hContact, DWORD dwUin, int bUseSrvRelay);
+ cookie_message_data* CreateMessageCookieData(BYTE bMsgType, HCONTACT 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(HANDLE hContact, int type);
+ DWORD icq_sendGetAwayMsgDirect(HCONTACT hContact, int type);
void icq_sendAwayMsgReplyDirect(directconnect *dc, WORD wCookie, BYTE msgType, const char** szMsg);
- void icq_sendFileAcceptDirect(HANDLE hContact, filetransfer *ft);
- void icq_sendFileDenyDirect(HANDLE hContact, filetransfer *ft, const char *szReason);
+ void icq_sendFileAcceptDirect(HCONTACT hContact, filetransfer *ft);
+ void icq_sendFileDenyDirect(HCONTACT 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(HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap);
- void icq_sendXtrazRequestDirect(HANDLE hContact, DWORD dwCookie, char* szBody, int nBodyLen, WORD wType);
- void icq_sendXtrazResponseDirect(HANDLE hContact, WORD wCookie, char* szBody, int nBodyLen, WORD wType);
+ 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);
//----| fam_01service.cpp |-----------------------------------------------------------
void handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header *pSnacHeader, serverthread_info *info);
- char* buildUinList(int subtype, WORD wMaxLen, HANDLE *hContactResume);
+ char* buildUinList(int subtype, WORD wMaxLen, HCONTACT *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<CIcqProto>
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, HANDLE hContact, oscar_tlv_chain *pChain);
+ void parseStatusNote(DWORD dwUin, char *szUid, HCONTACT hContact, oscar_tlv_chain *pChain);
void handleNotifyRejected(BYTE *buf, WORD wPackLen);
//----| fam_04message.cpp |-----------------------------------------------------------
@@ -296,29 +296,29 @@ struct CIcqProto : public PROTO<CIcqProto>
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, HANDLE hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags);
+ void handleStatusMsgReply(const char *szPrefix, HCONTACT 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, HANDLE hContact, DWORD dwUin, char *szUID, DWORD dwMsgID1, DWORD dwMsgID2, WORD wAckType);
- void parseServRelayPluginData(BYTE *pDataBuf, WORD wLen, HANDLE 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, 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);
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(HANDLE hContact, int bUnicode, message_ack_params *pArgs);
- void sendTypingNotification(HANDLE hContact, WORD wMTNCode);
+ void sendMessageTypesAck(HCONTACT hContact, int bUnicode, message_ack_params *pArgs);
+ void sendTypingNotification(HCONTACT hContact, WORD wMTNCode);
int unpackPluginTypeId(BYTE **pBuffer, WORD *pwLen, int *pTypeId, WORD *pFunctionId, BOOL bThruDC);
- char* convertMsgToUserSpecificUtf(HANDLE hContact, const char *szMsg);
+ char* convertMsgToUserSpecificUtf(HCONTACT 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(HANDLE hContact);
+ void makeContactTemporaryVisible(HCONTACT hContact);
//----| fam_0alookup.cpp |------------------------------------------------------------
void handleLookupFam(unsigned char *pBuffer, WORD wBufferLength, snac_header* pSnacHeader);
@@ -347,7 +347,7 @@ struct CIcqProto : public PROTO<CIcqProto>
void handleRecvAuthResponse(BYTE *buf, WORD wLen);
void handleRecvAdded(BYTE *buf, WORD wLen);
- HANDLE HContactFromRecordName(const char *szRecordName, int *bAdded);
+ HCONTACT 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<CIcqProto>
void handleExtensionServerInfo(BYTE *buf, WORD wPackLen, WORD wFlags);
void handleExtensionMetaResponse(BYTE *databuf, WORD wPacketLen, WORD wCookie, WORD wFlags);
- int parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRecordItem pRecordDef[], int nRecordDef, int nMaxRecords);
+ int parseUserInfoRecord(HCONTACT 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(HANDLE hContact, oscar_tlv_chain *cDetails, DWORD dwCookie, cookie_directory_data *pCookieData, WORD wReplySubType);
+ void parseDirectoryUserDetailsData(HCONTACT 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,44 +397,45 @@ struct CIcqProto : public PROTO<CIcqProto>
void __cdecl AvatarThread(avatars_server_connection *pInfo);
void handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BYTE nDataLen);
- void handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContact, BYTE *pHash, int nHashLen, WORD wOldStatus);
+ void handleAvatarContactHash(DWORD dwUIN, char *szUID, HCONTACT 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(HANDLE hContact, const BYTE *pHash, int nHashLen);
+ int IsAvatarChanged(HCONTACT hContact, const BYTE *pHash, int nHashLen);
- int GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, const BYTE *hash, unsigned int hashlen, const TCHAR *file);
- int SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen);
+ 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);
void StartAvatarThread(HANDLE hConn, char* cookie, WORD cookieLen);
void StopAvatarThread();
//----| icq_clients.cpp |-------------------------------------------------------------
- const char* detectUserClient(HANDLE 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(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);
//----| icq_db.cpp |------------------------------------------------------------------
- HANDLE AddEvent(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- HANDLE FindFirstContact();
- HANDLE FindNextContact(HANDLE hContact);
- int IsICQContact(HANDLE hContact);
-
- int getSetting(HANDLE hContact, const char *szSetting, DBVARIANT *dbv);
- double getSettingDouble(HANDLE hContact, const char *szSetting, double dDef);
- int getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len);
- char* getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef);
- char* getSettingStringUtf(HANDLE hContact, const char *szSetting, char *szDef);
- int getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid);
- DWORD getContactUin(HANDLE hContact);
- WORD getContactStatus(HANDLE hContact);
- char* getContactCListGroup(HANDLE hContact);
-
- int setSettingDouble(HANDLE hContact, const char *szSetting, double dValue);
- int setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue);
- int setContactHidden(HANDLE hContact, BYTE bHidden);
- void setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi);
+ 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);
//----| icq_direct.cpp |--------------------------------------------------------------
icq_critical_section *directConnListMutex;
@@ -452,29 +453,29 @@ struct CIcqProto : public PROTO<CIcqProto>
void sendPeerFileInit(directconnect* dc);
int sendDirectPacket(directconnect* dc, icq_packet* pkt);
- void CloseContactDirectConns(HANDLE hContact);
+ void CloseContactDirectConns(HCONTACT hContact);
directconnect* FindFileTransferDC(filetransfer* ft);
filetransfer* FindExpectedFileRecv(DWORD dwUin, DWORD dwTotalSize);
- BOOL IsDirectConnectionOpen(HANDLE hContact, int type, int bPassive);
- void OpenDirectConnection(HANDLE hContact, int type, void* pvExtra);
+ BOOL IsDirectConnectionOpen(HCONTACT hContact, int type, int bPassive);
+ void OpenDirectConnection(HCONTACT hContact, int type, void* pvExtra);
void CloseDirectConnection(directconnect *dc);
- int SendDirectMessage(HANDLE hContact, icq_packet *pkt);
+ int SendDirectMessage(HCONTACT 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(HANDLE hContact, DWORD dwUin, int nVersion);
+ filetransfer* CreateFileTransfer(HCONTACT 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(HANDLE hContact, filetransfer* ft);
+ void icq_CancelFileTransfer(HCONTACT hContact, filetransfer* ft);
//----| icq_filetransfer.cpp |--------------------------------------------------------
- void icq_AcceptFileTransfer(HANDLE hContact, filetransfer *ft);
+ void icq_AcceptFileTransfer(HCONTACT hContact, filetransfer *ft);
void icq_sendFileResume(filetransfer *ft, int action, const char *szFilename);
void icq_InitFileSend(filetransfer *ft);
@@ -495,7 +496,7 @@ struct CIcqProto : public PROTO<CIcqProto>
void __cdecl InfoUpdateThread(void*);
void icq_InitInfoUpdate(void); // Queues all outdated users
- BOOL icq_QueueUser(HANDLE hContact); // Queue one UIN to the list for updating
+ BOOL icq_QueueUser(HCONTACT 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
@@ -525,7 +526,7 @@ struct CIcqProto : public PROTO<CIcqProto>
BOOL unpackUID(BYTE **ppBuf, WORD *pwLen, DWORD *pdwUIN, uid_str *ppszUID);
//----| icq_popups.cpp |--------------------------------------------------------------
- int ShowPopupMsg(HANDLE hContact, const char *szTitle, const char *szMsg, BYTE bType);
+ int ShowPopupMsg(HCONTACT hContact, const char *szTitle, const char *szMsg, BYTE bType);
//----| icq_proto.cpp |--------------------------------------------------------------
void __cdecl CheekySearchThread( void* );
@@ -604,15 +605,15 @@ struct CIcqProto : public PROTO<CIcqProto>
int servlistPendingSize;
servlistpendingitem** servlistPendingList;
- int servlistPendingFindItem(int nType, HANDLE hContact, const char *pszGroup);
+ int servlistPendingFindItem(int nType, HCONTACT hContact, const char *pszGroup);
void servlistPendingAddItem(servlistpendingitem* pItem);
- servlistpendingitem* servlistPendingRemoveItem(int nType, HANDLE hContact, const char *pszGroup);
+ servlistpendingitem* servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup);
- void servlistPendingAddContactOperation(HANDLE hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags);
+ void servlistPendingAddContactOperation(HCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags);
void servlistPendingAddGroupOperation(const char *pszGroup, LPARAM param, PENDING_GROUP_CALLBACK callback, DWORD flags);
- int servlistPendingAddContact(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL);
+ 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 servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = NULL);
- void servlistPendingRemoveContact(HANDLE hContact, WORD wContactID, WORD wGroupID, int nResult);
+ void servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult);
void servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult);
void servlistPendingFlushOperations();
@@ -621,8 +622,8 @@ struct CIcqProto : public PROTO<CIcqProto>
int nJustAddedSize;
HANDLE* pdwJustAddedList;
- void AddJustAddedContact(HANDLE hContact);
- BOOL IsContactJustAdded(HANDLE hContact);
+ void AddJustAddedContact(HCONTACT hContact);
+ BOOL IsContactJustAdded(HCONTACT hContact);
void FlushJustAddedContacts();
WORD GenerateServerID(int bGroupType, int bFlags, int wCount = 0);
@@ -648,18 +649,18 @@ struct CIcqProto : public PROTO<CIcqProto>
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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult);
- void servlistAddContact(HANDLE hContact, const char *pszGroup);
+ int __cdecl servlistAddContact_Ready(HCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult);
+ void servlistAddContact(HCONTACT hContact, const char *pszGroup);
- int __cdecl servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistRemoveContact(HANDLE hContact);
+ int __cdecl servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistRemoveContact(HCONTACT hContact);
int __cdecl servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNewGroupID, LPARAM lParam, int nResult);
- int __cdecl servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistMoveContact(HANDLE hContact, const char *pszNewGroup);
+ int __cdecl servlistMoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistMoveContact(HCONTACT hContact, const char *pszNewGroup);
- int __cdecl servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
- void servlistUpdateContact(HANDLE hContact);
+ int __cdecl servlistUpdateContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult);
+ void servlistUpdateContact(HCONTACT hContact);
int __cdecl servlistRenameGroup_Ready(const char *szGroup, WORD wGroupID, LPARAM lParam, int nResult);
void servlistRenameGroup(char *szGroup, WORD wGroupId, char *szNewGroup);
@@ -670,20 +671,20 @@ struct CIcqProto : public PROTO<CIcqProto>
void removeGroupPathLinks(WORD wGroupID);
int getServListGroupLevel(WORD wGroupId);
- void resetServContactAuthState(HANDLE hContact, DWORD dwUin);
+ void resetServContactAuthState(HCONTACT hContact, DWORD dwUin);
void FlushSrvGroupsCache();
int getCListGroupExists(const char *szGroup);
- int moveContactToCListGroup(HANDLE hContact, const char *szGroup); /// TODO: this should be DB function
+ int moveContactToCListGroup(HCONTACT 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(HANDLE hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, 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_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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType);
- DWORD icq_removeServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
- DWORD icq_addServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
+ 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);
int __cdecl ServListDbSettingChanged(WPARAM wParam, LPARAM lParam);
int __cdecl ServListDbContactDeleted(WPARAM wParam, LPARAM lParam);
@@ -696,11 +697,11 @@ struct CIcqProto : public PROTO<CIcqProto>
void icq_setidle(int bAllow);
void icq_setstatus(WORD wStatus, const char *szStatusNote = NULL);
- DWORD icq_sendGetInfoServ(HANDLE, DWORD, int);
- DWORD icq_sendGetAimProfileServ(HANDLE hContact, char *szUid);
- DWORD icq_sendGetAwayMsgServ(HANDLE, DWORD, int, WORD);
- DWORD icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *szUID, int type, WORD wVersion);
- DWORD icq_sendGetAimAwayMsgServ(HANDLE hContact, char *szUID, int type);
+ 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);
void icq_sendSetAimAwayMsgServ(const char *szMsg);
void icq_sendFileSendServv7(filetransfer* ft, const char *szFiles);
@@ -718,7 +719,7 @@ struct CIcqProto : public PROTO<CIcqProto>
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(HANDLE hContact, DWORD dwUin, char* szUID, int list, int add);
+ void icq_sendChangeVisInvis(HCONTACT 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);
@@ -736,11 +737,11 @@ struct CIcqProto : public PROTO<CIcqProto>
void sendOwnerInfoRequest(void);
DWORD sendUserInfoMultiRequest(BYTE *pRequestData, WORD wDataLen, int nItems);
- DWORD icq_SendChannel1Message(DWORD dwUin, char *szUID, HANDLE hContact, char *pszText, cookie_message_data *pCookieData);
- DWORD icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hContact, WCHAR *pszText, cookie_message_data *pCookieData); // UTF-16
- DWORD icq_SendChannel2Message(DWORD dwUin, HANDLE hContact, const char *szMessage, int nBodyLength, WORD wPriority, cookie_message_data *pCookieData, char *szCap);
- DWORD icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HANDLE hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData);
- DWORD icq_SendChannel4Message(DWORD dwUin, HANDLE hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData);
+ 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);
void icq_sendAdvancedMsgAck(DWORD, DWORD, DWORD, WORD, BYTE, BYTE);
void icq_sendContactsAck(DWORD dwUin, char *szUid, DWORD dwMsgID1, DWORD dwMsgID2);
@@ -768,7 +769,7 @@ struct CIcqProto : public PROTO<CIcqProto>
HANDLE AddToListByUIN(DWORD dwUin, DWORD dwFlags);
HANDLE AddToListByUID(const char *szUID, DWORD dwFlags);
- void ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags);
+ void ICQAddRecvEvent(HCONTACT 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);
@@ -787,22 +788,22 @@ struct CIcqProto : public PROTO<CIcqProto>
HGENMENU hXStatusItems[XSTATUS_COUNT + 1];
void InitXStatusItems(BOOL bAllowStatus);
- BYTE getContactXStatus(HANDLE hContact);
- DWORD sendXStatusDetailsRequest(HANDLE hContact, int bForced);
- DWORD requestXStatusDetails(HANDLE hContact, BOOL bAllowDelay);
+ BYTE getContactXStatus(HCONTACT hContact);
+ DWORD sendXStatusDetailsRequest(HCONTACT hContact, int bForced);
+ DWORD requestXStatusDetails(HCONTACT hContact, BOOL bAllowDelay);
HICON getXStatusIcon(int bStatus, UINT flags);
void setXStatusEx(BYTE bXStatus, BYTE bQuiet);
- void handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYTE *caps, int capsize, char *moods, int moodsize);
+ void handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT 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, HANDLE hContact, WORD wCookie, char* szMsg, int nMsgLen);
+ void handleXtrazNotifyResponse(DWORD dwUin, HCONTACT 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(HANDLE hContact, char* szQuery, char* szNotify, int bForced);
+ DWORD SendXtrazNotifyRequest(HCONTACT 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 |--------------------------------------------------------------------
@@ -820,12 +821,12 @@ struct CIcqProto : public PROTO<CIcqProto>
filetransfer *CreateIcqFileTransfer();
void ReleaseFileTransfer(void *ft);
void SafeReleaseFileTransfer(void **ft);
- oscar_filetransfer* FindOscarTransfer(HANDLE hContact, DWORD dwID1, DWORD dwID2);
+ oscar_filetransfer* FindOscarTransfer(HCONTACT hContact, DWORD dwID1, DWORD dwID2);
oscar_listener* CreateOscarListener(oscar_filetransfer *ft, NETLIBNEWCONNECTIONPROC_V2 handler);
void ReleaseOscarListener(oscar_listener **pListener);
- void OpenOscarConnection(HANDLE hContact, oscar_filetransfer *ft, int type);
+ void OpenOscarConnection(HCONTACT hContact, oscar_filetransfer *ft, int type);
void CloseOscarConnection(oscar_connection *oc);
int CreateOscarProxyConnection(oscar_connection *oc);
@@ -836,10 +837,10 @@ struct CIcqProto : public PROTO<CIcqProto>
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(HANDLE hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription);
- HANDLE oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath);
- DWORD oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason);
- DWORD oftFileCancel(HANDLE hContact, HANDLE hTransfer);
+ 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);
void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename);
void sendOscarPacket(oscar_connection *oc, icq_packet *packet);
@@ -863,17 +864,17 @@ struct CIcqProto : public PROTO<CIcqProto>
int StringToListItemId(const char *szSetting,int def);
//----| utilities.cpp |---------------------------------------------------------------
- char* ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg);
+ char* ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg);
char* GetUserStoredPassword(char *szBuffer, int cbSize);
char* GetUserPassword(BOOL bAlways);
WORD GetMyStatusFlags();
- DWORD ReportGenericSendError(HANDLE hContact, int nType, const char* szErrorMsg);
+ DWORD ReportGenericSendError(HCONTACT hContact, int nType, const char* szErrorMsg);
void SetCurrentStatus(int nStatus);
void __cdecl ProtocolAckThread(icq_ack_args* pArguments);
- void SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
+ void SendProtoAck(HCONTACT hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
int NetLog_Direct(const char *fmt,...);
int NetLog_Uni(BOOL bDC, const char *fmt,...);
@@ -881,8 +882,8 @@ struct CIcqProto : public PROTO<CIcqProto>
icq_critical_section *contactsCacheMutex;
LIST<icq_contacts_cache> contactsCache;
- void AddToContactsCache(HANDLE hContact, DWORD dwUin, const char *szUid);
- void DeleteFromContactsCache(HANDLE hContact);
+ void AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid);
+ void DeleteFromContactsCache(HCONTACT hContact);
void InitContactsCache();
void UninitContactsCache();
@@ -891,38 +892,38 @@ struct CIcqProto : public PROTO<CIcqProto>
HANDLE NetLib_BindPort(NETLIBNEWCONNECTIONPROC_V2 pFunc, void* lParam, WORD* pwPort, DWORD* pdwIntIP);
- HANDLE HandleFromCacheByUid(DWORD dwUin, const char *szUid);
- HANDLE HContactFromUIN(DWORD dwUin, int *Added);
- HANDLE HContactFromUID(DWORD dwUin, const char *szUid, int *Added);
- HANDLE HContactFromAuthEvent(HANDLE hEvent);
+ 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);
void ResetSettingsOnListReload();
void ResetSettingsOnConnect();
void ResetSettingsOnLoad();
- int IsMetaInfoChanged(HANDLE hContact);
+ int IsMetaInfoChanged(HCONTACT 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(HANDLE hContact, const char* szSetting, char** buf, WORD* pwLength);
- BOOL writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, char **buf, WORD* pwLength);
- BOOL writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength);
+ 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);
- void writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVDate(HANDLE hContact, const char *szSettingYear, const char *szSettingMonth, const char *szSettingDay, oscar_tlv_chain *chain, WORD wTlv);
- void writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
+ 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);
char** MirandaStatusToAwayMsg(int nStatus);
- bool validateStatusMessageRequest(HANDLE hContact, WORD byMessageType);
+ bool validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType);
};
#endif
diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h
index ab16e74007..7583bf9cb7 100644
--- a/protocols/IcqOscarJ/src/icq_rates.h
+++ b/protocols/IcqOscarJ/src/icq_rates.h
@@ -108,7 +108,7 @@ public:
virtual void execute();
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwUin;
char *szUid;
};
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp
index 5084742a9c..3de47b821b 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
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact)
{
DWORD dwUIN;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index 5eac04a78b..fa866116bc 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, HANDLE hContact, const char *pszGroup)
+int CIcqProto::servlistPendingFindItem(int nType, HCONTACT 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, HANDLE hContact, const char *pszGroup)
+servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HCONTACT hContact, const char *pszGroup)
{ // unregister pending item, trigger pending operations
int iItem;
servlistpendingitem *pItem = NULL;
@@ -546,7 +546,7 @@ servlistpendingitem* CIcqProto::servlistPendingRemoveItem(int nType, HANDLE hCon
}
-void CIcqProto::servlistPendingAddContactOperation(HANDLE hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags)
+void CIcqProto::servlistPendingAddContactOperation(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam, PENDING_CONTACT_CALLBACK operationCallback)
+int CIcqProto::servlistPendingAddContact(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, int nResult)
+void CIcqProto::servlistPendingRemoveContact(HCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult)
{
#ifdef _DEBUG
debugLogA("Server-List: %s contact %x operation.", (nResult != PENDING_RESULT_PURGE) ? "Ending" : "Purging", hContact);
@@ -800,7 +800,7 @@ void CIcqProto::servlistPendingFlushOperations()
// used for adding new contacts to list - sync with visible items
-void CIcqProto::AddJustAddedContact(HANDLE hContact)
+void CIcqProto::AddJustAddedContact(HCONTACT hContact)
{
icq_lock l(servlistMutex);
@@ -816,7 +816,7 @@ void CIcqProto::AddJustAddedContact(HANDLE hContact)
// was the contact added during this serv-list load
-BOOL CIcqProto::IsContactJustAdded(HANDLE hContact)
+BOOL CIcqProto::IsContactJustAdded(HCONTACT hContact)
{
icq_lock l(servlistMutex);
@@ -975,7 +975,7 @@ void CIcqProto::LoadServerIDs()
nGroups = nServerIDListCount - nStart;
- HANDLE hContact = FindFirstContact();
+ HCONTACT 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(HANDLE hContact, DWORD dwCookie, WORD wAction, WORD wGroupId, WORD wContactId, DWORD dwOperation, DWORD dwTimeout, void **doubleObject)
+DWORD CIcqProto::icq_sendServerContact(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wAction, DWORD dwOperation, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_modifyServerPrivacyItem(HCONTACT 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(HANDLE hContact, DWORD dwUin, char
}
-DWORD CIcqProto::icq_removeServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_removeServerPrivacyItem(HCONTACT 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(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType)
+DWORD CIcqProto::icq_addServerPrivacyItem(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wItemID;
hContact = FindFirstContact();
@@ -1395,7 +1395,7 @@ void* CIcqProto::collectGroups(int *count)
WORD* buf = NULL;
int cnt = 0;
int i;
- HANDLE hContact;
+ HCONTACT hContact;
WORD wGroupID;
hContact = FindFirstContact();
@@ -1578,7 +1578,7 @@ int CIcqProto::getCListGroupExists(const char *szGroup)
}
-int CIcqProto::moveContactToCListGroup(HANDLE hContact, const char *szGroup)
+int CIcqProto::moveContactToCListGroup(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD wGroupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistAddContact_Ready(HCONTACT 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(HANDLE hContact, WORD wContactID, WORD w
// Called when contact should be added to server list, if group does not exist, create one
-void CIcqProto::servlistAddContact(HANDLE hContact, const char *pszGroup)
+void CIcqProto::servlistAddContact(HCONTACT hContact, const char *pszGroup)
{
DWORD dwUin;
uid_str szUid;
@@ -2068,7 +2068,7 @@ void CIcqProto::servlistAddContact(HANDLE hContact, const char *pszGroup)
}
-int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistRemoveContact_Ready(HCONTACT hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
{
WORD wGroupID;
WORD wItemID;
@@ -2115,7 +2115,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD
// Called when contact should be removed from server list, remove group if it remain empty
-void CIcqProto::servlistRemoveContact(HANDLE hContact)
+void CIcqProto::servlistRemoveContact(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
@@ -2201,7 +2201,7 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew
}
-int CIcqProto::servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistMoveContact_Ready(HCONTACT 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(HANDLE hContact, WORD contactID, WORD g
// Called when contact should be moved from one group to another, create new, remove empty
-void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
+void CIcqProto::servlistMoveContact(HCONTACT hContact, const char *pszNewGroup)
{
DWORD dwUin;
uid_str szUid;
@@ -2277,7 +2277,7 @@ void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
}
-int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD groupID, LPARAM lParam, int nResult)
+int CIcqProto::servlistUpdateContact_Ready(HCONTACT 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(HANDLE hContact, WORD contactID, WORD
// Is called when a contact' details has been changed locally to update
// the server side details.
-void CIcqProto::servlistUpdateContact(HANDLE hContact)
+void CIcqProto::servlistUpdateContact(HCONTACT hContact)
{
DWORD dwUin;
uid_str szUid;
@@ -2533,7 +2533,7 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId)
}*/
-void CIcqProto::resetServContactAuthState(HANDLE hContact, DWORD dwUin)
+void CIcqProto::resetServContactAuthState(HCONTACT 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((HANDLE)wParam);
+ servlistUpdateContact((HCONTACT)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((HANDLE)wParam);
+ char* szNewGroup = getContactCListGroup((HCONTACT)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((HANDLE)wParam);
+ servlistUpdateContact((HCONTACT)wParam);
}
}
@@ -2624,57 +2624,48 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam)
debugLogA("DB-Events: Contact %x deleted.", wParam);
#endif
- DeleteFromContactsCache((HANDLE)wParam);
+ DeleteFromContactsCache((HCONTACT)wParam);
if ( !icqOnline() && m_bSsiEnabled)
{ // contact was deleted only locally - retrieve full list on next connect
- setWord((HANDLE)wParam, "SrvRecordCount", 0);
+ setWord((HCONTACT)wParam, "SrvRecordCount", 0);
}
if ( !icqOnline() || !m_bSsiEnabled)
return 0;
- { // we need all server contacts on local buddy list
- DWORD dwUIN;
- uid_str szUID;
+ HCONTACT hContact = (HCONTACT)wParam;
- if (getContactUid((HANDLE)wParam, &dwUIN, &szUID))
- return 0;
+ // we need all server contacts on local buddy list
+ DWORD dwUIN;
+ uid_str szUID;
+ if (getContactUid(hContact, &dwUIN, &szUID))
+ return 0;
- WORD wContactID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_GROUP, 0);
- WORD wVisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_PERMIT, 0);
- WORD wInvisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_DENY, 0);
- WORD wIgnoreID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0);
+ WORD wContactID = getWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wVisibleID = getWord(hContact, DBSETTING_SERVLIST_PERMIT, 0);
+ WORD wInvisibleID = getWord(hContact, DBSETTING_SERVLIST_DENY, 0);
+ WORD wIgnoreID = getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
- // Remove from queue for user details request
- icq_DequeueUser(dwUIN);
+ // Remove from queue for user details request
+ icq_DequeueUser(dwUIN);
- // Close all opened peer connections
- CloseContactDirectConns((HANDLE)wParam);
+ // Close all opened peer connections
+ CloseContactDirectConns(hContact);
- if ((wGroupID && wContactID) || wVisibleID || wInvisibleID || wIgnoreID)
- {
- if (wContactID)
- { // delete contact from server
- servlistRemoveContact((HANDLE)wParam);
- }
+ if ((wGroupID && wContactID) || wVisibleID || wInvisibleID || wIgnoreID) {
+ if (wContactID) // delete contact from server
+ servlistRemoveContact(hContact);
- if (wVisibleID)
- { // detete permit record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wVisibleID, SSI_ITEM_PERMIT);
- }
+ if (wVisibleID) // detete permit record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wVisibleID, SSI_ITEM_PERMIT);
- if (wInvisibleID)
- { // delete deny record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wInvisibleID, SSI_ITEM_DENY);
- }
+ if (wInvisibleID) // delete deny record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wInvisibleID, SSI_ITEM_DENY);
- if (wIgnoreID)
- { // delete ignore record
- icq_removeServerPrivacyItem((HANDLE)wParam, dwUIN, szUID, wIgnoreID, SSI_ITEM_IGNORE);
- }
- }
+ if (wIgnoreID) // delete ignore record
+ icq_removeServerPrivacyItem(hContact, dwUIN, szUID, wIgnoreID, SSI_ITEM_IGNORE);
}
return 0;
@@ -2683,7 +2674,7 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam)
int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 76118ce3c0..3325a16538 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)(HANDLE hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult);
+typedef int (__cdecl CIcqProto::*PENDING_CONTACT_CALLBACK)(HCONTACT hContact, WORD wContactId, WORD wGroupId, LPARAM lParam, int nResult);
// cookie struct for SSI actions
struct cookie_servlist_action
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szGroup;
WORD wContactId;
WORD wGroupId;
@@ -159,7 +159,7 @@ struct servlistpendingoperation
struct servlistpendingitem
{
int nType;
- HANDLE hContact;
+ HCONTACT hContact;
char* szGroup;
WORD wContactID;
WORD wGroupID;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp
index 7b4aa7d4ba..ac6b56a295 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;
- HANDLE hContact = ppro->FindFirstContact();
+ HCONTACT 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
- HANDLE hContact = ppro->FindFirstContact();
+ HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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, HANDLE hContact, WORD wAction, DWORD dwUin, char *szUID, WORD wContactId, WORD wGroupId, WORD wItemType)
+static DWORD sendUploadBuddy(CIcqProto* ppro, HCONTACT 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 HANDLE hCurrentContact;
+ static HCONTACT 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:
{
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hItem;
if (bListInit) break;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 946191403c..612b970c50 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(HANDLE hContact)
+BYTE CIcqProto::getContactXStatus(HCONTACT hContact)
{
if (!m_bXStatusEnabled && !m_bMoodsEnabled)
return 0;
@@ -51,7 +51,7 @@ BYTE CIcqProto::getContactXStatus(HANDLE hContact)
return (bXStatus < 1 || bXStatus > XSTATUS_COUNT) ? 0 : bXStatus;
}
-DWORD CIcqProto::sendXStatusDetailsRequest(HANDLE hContact, int bForced)
+DWORD CIcqProto::sendXStatusDetailsRequest(HCONTACT hContact, int bForced)
{
DWORD dwCookie = 0;
@@ -67,7 +67,7 @@ DWORD CIcqProto::sendXStatusDetailsRequest(HANDLE hContact, int bForced)
return dwCookie;
}
-DWORD CIcqProto::requestXStatusDetails(HANDLE hContact, BOOL bAllowDelay)
+DWORD CIcqProto::requestXStatusDetails(HCONTACT 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(HANDLE hContact, int xstatus)
+void setContactExtraIcon(HCONTACT 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, HANDLE hContact, BYTE *caps, int capsize, char *moods, int moodsize)
+void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hEvent;
DWORD iEvent;
int countdown;
@@ -593,7 +593,7 @@ struct InitXStatusData
BYTE bXStatus;
char* szXStatusName;
char* szXStatusMsg;
- HANDLE hContact;
+ HCONTACT 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 = (HANDLE)wParam;
+ init.hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wParam);
+ BYTE bXStatus = getContactXStatus((HCONTACT)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 58e8230804..45ff2829fe 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, "<NOTIFY>");
char *szQuery = strstrnull(szMsg, "<QUERY>");
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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, HANDLE hContact, WORD wCookie, char* szMsg, int nMsgLen)
+void CIcqProto::handleXtrazNotifyResponse(DWORD dwUin, HCONTACT 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)
{
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact, char* szQuery, char* szNotify, int bForced)
+DWORD CIcqProto::SendXtrazNotifyRequest(HCONTACT hContact, char* szQuery, char* szNotify, int bForced)
{
char *szQueryBody;
char *szNotifyBody;
@@ -409,7 +409,7 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2,
char *szResBody = MangleXml(szResponse, nResponseLen);
int nBodyLen = strlennull(szResBody) + 21;
char *szBody = (char*)_alloca(nBodyLen);
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT hContact = HContactFromUIN(dwUin, NULL);
if (hContact != INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) {
SAFE_FREE(&szResBody);
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index 4b2003650d..c0077c9c89 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((HANDLE)wParam, &dwUin, &szUid) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0))
+ if (!getContactUid((HCONTACT)wParam, &dwUin, &szUid) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HCONTACT)wParam, DBSETTING_SERVLIST_IGNORE, 0))
{ /// TODO: remove possible 0x6A TLV in contact server-list data!!!
// Read group from DB
- char *pszGroup = getContactCListGroup((HANDLE)wParam);
+ char *pszGroup = getContactCListGroup((HCONTACT)wParam);
- servlistAddContact((HANDLE)wParam, pszGroup);
+ servlistAddContact((HCONTACT)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((HANDLE)wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0);
+ INT_PTR rc = db_get_s((HCONTACT)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((HANDLE)wParam, &dwUin, &szUid))
+ if (getContactUid((HCONTACT)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((HANDLE)wParam, "Grant");
+ delSetting((HCONTACT)wParam, "Grant");
}
return 0;
@@ -494,7 +494,7 @@ INT_PTR CIcqProto::RevokeAuthorization(WPARAM wParam, LPARAM lParam)
DWORD dwUin;
uid_str szUid;
- if (getContactUid((HANDLE)wParam, &dwUin, &szUid))
+ if (getContactUid((HCONTACT)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)
@@ -636,7 +636,7 @@ INT_PTR CIcqProto::SetPassword(WPARAM wParam, LPARAM lParam)
HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)
{
int bAdded;
- HANDLE hContact = HContactFromUIN(dwUin, &bAdded);
+ HCONTACT hContact = HContactFromUIN(dwUin, &bAdded);
if (hContact)
{
if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
@@ -655,7 +655,7 @@ HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)
HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags)
{
int bAdded;
- HANDLE hContact = HContactFromUID(0, szUID, &bAdded);
+ HCONTACT hContact = HContactFromUID(0, szUID, &bAdded);
if (hContact)
{
if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
@@ -673,7 +673,7 @@ HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags)
/////////////////////////////////////////////////////////////////////////////////////////
-void CIcqProto::ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags)
+void CIcqProto::ICQAddRecvEvent(HCONTACT 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 bb764f6efa..b9d112dff3 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;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
DWORD dwRemoteIP;
oscar_filetransfer *ft;
@@ -171,7 +171,7 @@ int CIcqProto::IsValidOscarTransfer(void *ft)
}
-oscar_filetransfer* CIcqProto::FindOscarTransfer(HANDLE hContact, DWORD dwID1, DWORD dwID2)
+oscar_filetransfer* CIcqProto::FindOscarTransfer(HCONTACT 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)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT 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;
- HANDLE hContact = HContactFromUID(dwUin, szUID, &bAdded);
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
+HANDLE CIcqProto::oftInitTransfer(HCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
{
int i, filesCount;
struct _stati64 statbuf;
@@ -992,7 +992,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con
}
-HANDLE CIcqProto::oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CIcqProto::oftFileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1025,7 +1025,7 @@ HANDLE CIcqProto::oftFileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *s
}
-DWORD CIcqProto::oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason)
+DWORD CIcqProto::oftFileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1054,7 +1054,7 @@ DWORD CIcqProto::oftFileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szR
}
-DWORD CIcqProto::oftFileCancel(HANDLE hContact, HANDLE hTransfer)
+DWORD CIcqProto::oftFileCancel(HCONTACT hContact, HANDLE hTransfer)
{
oscar_filetransfer* ft = (oscar_filetransfer*)hTransfer;
DWORD dwUin;
@@ -1231,7 +1231,7 @@ void CIcqProto::CloseOscarConnection(oscar_connection *oc)
/////////////////////////////////////////////////////////////////////////////////////////
-void CIcqProto::OpenOscarConnection(HANDLE hContact, oscar_filetransfer *ft, int type)
+void CIcqProto::OpenOscarConnection(HCONTACT 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 fa6ec9169e..bf4162b50b 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
{
- HANDLE hContact;
+ HCONTACT hContact;
int flags; // combination of OFTF_*
int containerCount;
char **file_containers;
@@ -123,7 +123,7 @@ void SafeReleaseFileTransfer(void **ft);
struct oscar_connection
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hConnection;
int status;
DWORD dwUin;
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp
index e1e573cc9f..eb36b3277c 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, HANDLE hContact, char *pszText, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HCONTACT hContact, char *pszText, cookie_message_data *pCookieData)
{
icq_packet packet;
WORD wPacketLength;
@@ -355,7 +355,7 @@ DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, HANDLE hConta
}
-DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hContact, WCHAR *pszText, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData)
{
icq_packet packet;
WORD wMessageLen;
@@ -405,7 +405,7 @@ DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, HANDLE hCont
}
-DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HANDLE hContact, const char *szMessage, int nBodyLen, WORD wPriority, cookie_message_data *pCookieData, char *szCap)
+DWORD CIcqProto::icq_SendChannel2Message(DWORD dwUin, HCONTACT 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, HANDLE hContact, const cha
}
-DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HANDLE hContact, const char *pData, WORD wDataLen, const char *pNames, WORD wNamesLen, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel2Contacts(DWORD dwUin, char *szUid, HCONTACT 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, HANDLE hCont
}
-DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HANDLE hContact, BYTE bMsgType, WORD wMsgLen, const char *szMsg, cookie_message_data *pCookieData)
+DWORD CIcqProto::icq_SendChannel4Message(DWORD dwUin, HCONTACT 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(HANDLE hContact, DWORD dwUin, int bManual)
+DWORD CIcqProto::icq_sendGetInfoServ(HCONTACT hContact, DWORD dwUin, int bManual)
{
icq_packet packet;
DWORD dwCookie = 0;
@@ -607,7 +607,7 @@ DWORD CIcqProto::icq_sendGetInfoServ(HANDLE hContact, DWORD dwUin, int bManual)
}
-DWORD CIcqProto::icq_sendGetAimProfileServ(HANDLE hContact, char* szUid)
+DWORD CIcqProto::icq_sendGetAimProfileServ(HCONTACT hContact, char* szUid)
{
icq_packet packet;
BYTE bUIDlen = strlennull(szUid);
@@ -632,7 +632,7 @@ DWORD CIcqProto::icq_sendGetAimProfileServ(HANDLE hContact, char* szUid)
}
-DWORD CIcqProto::icq_sendGetAwayMsgServ(HANDLE hContact, DWORD dwUin, int type, WORD wVersion)
+DWORD CIcqProto::icq_sendGetAwayMsgServ(HCONTACT hContact, DWORD dwUin, int type, WORD wVersion)
{
icq_packet packet;
@@ -650,7 +650,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServ(HANDLE hContact, DWORD dwUin, int type,
}
-DWORD CIcqProto::icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *szUID, int type, WORD wVersion)
+DWORD CIcqProto::icq_sendGetAwayMsgServExt(HCONTACT hContact, DWORD dwUin, char *szUID, int type, WORD wVersion)
{
icq_packet packet;
@@ -684,7 +684,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgServExt(HANDLE hContact, DWORD dwUin, char *s
}
-DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HANDLE hContact, char *szUID, int type)
+DWORD CIcqProto::icq_sendGetAimAwayMsgServ(HCONTACT 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)
{
- HANDLE hContact = HContactFromUIN(dwUin, NULL);
+ HCONTACT 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)
{
- HANDLE hContact = HContactFromUID(dwUin, szUID, NULL);
+ HCONTACT 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(HANDLE hContact, DWORD dwUin, char* szUID, int list, int add)
+void CIcqProto::icq_sendChangeVisInvis(HCONTACT 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 a3e8064992..57b3f9ac4f 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(HANDLE hContact, DWORD dwUin, const char *szUid)
+void CIcqProto::AddToContactsCache(HCONTACT hContact, DWORD dwUin, const char *szUid)
{
if (!hContact || (!dwUin && !szUid))
return;
@@ -372,7 +372,7 @@ void CIcqProto::InitContactsCache()
// build cache
icq_lock l(contactsCacheMutex);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
DWORD dwUin;
@@ -411,7 +411,7 @@ void CIcqProto::UninitContactsCache(void)
}
-void CIcqProto::DeleteFromContactsCache(HANDLE hContact)
+void CIcqProto::DeleteFromContactsCache(HCONTACT hContact)
{
icq_lock l(contactsCacheMutex);
@@ -432,7 +432,7 @@ void CIcqProto::DeleteFromContactsCache(HANDLE hContact)
}
-HANDLE CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid)
+HCONTACT CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid)
{
icq_contacts_cache cache_item = { NULL, dwUin, szUid };
@@ -446,12 +446,13 @@ HANDLE CIcqProto::HandleFromCacheByUid(DWORD dwUin, const char *szUid)
}
-HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
+HCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
{
if (Added) *Added = 0;
- HANDLE hContact = HandleFromCacheByUid(dwUin, NULL);
- if (hContact) return hContact;
+ HCONTACT hContact = HandleFromCacheByUid(dwUin, NULL);
+ if (hContact)
+ return hContact;
hContact = FindFirstContact();
while (hContact) {
@@ -468,17 +469,17 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
//not present: add
if (Added) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
debugLogA("Failed to create ICQ contact %u", dwUin);
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
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 INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
setDword(hContact, UNIQUEIDSETTING, dwUin);
@@ -504,20 +505,21 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
if (getContactUin(NULL) == dwUin)
return NULL;
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
+HCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
{
if (dwUin)
return HContactFromUIN(dwUin, Added);
if (Added) *Added = 0;
- if (!m_bAimEnabled) return INVALID_HANDLE_VALUE;
+ if (!m_bAimEnabled)
+ return (HCONTACT)INVALID_HANDLE_VALUE;
- HANDLE hContact = HandleFromCacheByUid(dwUin, szUid);
+ HCONTACT hContact = HandleFromCacheByUid(dwUin, szUid);
if (hContact) return hContact;
hContact = FindFirstContact();
@@ -538,7 +540,7 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
//not present: add
if (Added) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
setString(hContact, UNIQUEIDSETTING, szUid);
@@ -558,11 +560,11 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
return hContact;
}
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-HANDLE CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
+HCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
DWORD body[3];
@@ -571,28 +573,28 @@ HANDLE CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
dbei.pBlob = (PBYTE)&body;
if (db_event_get(hEvent, &dbei))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (strcmpnull(dbei.szModule, m_szModuleName))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
return DbGetAuthEventContact(&dbei);
}
-char *NickFromHandle(HANDLE hContact)
+char *NickFromHandle(HCONTACT hContact)
{
- if (hContact == INVALID_HANDLE_VALUE)
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
return null_strdup(Translate("<invalid>"));
return null_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0));
}
-char *NickFromHandleUtf(HANDLE hContact)
+char *NickFromHandleUtf(HCONTACT hContact)
{
- if (hContact == INVALID_HANDLE_VALUE)
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
return ICQTranslateUtf(LPGEN("<invalid>"));
return tchar_to_utf8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
@@ -886,7 +888,7 @@ void CIcqProto::ResetSettingsOnListReload()
setWord("SrvRecordCount", 0);
delSetting(DBSETTING_SERVLIST_UNHANDLED);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
// All these values will be restored during the serv-list receive
@@ -910,7 +912,7 @@ void CIcqProto::ResetSettingsOnConnect()
setByte("SrvVisibility", 0);
setDword("IdleTS", 0);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
setDword(hContact, "LogonTS", 0);
@@ -931,7 +933,7 @@ void CIcqProto::ResetSettingsOnLoad()
setDword("IdleTS", 0);
setDword("LogonTS", 0);
- HANDLE hContact = FindFirstContact();
+ HCONTACT hContact = FindFirstContact();
while (hContact) {
setDword(hContact, "LogonTS", 0);
@@ -987,7 +989,7 @@ void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments)
SAFE_FREE((void**)&pArguments);
}
-void CIcqProto::SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage)
+void CIcqProto::SendProtoAck(HCONTACT 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;
@@ -1008,7 +1010,7 @@ void CIcqProto::SetCurrentStatus(int nStatus)
}
-int CIcqProto::IsMetaInfoChanged(HANDLE hContact)
+int CIcqProto::IsMetaInfoChanged(HCONTACT hContact)
{
DBVARIANT infoToken = { DBVT_DELETED };
int res = 0;
@@ -1248,7 +1250,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay)
}
-void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVStringUtf(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
oscar_tlv *pTLV = chain->getTLV(wTlv, 1);
@@ -1263,7 +1265,7 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSe
}
-void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVWord(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
int num = chain->getNumber(wTlv, 1);
if (num > 0)
@@ -1273,7 +1275,7 @@ void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting
}
-void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVByte(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
int num = chain->getNumber(wTlv, 1);
@@ -1284,7 +1286,7 @@ void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting
}
-void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVDouble(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
double num = chain->getDouble(wTlv, 1);
if (num > 0)
@@ -1293,7 +1295,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetti
delSetting(hContact, szSetting);
}
-void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVDate(HCONTACT hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv)
{
double time = chain->getDouble(wTlv, 1);
@@ -1318,7 +1320,7 @@ void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSetting
}
-void CIcqProto::writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
+void CIcqProto::writeDbInfoSettingTLVBlob(HCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv)
{
oscar_tlv *pTLV = chain->getTLV(wTlv, 1);
@@ -1329,7 +1331,7 @@ void CIcqProto::writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting
}
-BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting, char** buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingString(HCONTACT hContact, const char* szSetting, char** buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1362,7 +1364,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting,
return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingWord(HCONTACT hContact, const char *szSetting, char **buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1379,7 +1381,7 @@ BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, c
return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingWordWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
{
if (*pwLength < 2)
return FALSE;
@@ -1398,7 +1400,7 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szS
return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingByte(HCONTACT hContact, const char *pszSetting, char **buf, WORD* pwLength)
{
if (*pwLength < 1)
return FALSE;
@@ -1415,7 +1417,7 @@ BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting,
return TRUE;
}
-BOOL CIcqProto::writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
+BOOL CIcqProto::writeDbInfoSettingByteWithTable(HCONTACT hContact, const char *szSetting, const FieldNamesItem *table, char **buf, WORD* pwLength)
{
if (*pwLength < 1)
return FALSE;
@@ -1448,7 +1450,7 @@ char* time2text(time_t time)
}
-bool CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType)
+bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageType)
{
// Privacy control
if (getByte("StatusMsgReplyCList", 0)) {
@@ -1902,7 +1904,7 @@ int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uTy
return res;
}
-char* CIcqProto::ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg)
+char* CIcqProto::ConvertMsgToUserSpecificAnsi(HCONTACT hContact, const char* szMsg)
{ // this takes utf-8 encoded message
WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage);
char* szAnsi = NULL;
@@ -1915,7 +1917,7 @@ char* CIcqProto::ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg
}
// just broadcast generic send error with dummy cookie and return that cookie
-DWORD CIcqProto::ReportGenericSendError(HANDLE hContact, int nType, const char* szErrorMsg)
+DWORD CIcqProto::ReportGenericSendError(HCONTACT 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 25387d7ef3..c229feac2a 100644
--- a/protocols/IcqOscarJ/src/utilities.h
+++ b/protocols/IcqOscarJ/src/utilities.h
@@ -33,7 +33,7 @@
struct icq_ack_args
{
- HANDLE hContact;
+ HCONTACT hContact;
int nAckType;
int nAckResult;
HANDLE hSequence;
@@ -42,7 +42,7 @@ struct icq_ack_args
struct icq_contacts_cache
{
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact);
-char *NickFromHandleUtf(HANDLE hContact);
+char *NickFromHandle(HCONTACT hContact);
+char *NickFromHandleUtf(HCONTACT 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(HANDLE hContact, int xstatus);
+void setContactExtraIcon(HCONTACT 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 debcb70949..bf7839a11e 100644
--- a/protocols/JabberG/src/jabber.h
+++ b/protocols/JabberG/src/jabber.h
@@ -362,8 +362,8 @@ struct ThreadData
int zlibRecv(char* data, long datalen);
// for nick names resolving
- int resolveID;
- HANDLE resolveContact;
+ int resolveID;
+ HCONTACT resolveContact;
// features & registration
HWND reg_hwndDlg;
@@ -760,7 +760,7 @@ void strdel(char* parBuffer, int len);
//---- jabber_userinfo.cpp --------------------------------------------------------------
-void JabberUserInfoUpdate(HANDLE hContact);
+void JabberUserInfoUpdate(HCONTACT 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 1f4f55acf7..f3777d0ff9 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 7cacaa4c21..fa057d002b 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);
}
-HANDLE CJabberProto::ContactFromJID(LPCTSTR jid)
+HCONTACT CJabberProto::ContactFromJID(LPCTSTR jid)
{
if (jid == NULL) return NULL;
return HContactFromJID(jid);
}
-LPTSTR CJabberProto::ContactToJID(HANDLE hContact)
+LPTSTR CJabberProto::ContactToJID(HCONTACT 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 d2faf4fd8e..0786b363bf 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(HANDLE hContact, JABBER_LIST_ITEM *pItem)
+void CJabberProto::RetrieveMessageArchive(HCONTACT 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;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
time_t tmLast = 0;
for (int nodeIdx = 1; ; nodeIdx++) {
@@ -99,7 +99,7 @@ static HANDLE hPreviousContact = INVALID_HANDLE_VALUE;
static HANDLE hPreviousDbEvent = NULL;
// Returns TRUE if the event already exist in the database
-BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei)
+BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO& dbei)
{
HANDLE hExistingDbEvent;
DWORD dwEventTimeStamp;
@@ -258,7 +258,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
if (!start || !with)
return;
- HANDLE hContact = HContactFromJID(with);
+ HCONTACT 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 20e7714bc8..d43a3b85ff 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);
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT 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 (HANDLE hContact = HContactFromJID(him->m_tszRealJid)) {
+ if (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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("");
- HANDLE hContact = m_proto->HContactFromJID(buf);
+ HCONTACT 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 (HANDLE hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
+ for (HCONTACT 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 (HANDLE hContact = ppro->HContactFromJID(him->m_tszRealJid))
+ if (HCONTACT 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);
- HANDLE hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ HCONTACT hContact = (HCONTACT)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) {
- HANDLE hContact;
+ HCONTACT 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 = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ hContact = (HCONTACT)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");
- HANDLE hContact = ppro->HContactFromJID(item->jid);
+ HCONTACT hContact = ppro->HContactFromJID(item->jid);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
ppro->AddEditBookmark(item);
}
@@ -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);
- HANDLE hContact = ppro->DBCreateContact(szFullJid, NULL, TRUE, FALSE);
+ HCONTACT 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 9b0ad50aad..1453e9f40f 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) {
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT 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) {
- HANDLE hContact;
+ HCONTACT 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:
{
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT 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();
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT 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 = (HANDLE)CallProtoService(m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ hContact = (HCONTACT)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:
{
- HANDLE hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE);
+ HCONTACT 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)) {
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT 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 d9a46a9d11..f9795c7ac9 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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, HANDLE hContact)
+void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HCONTACT 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, HANDLE hCon
}
}
-void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT 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, HANDLE hC
}
}
-void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT 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, HANDL
int __cdecl CJabberProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 d6d9fb29b5..c36d2cdc77 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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);
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT 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
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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 df3c3ced7b..8c36b3d02b 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -393,7 +393,7 @@ int CJabberProto::OnReloadIcons(WPARAM, LPARAM)
INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM)
{
- HANDLE hContact=(HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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, HANDLE hContact)
+BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact)
{
// check if transport is already set
if (!jid || !hContact)
@@ -455,7 +455,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact
void CJabberProto::CheckAllContactsAreTransported()
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 c2c3dc960d..3eece1ec6e 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;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
TCHAR *m_szTo;
TCHAR *m_szId;
@@ -117,7 +117,7 @@ public:
__forceinline TCHAR* GetIdStr()
{ return m_szId;
}
- __forceinline HANDLE GetHContact()
+ __forceinline HCONTACT 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 e83ad340ea..bd360cd167 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;
- HANDLE hContact = NULL;
+ HCONTACT 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 5e3cb859eb..c069d7fb31 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(HANDLE hContact, bool autojoin)
+void CJabberProto::GroupchatJoinByHContact(HCONTACT hContact, bool autojoin)
{
ptrT roomjid( getTStringA(hContact, "ChatRoomID"));
if (roomjid == NULL)
@@ -425,7 +425,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
}
}
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; ) {
- HANDLE hNext = db_find_next(hContact, m_szModuleName);
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) {
+ HCONTACT 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((HANDLE)chatRooms[i], true);
+ GroupchatJoinByHContact((HCONTACT)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"))) {
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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, HANDLE hContact, bool &hasPhoto)
+void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR text[128];
DBVARIANT dbv;
@@ -1284,7 +1284,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
if (from == NULL)
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact == NULL)
return;
@@ -1363,7 +1363,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo)
if (from == NULL)
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact == NULL)
return;
@@ -1396,7 +1396,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo)
}
-void CJabberProto::OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mimeType)
+void CJabberProto::OnIqResultGotAvatar(HCONTACT 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 4c4c8358dc..eaddb149eb 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;
- HANDLE hContact;
+ HCONTACT hContact;
- JABBER_HTTP_AVATARS(const TCHAR *tUrl, HANDLE thContact)
+ JABBER_HTTP_AVATARS(const TCHAR *tUrl, HCONTACT 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 2d0f0beb0b..b644efbbd8 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(HANDLE hContact)
+static CJabberProto* JabberGetInstanceByHContact(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -88,73 +88,73 @@ static CJabberProto* JabberGetInstanceByHContact(HANDLE hContact)
static INT_PTR JabberMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleRequestAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleGrantAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuRevokeAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuRevokeAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuConvertChatContact(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuConvertChatContact(wParam, lParam) : 0;
}
static INT_PTR JabberMenuRosterAdd(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuRosterAdd(wParam, lParam) : 0;
}
static INT_PTR JabberMenuBookmarkAdd(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuBookmarkAdd(wParam, lParam) : 0;
}
static INT_PTR JabberMenuTransportLogin(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuTransportLogin(wParam, lParam) : 0;
}
static INT_PTR JabberMenuTransportResolve(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuTransportResolve(wParam, lParam) : 0;
}
static INT_PTR JabberContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->ContactMenuRunCommands(wParam, lParam) : 0;
}
static INT_PTR JabberMenuSendNote(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuSendNote(wParam, lParam) : 0;
}
static INT_PTR JabberMenuHandleResource(WPARAM wParam, LPARAM lParam, LPARAM lRes)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleResource(wParam, lParam, lRes) : 0;
}
static INT_PTR JabberMenuHandleDirectPresence(WPARAM wParam, LPARAM lParam, LPARAM lRes)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)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((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0;
}
@@ -347,7 +347,7 @@ void g_MenuUninit(void)
int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -479,7 +479,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
@@ -494,14 +494,17 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
{
- if (!wParam) return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
+ HCONTACT hContact = (HCONTACT)wParam;
+ if (!hContact)
+ return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrT roomID(getTStringA((HANDLE)wParam, "ChatRoomID"));
- if (roomID == NULL) return 0;
+ ptrT roomID(getTStringA(hContact, "ChatRoomID"));
+ if (roomID == NULL)
+ return 0;
if (ListGetItemPtr(LIST_ROSTER, roomID) == NULL) {
- ptrT group(db_get_tsa((HANDLE)wParam, "CList", "Group"));
- ptrT nick(getTStringA((HANDLE)wParam, "Nick"));
+ ptrT group(db_get_tsa(hContact, "CList", "Group"));
+ ptrT nick(getTStringA(hContact, "Nick"));
AddContactToRoster(roomID, nick, group);
if (m_options.AddRoster2Bookmarks == TRUE) {
@@ -510,7 +513,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
item = new JABBER_LIST_ITEM();
item->jid = mir_tstrdup(roomID);
item->name = mir_tstrdup(nick);
- item->nick = getTStringA((HANDLE)wParam, "MyNick");
+ item->nick = getTStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -521,7 +524,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -532,7 +535,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -543,7 +546,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -554,7 +557,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!getByte(hContact, "IsTransport", 0))
return 0;
@@ -570,7 +573,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!getByte(hContact, "IsTransport", 0))
return 0;
@@ -582,7 +585,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
@@ -974,7 +977,7 @@ void CJabberProto::MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item)
if (item->list != LIST_ROSTER)
return;
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (!hContact)
return;
@@ -1040,7 +1043,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam)
if (lstrcmpA(sicd->szModule, m_szModuleName))
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
@@ -1094,7 +1097,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM
if (!m_bJabberOnline || !wParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL)
return 0;
@@ -1126,7 +1129,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM wParam, LPARAM l
if (!m_bJabberOnline || !wParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 b3815d7c8e..e2bc848e2b 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;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
LPCTSTR m_szTo;
LPCTSTR m_szId;
@@ -77,7 +77,7 @@ public:
__forceinline LPCTSTR GetIdStr()
{ return m_szId;
}
- __forceinline HANDLE GetHContact()
+ __forceinline HCONTACT GetHContact()
{ return m_hContact;
}
__forceinline HXML GetChildNode()
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 7bc90fd9f1..04af56aec0 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)
{
- HANDLE hContact = DBCreateContact(jid, nick, TRUE, TRUE);
+ HCONTACT 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()
-HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource)
+HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource)
{
if (jid == NULL || jid[0]=='\0')
return NULL;
@@ -120,7 +120,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t
// We can't use JabberHContactFromJID() here because of the stripResource option
size_t len = _tcslen(s);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL)
continue;
@@ -130,7 +130,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t
return hContact;
}
- HANDLE hNewContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hNewContact = (HCONTACT)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 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t
return hNewContact;
}
-BOOL CJabberProto::AddDbPresenceEvent(HANDLE hContact, BYTE btEventType)
+BOOL CJabberProto::AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType)
{
if (!hContact)
return FALSE;
@@ -179,7 +179,7 @@ BOOL CJabberProto::AddDbPresenceEvent(HANDLE hContact, BYTE btEventType)
///////////////////////////////////////////////////////////////////////////////
// JabberGetAvatarFileName() - gets a file name for the avatar image
-void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
+void CJabberProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
@@ -219,9 +219,9 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL
void CJabberProto::ResolveTransportNicks(const TCHAR *jid)
{
// Set all contacts to offline
- HANDLE hContact = m_ThreadInfo->resolveContact;
+ HCONTACT hContact = m_ThreadInfo->resolveContact;
if (hContact == NULL)
- hContact = (HANDLE)db_find_first(m_szModuleName);
+ hContact = db_find_first(m_szModuleName);
for (; hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) {
if (!getByte(hContact, "IsTransported", 0))
@@ -320,7 +320,7 @@ static sttCapsNodeToName_Map[] =
void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
{
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (!hContact)
return;
@@ -396,7 +396,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
}
-void CJabberProto::UpdateMirVer(HANDLE hContact, pResourceStatus &resource)
+void CJabberProto::UpdateMirVer(HCONTACT hContact, pResourceStatus &resource)
{
CMString tszMirVer;
FormatMirVer(resource, tszMirVer);
@@ -415,7 +415,7 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, pResourceStatus &resource)
setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
-void CJabberProto::UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *item)
+void CJabberProto::UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item)
{
switch (item->subscription) {
case SUB_TO:
@@ -445,7 +445,7 @@ void CJabberProto::UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *ite
}
}
-void CJabberProto::SetContactOfflineStatus(HANDLE hContact)
+void CJabberProto::SetContactOfflineStatus(HCONTACT 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(HANDLE hContact, const TCHAR *szMsg, const TCHAR *szTitle)
+void CJabberProto::MsgPopup(HCONTACT 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 33a183be41..db49f4d08e 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((HANDLE)wParam, "jid")));
+ CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA((HCONTACT)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 65ea059fc9..d6720c5a84 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) {
- HANDLE hContact = m_proto->HContactFromJID(item->jid);
+ HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 910aff524b..f5cb1785c9 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 (HANDLE hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
+ for (HCONTACT 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 (HANDLE hContact = m_proto->HContactFromJID(pRule->GetValue())) {
+ if (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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)
{
- HANDLE hContact = m_proto->HContactFromJID(jid);
+ HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 3c1581a46f..2af1d877fe 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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
-HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
+HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR *jid, *nick;
debugLogA("AddToListByJID jid = %S", newJid);
@@ -325,7 +325,7 @@ HANDLE 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 = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
setTString(hContact, "jid", jid);
if ((nick=JabberNickFromJID(newJid)) == NULL)
@@ -398,7 +398,7 @@ HANDLE __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDL
char *jid = lastName + strlen(lastName) + 1;
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
- HANDLE hContact = (HANDLE)AddToListByJID(newJid, flags);
+ HCONTACT hContact = (HCONTACT)AddToListByJID(newJid, flags);
mir_free(newJid);
return hContact;
}
@@ -436,12 +436,11 @@ int CJabberProto::Authorize(HANDLE hDbEvent)
// Automatically add this user to my roster if option is enabled
if (m_options.AutoAdd == TRUE) {
- HANDLE hContact;
JABBER_LIST_ITEM *item;
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 = AddToListByJID(newJid, 0)) != NULL) {
+ if (HCONTACT hContact = AddToListByJID(newJid, 0)) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
db_unset(hContact, "CList", "NotOnList");
@@ -493,7 +492,7 @@ int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CJabberProto::AuthRecv(HANDLE, PROTORECVEVENT*)
+int __cdecl CJabberProto::AuthRecv(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -501,7 +500,7 @@ int __cdecl CJabberProto::AuthRecv(HANDLE, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CJabberProto::AuthRequest(HANDLE, const TCHAR*)
+int __cdecl CJabberProto::AuthRequest(HCONTACT, const TCHAR*)
{
return 1;
}
@@ -517,7 +516,7 @@ HANDLE __cdecl CJabberProto::ChangeInfo(int /*iInfoType*/, void*)
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileAllow - starts a file transfer
-HANDLE __cdecl CJabberProto::FileAllow(HANDLE /*hContact*/, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE __cdecl CJabberProto::FileAllow(HCONTACT /*hContact*/, HANDLE hTransfer, const TCHAR *szPath)
{
if (!m_bJabberOnline)
return 0;
@@ -545,7 +544,7 @@ HANDLE __cdecl CJabberProto::FileAllow(HANDLE /*hContact*/, HANDLE hTransfer, co
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileCancel - cancels a file transfer
-int __cdecl CJabberProto::FileCancel(HANDLE /*hContact*/, HANDLE hTransfer)
+int __cdecl CJabberProto::FileCancel(HCONTACT, HANDLE hTransfer)
{
filetransfer *ft = (filetransfer*)hTransfer;
HANDLE hEvent;
@@ -573,7 +572,7 @@ int __cdecl CJabberProto::FileCancel(HANDLE /*hContact*/, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileDeny - denies a file transfer
-int __cdecl CJabberProto::FileDeny(HANDLE, HANDLE hTransfer, const TCHAR *)
+int __cdecl CJabberProto::FileDeny(HCONTACT, HANDLE hTransfer, const TCHAR *)
{
if (!m_bJabberOnline)
return 1;
@@ -617,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, HANDLE hContact)
+DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HCONTACT hContact)
{
switch(type) {
case PFLAGNUM_1:
@@ -645,7 +644,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
+int __cdecl CJabberProto::GetInfo(HCONTACT hContact, int /*infoType*/)
{
if (!m_bJabberOnline || isChatRoom(hContact))
return 1;
@@ -859,7 +858,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CJabberProto::RecvContacts(HANDLE /*hContact*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvContacts(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -867,7 +866,7 @@ int __cdecl CJabberProto::RecvContacts(HANDLE /*hContact*/, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET *evt)
+int __cdecl CJabberProto::RecvFile(HCONTACT hContact, PROTORECVFILET *evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -875,7 +874,7 @@ int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET *evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *evt)
+int __cdecl CJabberProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *evt)
{
ptrA szResUtf( mir_utf8encodeT((LPCTSTR)evt->lParam));
evt->pCustomData = szResUtf;
@@ -887,7 +886,7 @@ int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CJabberProto::RecvUrl(HANDLE /*hContact*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvUrl(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -895,7 +894,7 @@ int __cdecl CJabberProto::RecvUrl(HANDLE /*hContact*/, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CJabberProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
if (!m_bJabberOnline)
return 0;
@@ -925,7 +924,7 @@ int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CJabberProto::SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CJabberProto::SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR** ppszFiles)
{
if (!m_bJabberOnline) return 0;
@@ -1012,10 +1011,10 @@ HANDLE __cdecl CJabberProto::SendFile(HANDLE hContact, const TCHAR *szDescriptio
struct TFakeAckParams
{
- inline TFakeAckParams(HANDLE _hContact, const char* _msg, int _msgid = 0)
+ inline TFakeAckParams(HCONTACT _hContact, const char* _msg, int _msgid = 0)
: hContact(_hContact), msg(_msg), msgid(_msgid) {}
- HANDLE hContact;
+ HCONTACT hContact;
const char *msg;
int msgid;
};
@@ -1035,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(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CJabberProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
TCHAR szClientJid[JABBER_MAX_JID_LEN];
if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, SIZEOF(szClientJid))) {
@@ -1135,7 +1134,7 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CJabberProto::SendUrl(HANDLE /*hContact*/, int /*flags*/, const char* /*url*/)
+int __cdecl CJabberProto::SendUrl(HCONTACT, int /*flags*/, const char* /*url*/)
{
return 1;
}
@@ -1143,7 +1142,7 @@ int __cdecl CJabberProto::SendUrl(HANDLE /*hContact*/, int /*flags*/, const char
////////////////////////////////////////////////////////////////////////////////////////
// JabberSetApparentMode - sets the visibility status
-int __cdecl CJabberProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CJabberProto::SetApparentMode(HCONTACT hContact, int mode)
{
if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE)
return 1;
@@ -1223,8 +1222,10 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus)
////////////////////////////////////////////////////////////////////////////////////////
// JabberGetAwayMsg - returns a contact's away message
-void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
+void __cdecl CJabberProto::GetAwayMsgThread(void *param)
{
+ HCONTACT hContact = (HCONTACT)param;
+
ptrT jid( getTStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
@@ -1271,7 +1272,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0);
}
-HANDLE __cdecl CJabberProto::GetAwayMsg(HANDLE hContact)
+HANDLE __cdecl CJabberProto::GetAwayMsg(HCONTACT hContact)
{
debugLogA("GetAwayMsg called, hContact=%08X", hContact);
@@ -1282,7 +1283,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(HANDLE hContact)
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG
-int __cdecl CJabberProto::RecvAwayMsg(HANDLE /*hContact*/, int /*statusMode*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvAwayMsg(HCONTACT, int /*statusMode*/, PROTORECVEVENT*)
{
return 1;
}
@@ -1343,7 +1344,7 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg)
/////////////////////////////////////////////////////////////////////////////////////////
// JabberUserIsTyping - sends a UTN notification
-int __cdecl CJabberProto::UserIsTyping(HANDLE hContact, int type)
+int __cdecl CJabberProto::UserIsTyping(HCONTACT hContact, int type)
{
if (!m_bJabberOnline) return 0;
@@ -1425,7 +1426,7 @@ void CJabberProto::InfoFrame_OnSetup(CJabberInfoFrame_Event*)
void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt)
{
if (evt->m_event == CJabberInfoFrame_Event::CLICK) {
- HANDLE hContact = (HANDLE)evt->m_pUserData;
+ HCONTACT hContact = (HCONTACT)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 1bbf639c5d..6c90985d43 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -87,18 +87,18 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason);
+ 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 int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
@@ -106,24 +106,24 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTORECVFILET*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -132,7 +132,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
//====| Events |======================================================================
- void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDLE hContact);
+ void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
int __cdecl OnContactDeleted(WPARAM, LPARAM);
int __cdecl OnDbSettingChanged(WPARAM, LPARAM);
int __cdecl OnIdleChanged(WPARAM, LPARAM);
@@ -145,8 +145,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM);
int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM);
int __cdecl OnReloadIcons(WPARAM, LPARAM);
- void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hContact);
- void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hContact);
+ void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
+ void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
int __cdecl OnUserInfoInit(WPARAM, LPARAM);
int __cdecl JabberGcEventHook(WPARAM, LPARAM);
@@ -294,7 +294,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_archive.c --------------------------------------------------------------
void EnableArchive(bool bEnable);
- void RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pItem);
+ void RetrieveMessageArchive(HCONTACT hContact, JABBER_LIST_ITEM *pItem);
void OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*);
void OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*);
@@ -451,7 +451,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int LoadAdvancedIcons(int iID);
int GetTransportProtoID(TCHAR* TransportDomain);
int GetTransportStatusIconIndex(int iID, int Status);
- BOOL DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact);
+ BOOL DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact);
void CheckAllContactsAreTransported(void);
INT_PTR __cdecl JGetAdvancedStatusIcon(WPARAM wParam, LPARAM lParam);
@@ -472,7 +472,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mimeType);
+ void OnIqResultGotAvatar(HCONTACT 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<CJabberProto>, public IJabberInterface
//---- jabber_iqid.cpp ---------------------------------------------------------------
- void GroupchatJoinByHContact(HANDLE hContact, bool autojoin=false);
+ void GroupchatJoinByHContact(HCONTACT hContact, bool autojoin=false);
//---- jabber_message_handlers.cpp ---------------------------------------------------
@@ -560,7 +560,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType);
void OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HANDLE hContact, bool &hasPhoto);
+ void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT hContact, bool &hasPhoto);
void SetBookmarkRequest (XmlNodeIq& iqId);
//---- jabber_menu.cpp ---------------------------------------------------------------
@@ -584,7 +584,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void MenuInit(void);
void MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item);
- void AuthWorker(HANDLE hContact, char* authReqType);
+ void AuthWorker(HCONTACT hContact, char* authReqType);
void UpdatePriorityMenu(short priority);
@@ -599,18 +599,18 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName);
void DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick);
- BOOL AddDbPresenceEvent(HANDLE hContact, BYTE btEventType);
- HANDLE DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource);
- void GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen);
+ 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);
void ResolveTransportNicks(const TCHAR *jid);
void SetServerStatus(int iNewStatus);
void FormatMirVer(pResourceStatus &resource, CMString&);
void UpdateMirVer(JABBER_LIST_ITEM *item);
- void UpdateMirVer(HANDLE hContact, pResourceStatus &resource);
- void UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *item);
- void SetContactOfflineStatus(HANDLE hContact);
+ void UpdateMirVer(HCONTACT hContact, pResourceStatus &resource);
+ void UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item);
+ void SetContactOfflineStatus(HCONTACT hContact);
void InitPopups(void);
- void MsgPopup(HANDLE hContact, const TCHAR *szMsg, const TCHAR *szTitle);
+ void MsgPopup(HCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle);
//---- jabber_opt.cpp ----------------------------------------------------------------
@@ -653,7 +653,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void __cdecl GetAwayMsgThread(void* hContact);
void __cdecl SendMessageAckThread(void* hContact);
- HANDLE AddToListByJID(const TCHAR *newJid, DWORD flags);
+ HCONTACT 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<CJabberProto>, public IJabberInterface
void OnProcessProtocol(HXML node, ThreadData *info);
void UpdateJidDbSettings(const TCHAR *jid);
- HANDLE CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem);
+ HCONTACT CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem);
void PerformRegistration(ThreadData* info);
void PerformIqAuth(ThreadData* info);
@@ -759,8 +759,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_util.c -----------------------------------------------------------------
pResourceStatus ResourceInfoFromJID(const TCHAR *jid);
- HANDLE HContactFromJID(const TCHAR *jid , BOOL bStripResource = 3);
- HANDLE ChatRoomHContactFromJID(const TCHAR *jid);
+ HCONTACT HContactFromJID(const TCHAR *jid, BOOL bStripResource = 3);
+ HCONTACT 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<CJabberProto>, public IJabberInterface
void RebuildInfoFrame(void);
// returns buf or NULL on error
- TCHAR* GetClientJID(HANDLE hContact, TCHAR *dest, size_t destLen);
+ TCHAR* GetClientJID(HCONTACT 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<CJabberProto>, public IJabberInterface
HICON GetXStatusIcon(int bStatus, UINT flags);
void RegisterAdvStatusSlot(const char *pszSlot);
- void ResetAdvStatus(HANDLE hContact, const char *pszSlot);
- void WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText);
- char* ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue);
- TCHAR* ReadAdvStatusT(HANDLE hContact, const char *pszSlot, const char *pszValue);
+ 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);
BOOL SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource, TCHAR* szTitle, TCHAR* szTrack, TCHAR* szUri);
void XStatusInit(void);
- void SetContactTune(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack);
+ void SetContactTune(HCONTACT 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.
- HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID.
- LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact); // Returns JID of hContact. You must free the result using mir_free().
+ 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().
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 6c53d6b819..5df492cb82 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 ed66f07226..985030607f 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, HANDLE hContact, char *valueName)
+static TCHAR* JSetStringCrypt(LPCSTR szModule, HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 ee0b58dc2e..6741a69007 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;
- HANDLE hContact = HContactFromJID(szJid, TRUE);
+ HCONTACT 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;
- HANDLE hContact = HContactFromJID(szJid, TRUE);
+ HCONTACT 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 4449c0d2bf..eed8b47784 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
SetContactOfflineStatus(hContact);
mir_free(m_szJabberJID);
@@ -995,7 +995,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
m_pepServices.ProcessEvent(from, eventNode);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (!hContact)
return;
@@ -1030,7 +1030,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
}
// returns 0, if error or no events
-DWORD JabberGetLastContactMessageTime(HANDLE hContact)
+DWORD JabberGetLastContactMessageTime(HCONTACT hContact)
{
// TODO: time cache can improve performance
HANDLE hDbEvent = db_event_last(hContact);
@@ -1051,9 +1051,9 @@ DWORD JabberGetLastContactMessageTime(HANDLE hContact)
return dwTime;
}
-HANDLE CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem)
+HCONTACT CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem)
{
- HANDLE hContact = NULL;
+ HCONTACT 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;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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"))) {
- HANDLE hContact = DBCreateContact(jid, nick, FALSE, FALSE);
+ HCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE);
if (group)
db_set_ts(hContact, "CList", "Group", group);
}
else if (!_tcscmp(action, _T("delete"))) {
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT 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);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT 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;
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT hContact = HContactFromJID(jid);
if (hContact == NULL)
return;
@@ -1535,7 +1535,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
{
- HANDLE hContact;
+ HCONTACT 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 bb85ac1f74..adb80356f6 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -74,10 +74,10 @@ struct UserInfoStringBuf
struct JabberUserInfoDlgData
{
- CJabberProto* ppro;
- HANDLE hContact;
+ HCONTACT hContact;
+ CJabberProto *ppro;
JABBER_LIST_ITEM *item;
- int resourcesCount;
+ int resourcesCount;
};
enum
@@ -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, HANDLE hContact, TCHAR *szTitle, char *pszSlot)
+static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, HCONTACT 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 (HANDLE hContact = ppro->HContactFromJID(item->jid)) {
+ if (HCONTACT 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 = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)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:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY) lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
SendMessage(hwndDlg, WM_JABBER_REFRESH, 0, (LPARAM)hContact);
}
break;
@@ -589,8 +589,8 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
struct USER_PHOTO_INFO
{
- HANDLE hContact;
- HBITMAP hBitmap;
+ HCONTACT 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 = (HANDLE)lParam;
+ photoInfo->hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
if (hContact == NULL) {
// Show our vcard
OnUserInfoInit_VCard(wParam, lParam);
@@ -844,7 +844,7 @@ void JabberUserInfoUninit()
/////////////////////////////////////////////////////////////////////////////////////////
// JabberUserInfoUpdate
-void JabberUserInfoUpdate(HANDLE hContact)
+void JabberUserInfoUpdate(HCONTACT 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 d73ff4cce4..9a881deafb 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -34,12 +34,12 @@ int CJabberProto::SerialNext(void)
///////////////////////////////////////////////////////////////////////////////
// JabberChatRoomHContactFromJID - looks for the char room HCONTACT with required JID
-HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
+HCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
{
if (jid == NULL)
return NULL;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT dbJid( getTStringA(hContact, "ChatRoomID"));
if (dbJid == NULL)
if ((dbJid = getTStringA(hContact, "jid")) == NULL)
@@ -55,14 +55,14 @@ HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
///////////////////////////////////////////////////////////////////////////////
// JabberHContactFromJID - looks for the HCONTACT with required JID
-HANDLE CJabberProto::HContactFromJID(const TCHAR *jid , BOOL bStripResource)
+HCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, BOOL bStripResource)
{
if (jid == NULL)
return NULL;
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
bool bIsChat = isChatRoom(hContact);
ptrT dbJid( getTStringA(hContact, bIsChat ? "ChatRoomID" : "jid"));
@@ -513,7 +513,7 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible)
if (item == NULL)
continue;
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT 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(HANDLE hContact, TCHAR *dest, size_t destLen)
+TCHAR* CJabberProto::GetClientJID(HCONTACT 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) {
- HANDLE hContact = ppro->HContactFromJID(item->jid);
+ HCONTACT 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 4f8eb9c674..28d8b2a416 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)
{
- HANDLE hContact = NULL, hSelfContact = NULL;
+ HCONTACT 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(HANDLE hContact)
+void CPepMood::ResetExtraIcon(HCONTACT hContact)
{
char *szMood = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_MOOD, "id");
SetExtraIcon(hContact, szMood);
mir_free(szMood);
}
-void CPepMood::SetExtraIcon(HANDLE hContact, char *szMood)
+void CPepMood::SetExtraIcon(HCONTACT hContact, char *szMood)
{
ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibHandle(szMood));
}
-void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText)
+void CPepMood::SetMood(HCONTACT 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)
{
- HANDLE hContact = NULL, hSelfContact = NULL;
+ HCONTACT 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(HANDLE hContact)
+void CPepActivity::ResetExtraIcon(HCONTACT hContact)
{
char *szActivity = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_ACTIVITY, "id");
SetExtraIcon(hContact, szActivity);
mir_free(szActivity);
}
-void CPepActivity::SetExtraIcon(HANDLE hContact, char *szActivity)
+void CPepActivity::SetExtraIcon(HCONTACT hContact, char *szActivity)
{
ExtraIcon_SetIcon(hExtraActivity, hContact, szActivity == NULL ? NULL : g_ActivityIcons.GetIcolibHandle(szActivity));
}
-void CPepActivity::SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText)
+void CPepActivity::SetActivity(HCONTACT 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(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack)
+void CJabberProto::SetContactTune(HCONTACT 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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(HANDLE hContact, const char *pszSlot)
+void CJabberProto::ResetAdvStatus(HCONTACT 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(HANDLE hContact, const char *pszSlot)
db_unset(hContact, "AdvStatus", szSetting);
}
-void CJabberProto::WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText)
+void CJabberProto::WriteAdvStatus(HCONTACT 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(HANDLE hContact, const char *pszSlot, const TC
}
}
-char* CJabberProto::ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue)
+char* CJabberProto::ReadAdvStatusA(HCONTACT 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(HANDLE hContact, const char *pszSlot, const char *pszValue)
+TCHAR* CJabberProto::ReadAdvStatusT(HCONTACT 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 6caa4117b4..f0ebf5429a 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(HANDLE /*hContact*/) {}
+ virtual void ResetExtraIcon(HCONTACT) {}
virtual bool LaunchSetGui() { return false; }
protected:
@@ -88,7 +88,7 @@ public:
(*this)[i].RebuildMenu();
}
- void ResetExtraIcon(HANDLE hContact)
+ void ResetExtraIcon(HCONTACT 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(HANDLE hContact);
+ void ResetExtraIcon(HCONTACT hContact);
public:
TCHAR *m_text;
@@ -161,9 +161,9 @@ public:
protected:
void CreateData(HXML);
void ShowSetDialog(BYTE bQuiet);
- void SetExtraIcon(HANDLE hContact, char *szMood);
+ void SetExtraIcon(HCONTACT hContact, char *szMood);
- void SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText);
+ void SetMood(HCONTACT 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(HANDLE hContact);
+ void ResetExtraIcon(HCONTACT hContact);
protected:
TCHAR *m_text;
@@ -181,9 +181,9 @@ protected:
void CreateData(HXML);
void ShowSetDialog(BYTE bQuiet);
- void SetExtraIcon(HANDLE hContact, char *szActivity);
+ void SetExtraIcon(HCONTACT hContact, char *szActivity);
- void SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText);
+ void SetActivity(HCONTACT 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 1005903432..d48e881578 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(HANDLE hContact)
+void CCtrlClc::AddContact(HCONTACT 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(HANDLE hContact)
+HANDLE CCtrlClc::FindContact(HCONTACT 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 50de45fa73..7e0b4792ad 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(HANDLE hContact);
+ void AddContact(HCONTACT 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(HANDLE hContact);
+ HANDLE FindContact(HCONTACT 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 ae925a8471..59063cbba3 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(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
-bool DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+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_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret);
-bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret);
+bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret);
+bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret);
-bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value);
-bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value);
+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_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+bool DB_GetContactSettingBlob(HCONTACT 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(HANDLE hContact);
+bool IsContactMraProto(HCONTACT hContact);
bool IsEMailMR(const CMStringA& szEmail);
bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail);
bool IsPhone(LPSTR lpszString, size_t dwStringSize);
-bool IsContactPhone(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize);
+bool IsContactPhone(HCONTACT 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(HANDLE hContact);
+bool MraSendReplyBlogStatus(HCONTACT 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 3439efd420..9ae3ee41dc 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;
- HANDLE hContact;
+ HCONTACT 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, HANDLE hContact, DWORD *pdwAvatarsQueueID)
+DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT 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(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
+bool CMraProto::MraAvatarsGetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
if (lpszValueName && pstTime) {
INTERNET_TIME itAvatarLastModifiedTimeLocal;
@@ -468,7 +468,7 @@ bool CMraProto::MraAvatarsGetContactTime(HANDLE hContact, LPSTR lpszValueName, S
}
-void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
+void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
if (!lpszValueName)
return;
@@ -486,7 +486,7 @@ void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, S
delSetting(hContact, lpszValueName);
}
-DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, CMStringW &res)
+DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res)
{
res.Empty();
if (hAvatarsQueueHandle == NULL)
@@ -523,7 +523,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hConta
return ERROR_INSUFFICIENT_BUFFER;
}
-DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath)
+DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT 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, HANDLE hContact, DWORD dwSourceID)
+DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT 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, HANDLE hContact)
+DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HCONTACT hContact)
{
if (hAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index c6363029ad..7cf8571652 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(HANDLE hContact)
+INT_PTR CMraProto::MraChatSessionNew(HCONTACT hContact)
{
if (bChatExists)
if (hContact) {
@@ -63,7 +63,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
return 1;
}
-void CMraProto::MraChatSessionDestroy(HANDLE hContact)
+void CMraProto::MraChatSessionDestroy(HCONTACT hContact)
{
if (!bChatExists || hContact == NULL)
return;
@@ -79,7 +79,7 @@ void CMraProto::MraChatSessionDestroy(HANDLE hContact)
CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
}
-INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
{
if (!bChatExists)
return 1;
@@ -122,7 +122,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, D
return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
-INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (!hContactChatSession)
return 1;
@@ -132,7 +132,7 @@ INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, const CMStri
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
-INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (!hContactChatSession)
return 1;
@@ -142,7 +142,7 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, const CM
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
-INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionJoinUser(HCONTACT 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(HANDLE hContactChatSession, const CMSt
return 1;
}
-INT_PTR CMraProto::MraChatSessionLeftUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionLeftUser(HCONTACT 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(HANDLE hContactChatSession, const CMSt
return 1;
}
-INT_PTR CMraProto::MraChatSessionSetIviter(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat)
+INT_PTR CMraProto::MraChatSessionSetIviter(HCONTACT 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(HANDLE hContactChatSession, const CMS
return 1;
}
-INT_PTR CMraProto::MraChatSessionSetOwner(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat)
+INT_PTR CMraProto::MraChatSessionSetOwner(HCONTACT 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(HANDLE hContactChatSession, const CMSt
}
-INT_PTR CMraProto::MraChatSessionMessageAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMessageAdd(HCONTACT 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;
- HANDLE hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
+ HCONTACT 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;
- HANDLE hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded);
+ HCONTACT 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 f4cb2918ee..3f4ec7213f 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;
- HANDLE hContact;
+ HCONTACT 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, HANDLE hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses)
+DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT 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, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest)
+DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT 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 d0f219200d..29da89b58f 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(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage)
+void CMraProto::MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage)
{
WCHAR szTitle[MAX_CONTACTNAME];
CMStringW szNick, szEmail;
@@ -212,7 +212,7 @@ void CMraProto::MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dw
MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage);
}
-void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage)
+void CMraProto::MraPopupShowW(HCONTACT 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 2c9deba976..a8686a95ee 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT 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
@@ -132,7 +132,7 @@ HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR
return NULL;
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded);
if (hContact == NULL)
return NULL;
@@ -186,9 +186,9 @@ HANDLE 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(HANDLE, int, PROTORECVEVENT*) { return 1; }
-int CMraProto::RecvUrl(HANDLE, PROTORECVEVENT*) { return 1; }
-int CMraProto::SendUrl(HANDLE, int, const char*) { 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; }
/////////////////////////////////////////////////////////////////////////////////////////
@@ -234,20 +234,20 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason)
return 0;
}
-int CMraProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int CMraProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
{
Proto_AuthRecv(m_szModuleName, pre);
return 0;
}
-int CMraProto::AuthRequest(HANDLE hContact, const TCHAR *lptszMessage)
+int CMraProto::AuthRequest(HCONTACT hContact, const TCHAR *lptszMessage)
{
return 1;
}
/////////////////////////////////////////////////////////////////////////////////////////
-HANDLE CMraProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CMraProto::FileAllow(HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPa
return NULL;
}
-int CMraProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
if (hContact && hTransfer) {
MraFilesQueueCancel(hFilesQueueHandle, (DWORD)hTransfer, TRUE);
@@ -266,14 +266,14 @@ int CMraProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
return 1;
}
-int CMraProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR*)
+int CMraProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR*)
{
return FileCancel(hContact, hTransfer);
}
/////////////////////////////////////////////////////////////////////////////////////////
-DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact)
+DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact)
{
switch ( type ) {
case PFLAGNUM_1:
@@ -310,7 +310,7 @@ DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact)
}
}
-int CMraProto::GetInfo(HANDLE hContact, int infoType)
+int CMraProto::GetInfo(HCONTACT hContact, int infoType)
{
return MraUpdateContactInfo(hContact) != 0;
}
@@ -347,7 +347,7 @@ HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName,
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
+int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
@@ -360,19 +360,19 @@ int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
return 0;
}
-int CMraProto::RecvFile(HANDLE hContact, PROTORECVFILET *pre)
+int CMraProto::RecvFile(HCONTACT hContact, PROTORECVFILET *pre)
{
return Proto_RecvFile(hContact, pre);
}
-int CMraProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int CMraProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
return Proto_RecvMessage(hContact, pre);
}
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
INT_PTR iRet = 0;
@@ -398,7 +398,7 @@ int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* h
return iRet;
}
-HANDLE CMraProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
{
INT_PTR iRet = 0;
@@ -410,7 +410,7 @@ HANDLE CMraProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR**
return (HANDLE)iRet;
}
-int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage)
+int CMraProto::SendMsg(HCONTACT 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(HANDLE hContact, int flags, const char *lpszMessage)
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::SetApparentMode(HANDLE hContact, int mode)
+int CMraProto::SetApparentMode(HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
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(HANDLE hContact)
+HANDLE CMraProto::GetAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int CMraProto::UserIsTyping(HCONTACT 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 c7082bd23f..d0a73ab7af 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -42,19 +42,19 @@ struct CMraProto : public PROTO<CMraProto>
virtual HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
virtual int __cdecl Authorize(HANDLE hDBEvent);
- virtual int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage);
+ 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 HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason);
+ 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 int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
@@ -62,56 +62,56 @@ struct CMraProto : public PROTO<CMraProto>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTORECVFILET*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode);
- void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
- void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage);
+ void MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
+ void MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage);
__forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) {
MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); }
- __forceinline bool mraGetStaticStringA(HANDLE Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ __forceinline bool mraGetStaticStringA(HCONTACT 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(HANDLE Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ __forceinline bool mraGetStaticStringW(HCONTACT 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(HANDLE Contact, const char *ValueName, CMStringA &Ret) {
+ __forceinline bool mraGetStringA(HCONTACT Contact, const char *ValueName, CMStringA &Ret) {
return DB_GetStringA(Contact, m_szModuleName, ValueName, Ret); }
- __forceinline bool mraGetStringW(HANDLE Contact, const char *ValueName, CMStringW &Ret) {
+ __forceinline bool mraGetStringW(HCONTACT Contact, const char *ValueName, CMStringW &Ret) {
return DB_GetStringW(Contact, m_szModuleName, ValueName, Ret); }
- __forceinline bool mraSetStringA(HANDLE Contact, const char *valueName, const CMStringA &parValue) {
+ __forceinline bool mraSetStringA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringW(HANDLE Contact, const char *valueName, const CMStringW &parValue) {
+ __forceinline bool mraSetStringW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) {
return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringExA(HANDLE Contact, const char *valueName, const CMStringA &parValue) {
+ __forceinline bool mraSetStringExA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringExW(HANDLE Contact, const char *valueName, const CMStringW &parValue) {
+ __forceinline bool mraSetStringExW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) {
return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraWriteContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
+ __forceinline bool mraWriteContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize) != 0; }
- __forceinline bool mraGetContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) {
+ __forceinline bool mraGetContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) {
return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); }
// ====| Services |====================================================================
@@ -198,54 +198,54 @@ struct CMraProto : public PROTO<CMraProto>
HANDLE AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
- DWORD MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
+ DWORD MraMessage(BOOL bAddToQueue, HCONTACT 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(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0);
- DWORD MraModifyContact(HANDLE hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0);
+ 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 MraOfflineMessageDel(DWORDLONG dwMsgUIDL);
- DWORD MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszGroup);
+ DWORD MraMoveContactToGroup(HCONTACT 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(HANDLE 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(HANDLE hContact, DWORD dwAckType, CMStringA &szEmail);
+ 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);
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(HANDLE hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage);
+ DWORD MraSMSW(HCONTACT 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, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, 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 MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc);
- void MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList);
+ void MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList);
- DWORD GetContactFlags(HANDLE hContact);
- DWORD SetContactFlags(HANDLE hContact, DWORD dwContactFlag);
- DWORD GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones);
- DWORD SetContactBasicInfoW(HANDLE 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(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 GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly);
- bool GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA &szRetBuff);
+ DWORD GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly);
+ bool GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff);
- bool IsContactMra(HANDLE hContact);
+ bool IsContactMra(HCONTACT hContact);
bool IsEMailMy(const CMStringA &szEmail);
bool IsEMailChatAgent(const CMStringA &szEmail);
- bool IsContactChatAgent(HANDLE hContact);
+ bool IsContactChatAgent(HCONTACT hContact);
- HANDLE MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
- bool MraUpdateContactInfo(HANDLE hContact);
+ HCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
+ bool MraUpdateContactInfo(HCONTACT hContact);
DWORD MraSetXStatusInternal(DWORD dwXStatus);
- DWORD MraGetContactStatus(HANDLE hContact);
- DWORD MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus);
- DWORD MraContactCapabilitiesGet(HANDLE hContact);
- void MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags);
+ DWORD MraGetContactStatus(HCONTACT hContact);
+ DWORD MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus);
+ DWORD MraContactCapabilitiesGet(HCONTACT hContact);
+ void MraContactCapabilitiesSet(HCONTACT 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<CMraProto>
DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &plpsFrom, CMStringA &plpsText, CMStringA &plpsRFTText, CMStringA &plpsMultiChatData);
- void SetExtraIcons(HANDLE hContact);
+ void SetExtraIcons(HCONTACT hContact);
void InitMenus(void);
HGENMENU CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult);
- DWORD ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
- CMStringA CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason);
+ DWORD ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
+ CMStringA CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason);
bool GetPassDB(CMStringA& pass);
bool MraRequestXStatusDetails(DWORD dwXStatus);
- bool MraSendReplyBlogStatus(HANDLE hContact);
- DWORD MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType);
+ bool MraSendReplyBlogStatus(HCONTACT hContact);
+ DWORD MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType);
DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection);
@@ -300,8 +300,8 @@ struct CMraProto : public PROTO<CMraProto>
void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue);
size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort);
- DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses);
- DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest);
+ 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 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<CMraProto>
bool bChatExists;
void MraChatDllError();
bool MraChatRegister();
- INT_PTR MraChatSessionNew(HANDLE hContactChatSession);
- void MraChatSessionDestroy(HANDLE hContactChatSession);
+ INT_PTR MraChatSessionNew(HCONTACT hContactChatSession);
+ void MraChatSessionDestroy(HCONTACT hContactChatSession);
void MraChatSendPrivateMessage(LPSTR lpwszEMail);
- INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime);
- INT_PTR MraChatSessionInvite(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat);
- INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat);
- INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &wszMessage, DWORD dwTime);
+ 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);
DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle);
void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle);
void MraAvatarsQueueSuspend(HANDLE hAvatarsQueueHandle);
void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle);
- DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID);
- bool MraAvatarsGetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
- void MraAvatarsSetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
- DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, CMStringW &res);
- DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath);
- DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID);
- DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact);
+ 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);
void __cdecl MraAvatarsThreadProc(LPVOID lpParameter);
};
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp
index 6081d902c0..fc889d5058 100644
--- a/protocols/MRA/src/MraSelectEMail.cpp
+++ b/protocols/MRA/src/MraSelectEMail.cpp
@@ -4,11 +4,11 @@
struct MraSelectEMailDlgData
{
CMraProto *ppro;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwType;
};
-void AddContactEMailToListParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
+void AddContactEMailToListParam(HCONTACT 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(HANDLE hContact, DWORD dwType)
+DWORD CMraProto::MraSelectEMailDlgShow(HCONTACT 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 74ab849a29..e673e2e4b8 100644
--- a/protocols/MRA/src/MraSendCommand.cpp
+++ b/protocols/MRA/src/MraSendCommand.cpp
@@ -71,7 +71,7 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
-DWORD CMraProto::MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
+DWORD CMraProto::MraMessage(BOOL bAddToQueue, HCONTACT 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(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage)
+DWORD CMraProto::MraAddContact(HCONTACT 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(HANDLE hContact, DWORD dwContactFlag, DWORD dwGro
}
// change contact
-DWORD CMraProto::MraModifyContact(HANDLE hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones)
+DWORD CMraProto::MraModifyContact(HCONTACT 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(HANDLE 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(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)
{
OutBuffer buf;
CMStringA tmp;
@@ -381,7 +381,7 @@ HANDLE CMraProto::MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwReques
}
// Ïîèñê êîíòàêòà ïî EMail
-HANDLE CMraProto::MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, CMStringA &szEmail)
+HANDLE CMraProto::MraWPRequestByEMail(HCONTACT 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(HANDLE hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage)
+DWORD CMraProto::MraSMSW(HCONTACT 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, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, 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 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 496468c646..08146fe8b2 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;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwAckType;
LPBYTE lpbData;
size_t dwDataSize;
@@ -59,7 +59,7 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle)
}
-DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize)
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT 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, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HCONTACT *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, HANDLE *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)
{
if (!hSendQueueHandle)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraSendQueue.h b/protocols/MRA/src/MraSendQueue.h
index 1115c4f815..e75038cfd9 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, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize);
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize);
DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum);
-DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
-DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
+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);
#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 2ba7335d8a..5864886814 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;
- HANDLE hContact;
+ HCONTACT hContact;
};
#define RECURSION_DATA_STACK_ITEMS_MIN 128
@@ -157,7 +157,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList)
return res;
}
-void CMraProto::MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList)
+void CMraProto::MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList)
{
if (!hContact || !pmalAddrList)
return;
@@ -181,7 +181,7 @@ void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList)
}
}
-bool DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetStaticStringA(HCONTACT 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(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
}
// sizes in wchars
-bool DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetStaticStringW(HCONTACT 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(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
return bRet;
}
-bool DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res)
+bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res)
{
char *szRes = db_get_sa(hContact, lpszModule, lpszValueName);
if (szRes) {
@@ -249,7 +249,7 @@ bool DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMS
}
-bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res)
+bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res)
{
WCHAR *szRes = db_get_wsa(hContact, lpszModule, lpszValueName);
if (szRes) {
@@ -262,7 +262,7 @@ bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMS
return false;
}
-bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue)
+bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue)
{
if (szValue.IsEmpty()) {
db_unset(hContact, lpszModule, lpszValueName);
@@ -272,7 +272,7 @@ bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, c
return db_set_s(hContact, lpszModule, lpszValueName, szValue) != 0;
}
-bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue)
+bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue)
{
if (szValue.IsEmpty()) {
db_unset(hContact, lpszModule, lpszValueName);
@@ -282,7 +282,7 @@ bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, c
return db_set_ws(hContact, lpszModule, lpszValueName, szValue) != 0;
}
-bool DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetContactSettingBlob(HCONTACT 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(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszVal
return bRet;
}
-DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszName)
+DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName)
{
MraGroupItem *p = NULL;
@@ -335,7 +335,7 @@ DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR
return p->m_id;
}
-DWORD CMraProto::GetContactFlags(HANDLE hContact)
+DWORD CMraProto::GetContactFlags(HCONTACT hContact)
{
DWORD dwRet = 0;
@@ -366,7 +366,7 @@ DWORD CMraProto::GetContactFlags(HANDLE hContact)
return(dwRet);
}
-DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
+DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag)
{
if (!IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
@@ -398,7 +398,7 @@ DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
return 0;
}
-DWORD CMraProto::GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones)
+DWORD CMraProto::GetContactBasicInfoW(HCONTACT 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(HANDLE hContact, DWORD *pdwID, DWORD *pdwG
return 0;
}
-DWORD CMraProto::SetContactBasicInfoW(HANDLE 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(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)
{
if (!IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
@@ -496,12 +496,12 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO
return 0;
}
-HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded)
+HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded)
{
if (szEmail.IsEmpty())
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
bool bFound = false;
//check not already on list
@@ -541,7 +541,7 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed
}
}
else {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
}
@@ -563,7 +563,7 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed
return hContact;
}
-bool CMraProto::MraUpdateContactInfo(HANDLE hContact)
+bool CMraProto::MraUpdateContactInfo(HCONTACT hContact)
{
if (m_bLoggedIn && hContact)
if (IsContactMra(hContact)) {
@@ -577,22 +577,22 @@ bool CMraProto::MraUpdateContactInfo(HANDLE hContact)
return false;
}
-DWORD CMraProto::MraContactCapabilitiesGet(HANDLE hContact)
+DWORD CMraProto::MraContactCapabilitiesGet(HCONTACT hContact)
{
return getDword(hContact, DBSETTING_CAPABILITIES, 0);
}
-void CMraProto::MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags)
+void CMraProto::MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags)
{
setDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags);
}
-DWORD CMraProto::MraGetContactStatus(HANDLE hContact)
+DWORD CMraProto::MraGetContactStatus(HCONTACT hContact)
{
return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
-DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus)
+DWORD CMraProto::MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus)
{
DWORD dwOldStatus = MraGetContactStatus(hContact);
@@ -641,7 +641,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
if (m_dwEmailMessagesUnread) {
CMStringA szEmail;
- HANDLE hContact = NULL;
+ HCONTACT 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(HANDLE hContact)
+bool CMraProto::IsContactMra(HCONTACT hContact)
{
return CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0;
}
// îïðåäåëÿåòñÿ ÿâëÿåòñÿ ëè êîíòàêò êîíòàêòîì MRA ïðîòîêîëà, íå çàâèñèìî îò òîãî êàêîìó ïëàãèíó îí ïðèíàäëåæèò
-bool IsContactMraProto(HANDLE hContact)
+bool IsContactMraProto(HCONTACT hContact)
{
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
@@ -751,7 +751,7 @@ bool CMraProto::IsEMailChatAgent(const CMStringA &szEmail)
return false;
}
-bool CMraProto::IsContactChatAgent(HANDLE hContact)
+bool CMraProto::IsContactChatAgent(HCONTACT hContact)
{
if (hContact == NULL)
return false;
@@ -791,7 +791,7 @@ bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail)
return false;
}
-DWORD GetContactEMailCountParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName)
+DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName)
{
DWORD dwRet = 0;
CMStringA szEmail;
@@ -815,7 +815,7 @@ DWORD GetContactEMailCountParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule
return dwRet;
}
-DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly)
+DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly)
{
LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName;
@@ -828,7 +828,7 @@ DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly)
return dwRet;
}
-bool GetContactFirstEMailParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res)
+bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res)
{
CMStringA szEmail;
@@ -853,7 +853,7 @@ bool GetContactFirstEMailParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule,
return false;
}
-bool CMraProto::GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA &res)
+bool CMraProto::GetContactFirstEMail(HCONTACT 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(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam)
+DWORD CMraProto::ProtoBroadcastAckAsync(HCONTACT 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(HANDLE hContact, int type, int hResult,
return 0;
}
-CMStringA CMraProto::CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason)
+CMStringA CMraProto::CreateBlobFromContact(HCONTACT 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(HANDLE hContact)
+bool CMraProto::MraSendReplyBlogStatus(HCONTACT 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 2e92363a74..ba91e2e660 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wParam, "e-mail", szEmail))
+ if (mraGetStringA((HCONTACT)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((HANDLE)wParam, FALSE);
+ DWORD dwContactEMailCount = GetContactEMailCount((HCONTACT)wParam, FALSE);
if (dwContactEMailCount) {
if (dwContactEMailCount == 1) {
CMStringA szUrl, szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, FALSE, szEmail)) {
+ if (GetContactFirstEMail((HCONTACT)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((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
+ else MraSelectEMailDlgShow((HCONTACT)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((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_FOTO_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
+ else MraSelectEMailDlgShow((HCONTACT)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((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount)
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG);
+ else MraSelectEMailDlgShow((HCONTACT)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((HANDLE)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg);
+ mraGetStringW((HCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg);
if (!blogStatusMsg.IsEmpty() || wParam == 0)
- MraSendReplyBlogStatus((HANDLE)wParam);
+ MraSendReplyBlogStatus((HCONTACT)wParam);
return 0;
}
@@ -188,14 +188,14 @@ INT_PTR CMraProto::MraViewVideo(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_VIDEO_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
+ else MraSelectEMailDlgShow((HCONTACT)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((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_ANSWERS_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS);
+ else MraSelectEMailDlgShow((HCONTACT)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((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_WORLD_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_WORLD);
+ else MraSelectEMailDlgShow((HCONTACT)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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// proto own contact
bIsContactMRA = IsContactMra(hContact);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 91f9578d44..73270f7d9e 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;
- HANDLE hContact;
+ HCONTACT 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();
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
if (bAdded)
MraUpdateContactInfo(hContact);
@@ -613,7 +613,7 @@ bool CMraProto::CmdFileTransfer(BinBuffer &buf)
}
BOOL bAdded = FALSE;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
+ HCONTACT 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 (HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) {
+ if (HCONTACT 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; HANDLE hContact; LPBYTE pData; size_t dataLen;
+ DWORD dwAckType; HCONTACT 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; HANDLE hContact; LPBYTE pData; size_t dataLen;
+ DWORD dwAckType, dwFlags; HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded);
+ HCONTACT 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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 (HANDLE hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) {
+ if (HCONTACT 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;
- HANDLE hContact = NULL;
+ HCONTACT 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;
- HANDLE hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded);
+ HCONTACT 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 50f8923fbd..16efbc3467 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(HANDLE hContact)
+void CMraProto::SetExtraIcons(HCONTACT 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!m_bLoggedIn || !hContact)
return 0;
@@ -191,7 +191,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn || !lParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wParam);
+ SetExtraIcons((HCONTACT)wParam);
return 0;
}
@@ -449,7 +449,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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);
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 45abcf490c..ae8ca277cb 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(HANDLE hContact, LPCSTR pszUrl)
+void CMsnProto::pushAvatarRequest(HCONTACT 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 55c9ae5cd3..76688d5235 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 <http://www.gnu.org/licenses/>.
#include "msn_proto.h"
#include <m_history.h>
-HANDLE CMsnProto::MSN_GetChatInernalHandle(HANDLE hContact)
+HCONTACT CMsnProto::MSN_GetChatInernalHandle(HCONTACT hContact)
{
- HANDLE result = hContact;
+ HCONTACT result = hContact;
if ( isChatRoom(hContact)) {
DBVARIANT dbv;
if (getString(hContact, "ChatRoomID", &dbv) == 0) {
- result = (HANDLE)(-atol(dbv.pszVal));
+ result = (HCONTACT)(-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++)
{
- HANDLE hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]);
+ HCONTACT hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]);
TCHAR *wlid = mir_a2t(info->mJoinedContactsWLID[j]);
gce.ptszNick = GetContactNameT(hContact);
@@ -159,7 +159,7 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto
}
else
{
- MsnContact *msc = ppro->Lists_Get(hItem);
+ MsnContact *msc = ppro->Lists_Get((LPCSTR)hItem);
if (msc) str.insertn(msc->email);
}
}
@@ -169,25 +169,25 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto
}
-static void ChatValidateContact(HANDLE hItem, HWND hwndList, CMsnProto* ppro)
+static void ChatValidateContact(HCONTACT 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(HANDLE hItem, HWND hwndList, CMsnProto* ppro)
+static void ChatPrepare(HCONTACT hItem, HWND hwndList, CMsnProto* ppro)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem)
{
- HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) ChatPrepare(hItemT, hwndList, ppro);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ ChatPrepare(hItemT, hwndList, ppro);
}
else if (IsHContactContact(hItem))
ChatValidateContact(hItem, hwndList, ppro);
@@ -198,7 +198,7 @@ static void ChatPrepare(HANDLE hItem, HWND hwndList, CMsnProto* ppro)
INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- InviteChatParam* param = (InviteChatParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ InviteChatParam *param = (InviteChatParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
@@ -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(nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
+ ChatValidateContact((HCONTACT)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);
- HANDLE hContact = MSN_HContactFromEmail(email);
+ HCONTACT 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);
- HANDLE hContact = MSN_HContactFromEmail(email);
+ HCONTACT 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 9701adc096..9cdce62c55 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(HANDLE hContact, DWORD dwValue, bool always)
+void CMsnProto::sttSetMirVer(HCONTACT hContact, DWORD dwValue, bool always)
{
static const char* MirVerStr[] =
{
@@ -117,8 +117,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c
if (AppGUID != NULL) {
if (!strcmp(AppGUID, "{02D3C01F-BF30-4825-A83A-DE7AF41648AA}")) {
MSN_ShowPopup(info->getContactHandle(),
- TranslateT("Contact tried to open an audio conference (not currently supported)"),
- MSN_ALLOW_MSGBOX);
+ TranslateT("Contact tried to open an audio conference (not currently supported)"), MSN_ALLOW_MSGBOX);
return;
}
}
@@ -254,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)
{
- HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
+ HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
char smileyList[500] = "";
@@ -390,7 +389,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
tFileInfo.readFromBuffer(msgBody);
info->firstMsgRecv = true;
- HANDLE hContact = MSN_HContactFromEmail(email);
+ HCONTACT hContact = MSN_HContactFromEmail(email);
const char* mirver = tFileInfo["Client-Name"];
if (hContact != NULL && mirver != NULL) {
setString(hContact, "MirVer", mirver);
@@ -405,7 +404,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
}
if (!_strnicmp(tContentType, "text/plain", 10)) {
- HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
+ HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
const char* p = tHeader["X-MMS-IM-Format"];
bool isRtl = p != NULL && strstr(p, "RL=1") != NULL;
@@ -491,7 +490,7 @@ 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)) {
- HANDLE hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
+ HCONTACT hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, 7);
}
}
@@ -501,7 +500,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (info->mChatID[0]) {
GC_INFO gci = { 0 };
- gci.Flags = HCONTACT;
+ gci.Flags = GCF_HCONTACT;
gci.pszModule = m_szModuleName;
gci.pszID = info->mChatID;
CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci);
@@ -603,7 +602,7 @@ void CMsnProto::sttProcessYFind(char* buf, size_t len)
else {
if (szNetId != NULL) {
int netId = atol(szNetId);
- HANDLE hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
+ HCONTACT 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);
@@ -641,7 +640,7 @@ void CMsnProto::sttProcessAdd(char* buf, size_t len)
UrlDecode((char*)szNick);
if (listId == LIST_FL) {
- HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick, true, false);
+ HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick, true, false);
MSN_SetContactDb(hContact, szEmail);
}
@@ -707,7 +706,7 @@ void CMsnProto::sttProcessRemove(char* buf, size_t len)
void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wlid)
{
- HANDLE hContact = MSN_HContactFromEmail(wlid);
+ HCONTACT hContact = MSN_HContactFromEmail(wlid);
if (hContact == NULL) return;
ezxml_t xmli = ezxml_parse_str(buf, len);
@@ -1049,12 +1048,12 @@ LBL_InvalidCommand:
if (strchr(data.userEmail, ';')) {
if (info->mJoinedContactsWLID.getCount() == 1)
- p2p_clearThreadSessions(info->mJoinedContactsWLID[0], info->mType);
+ p2p_clearThreadSessions((HCONTACT)info->mJoinedContactsWLID[0], info->mType);
info->contactLeft(data.userEmail);
break;
}
- HANDLE hContact = MSN_HContactFromEmail(data.userEmail);
+ HCONTACT hContact = MSN_HContactFromEmail(data.userEmail);
if (getByte("EnableSessionPopup", 0))
MSN_ShowPopup(hContact, TranslateT("Contact left channel"), 0);
@@ -1099,7 +1098,7 @@ LBL_InvalidCommand:
MSN_KillChatSession(info->mChatID);
// open up srmm dialog when quit while 1 person left
- HANDLE hContact = info->getContactHandle();
+ HCONTACT hContact = info->getContactHandle();
if (hContact) CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
}
}
@@ -1163,7 +1162,7 @@ LBL_InvalidCommand:
if (tArgs < 2)
goto LBL_InvalidCommand;
- HANDLE hContact = MSN_HContactFromEmail(data.userEmail);
+ HCONTACT 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);
@@ -1204,7 +1203,7 @@ LBL_InvalidCommand:
MsnContact *cont = Lists_Get(szEmail);
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
if (!cont && !isMe) {
hContact = MSN_HContactFromEmail(data.wlid, data.userNick, true, true);
cont = Lists_Get(szEmail);
@@ -1294,7 +1293,7 @@ remove:
if (!strchr(data.userEmail, ';')) {
UrlDecode(data.userNick);
- HANDLE hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
+ HCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
if (tNumTokens == 5 && strcmp(data.flags, "0:0")) {
MsnContact *cont = Lists_Get(data.userEmail);
@@ -1386,7 +1385,7 @@ remove:
stripBBCode(data.userNick);
stripColorCode(data.userNick);
- HANDLE hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
+ HCONTACT 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 3412165ef1..1fdef99e6b 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 <http://www.gnu.org/licenses/>.
#include "msn_global.h"
#include "msn_proto.h"
-HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
+HCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
char* szEmail;
parseWLID(NEWSTR_ALLOCA(wlid), NULL, &szEmail, NULL);
@@ -33,9 +33,8 @@ HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, b
MsnContact *msc = Lists_Get(szEmail);
if (msc && msc->hContact) hContact = msc->hContact;
- if (hContact == NULL && addIfNeeded)
- {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ if (hContact == NULL && addIfNeeded) {
+ hContact = (HCONTACT)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);
@@ -49,7 +48,7 @@ HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, b
}
-void CMsnProto::MSN_SetContactDb(HANDLE hContact, const char *szEmail)
+void CMsnProto::MSN_SetContactDb(HCONTACT hContact, const char *szEmail)
{
MsnContact *cont = Lists_Get(szEmail);
const int listId = cont->list;
@@ -120,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(HANDLE hContact, const char* email, int netId, int flags, const char *msg)
+bool CMsnProto::MSN_AddUser(HCONTACT 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 9c97843e95..fac52f59d7 100644
--- a/protocols/MSN/src/msn_global.h
+++ b/protocols/MSN/src/msn_global.h
@@ -167,7 +167,7 @@ template <class chartype> void UrlDecode(chartype* str);
void __cdecl MSN_ConnectionProc(HANDLE hNewConnection, DWORD dwRemoteIP, void*);
char* MSN_GetAvatarHash(char* szContext, char** pszUrl = NULL);
-bool MSN_MsgWndExist(HANDLE hContact);
+bool MSN_MsgWndExist(HCONTACT hContact);
#define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a))
@@ -478,71 +478,71 @@ typedef void (__cdecl CMsnProto::*MsnThreadFunc)(void*);
struct ThreadData
{
- ThreadData();
- ~ThreadData();
-
- STRLIST mJoinedContactsWLID;
- STRLIST mJoinedIdentContactsWLID;
- char* mInitialContactWLID;
-
- TInfoType mType; // thread type
- MsnThreadFunc mFunc; // thread entry point
- char mServer[80]; // server name
-
- HANDLE s; // NetLib connection for the thread
- HANDLE mIncomingBoundPort; // Netlib listen for the thread
- HANDLE hWaitEvent;
- WORD mIncomingPort;
- TCHAR mChatID[10];
- bool mIsMainThread;
- clock_t mWaitPeriod;
-
- CMsnProto* proto;
-
- //----| for gateways |----------------------------------------------------------------
- char mSessionID[50]; // Gateway session ID
- char mGatewayIP[80]; // Gateway IP address
- int mGatewayTimeout;
- bool sessionClosed;
- bool termPending;
- bool gatewayType;
-
- //----| for switchboard servers only |------------------------------------------------
- bool firstMsgRecv;
- int mCaller;
- char mCookie[130]; // for switchboard servers only
- LONG mTrid; // current message ID
- UINT mTimerId; // typing notifications timer id
-
- //----| for file transfers only |-----------------------------------------------------
- filetransfer* mMsnFtp; // file transfer block
- bool mBridgeInit;
-
- //----| internal data buffer |--------------------------------------------------------
- int mBytesInData; // bytes available in data buffer
- char mData[8192]; // data buffer for connection
-
- //----| methods |---------------------------------------------------------------------
- void applyGatewayData(HANDLE hConn, bool isPoll);
- void getGatewayUrl(char* dest, int destlen, bool isPoll);
- void processSessionData(const char* xMsgr, const char* xHost);
- void startThread(MsnThreadFunc , CMsnProto *prt);
-
- int send(const char data[], size_t datalen);
- int recv(char* data, size_t datalen);
-
- void resetTimeout(bool term = false);
- bool isTimeout(void);
-
- void sendTerminate(void);
- void sendCaps(void);
- int sendMessage(int msgType, const char* email, int netId, const char* msg, int parFlags);
- int sendRawMessage(int msgType, const char* data, int datLen);
- int sendPacket(const char* cmd, const char* fmt, ...);
-
- int contactJoined(const char* email);
- int contactLeft(const char* email);
- HANDLE getContactHandle(void);
+ ThreadData();
+ ~ThreadData();
+
+ STRLIST mJoinedContactsWLID;
+ STRLIST mJoinedIdentContactsWLID;
+ char* mInitialContactWLID;
+
+ TInfoType mType; // thread type
+ MsnThreadFunc mFunc; // thread entry point
+ char mServer[80]; // server name
+
+ HANDLE s; // NetLib connection for the thread
+ HANDLE mIncomingBoundPort; // Netlib listen for the thread
+ HANDLE hWaitEvent;
+ WORD mIncomingPort;
+ TCHAR mChatID[10];
+ bool mIsMainThread;
+ clock_t mWaitPeriod;
+
+ CMsnProto* proto;
+
+ //----| for gateways |----------------------------------------------------------------
+ char mSessionID[50]; // Gateway session ID
+ char mGatewayIP[80]; // Gateway IP address
+ int mGatewayTimeout;
+ bool sessionClosed;
+ bool termPending;
+ bool gatewayType;
+
+ //----| for switchboard servers only |------------------------------------------------
+ bool firstMsgRecv;
+ int mCaller;
+ char mCookie[130]; // for switchboard servers only
+ LONG mTrid; // current message ID
+ UINT mTimerId; // typing notifications timer id
+
+ //----| for file transfers only |-----------------------------------------------------
+ filetransfer* mMsnFtp; // file transfer block
+ bool mBridgeInit;
+
+ //----| internal data buffer |--------------------------------------------------------
+ int mBytesInData; // bytes available in data buffer
+ char mData[8192]; // data buffer for connection
+
+ //----| methods |---------------------------------------------------------------------
+ void applyGatewayData(HANDLE hConn, bool isPoll);
+ void getGatewayUrl(char* dest, int destlen, bool isPoll);
+ void processSessionData(const char* xMsgr, const char* xHost);
+ void startThread(MsnThreadFunc , CMsnProto *prt);
+
+ int send(const char data[], size_t datalen);
+ int recv(char* data, size_t datalen);
+
+ void resetTimeout(bool term = false);
+ bool isTimeout(void);
+
+ void sendTerminate(void);
+ void sendCaps(void);
+ int sendMessage(int msgType, const char* email, int netId, const char* msg, int parFlags);
+ int sendRawMessage(int msgType, const char* data, int datLen);
+ int sendPacket(const char* cmd, const char* fmt, ...);
+
+ int contactJoined(const char* email);
+ int contactLeft(const char* email);
+ HCONTACT getContactHandle(void);
};
@@ -569,7 +569,7 @@ struct ThreadData
-inline bool IsChatHandle(HANDLE hContact) { return (INT_PTR)hContact < 0; }
+inline bool IsChatHandle(HCONTACT hContact) { return (INT_PTR)hContact < 0; }
/////////////////////////////////////////////////////////////////////////////////////////
@@ -596,10 +596,10 @@ struct MsgQueueEntry
struct AvatarQueueEntry
{
- HANDLE hContact;
- char* pszUrl;
+ HCONTACT hContact;
+ char *pszUrl;
- __forceinline AvatarQueueEntry(HANDLE _contact, LPCSTR _url) :
+ __forceinline AvatarQueueEntry(HCONTACT _contact, LPCSTR _url) :
hContact(_contact),
pszUrl( mir_strdup(_url))
{}
@@ -639,7 +639,7 @@ struct MsnContact
char *email;
char *invite;
char *nick;
- HANDLE hContact;
+ HCONTACT hContact;
int list;
int netId;
int p2pMsgId;
@@ -863,7 +863,7 @@ struct chunkedmsg
struct DeleteParam
{
CMsnProto *proto;
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
CMsnProto* ppro;
- InviteChatParam(const TCHAR* id, HANDLE hContact, CMsnProto* ppro)
+ InviteChatParam(const TCHAR* id, HCONTACT 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 f6bc3e5f85..e41bf5becb 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 <http://www.gnu.org/licenses/>.
static HANDLE hServiceParseLink;
-static HANDLE GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
+static HCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
{
TCHAR* email = NULL;
do
@@ -51,7 +51,7 @@ static HANDLE GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
return NULL;
}
if (pemail) *pemail = email;
- HANDLE hContact = proto->MSN_HContactFromEmail(UTF8(email), NULL, true, true);
+ HCONTACT 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;
- HANDLE hContact = GetContact(arg, &email, proto);
+ HCONTACT 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;
- HANDLE hContact = GetContact(arg, NULL, proto);
+ HCONTACT hContact = GetContact(arg, NULL, proto);
if (hContact != NULL)
{
@@ -133,7 +133,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
{
arg += 6;
- HANDLE hContact = GetContact(arg, NULL, proto);
+ HCONTACT hContact = GetContact(arg, NULL, proto);
if (hContact != NULL)
{
@@ -145,7 +145,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
{
arg += 6;
- HANDLE hContact = GetContact(arg, NULL, proto);
+ HCONTACT 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 1a5d372fce..bd3ab46208 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(HANDLE hContact)
+MsnContact* CMsnProto::Lists_Get(HCONTACT 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, HANDLE hContact, const char* nick, const char* invite)
+int CMsnProto::Lists_Add(int list, int netId, const char* email, HCONTACT 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)
{
- HANDLE hContact = db_find_first(m_szModuleName);
+ HCONTACT hContact = db_find_first(m_szModuleName);
while (hContact) {
- HANDLE hNext = db_find_next(hContact, m_szModuleName);
+ HCONTACT 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(HANDLE hItem, HWND hwndList, CMsnProto* proto)
+static void SetContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
{
if (!proto->MSN_IsMyContact(hItem)) {
SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
@@ -460,38 +460,34 @@ static void SetContactIcons(HANDLE hItem, HWND hwndList, CMsnProto* proto)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(4,(dwMask & LIST_RL)?5:0));
}
-static void SetAllContactIcons(HANDLE hItem, HWND hwndList, CMsnProto* proto)
+static void SetAllContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem)
{
- HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) SetAllContactIcons(hItemT, hwndList, proto);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ SetAllContactIcons(hItemT, hwndList, proto);
}
else if (IsHContactContact(hItem))
- {
SetContactIcons(hItem, hwndList, proto);
- }
hItem = hItemN;
}
}
-static void SaveListItem(HANDLE hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto)
+static void SaveListItem(HCONTACT hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto)
{
if (iPrevValue == iNewValue)
return;
- if (iNewValue == 0)
- {
- if (list & LIST_FL)
- {
+ if (iNewValue == 0) {
+ if (list & LIST_FL) {
DeleteParam param = { proto, hContact };
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DELETECONTACT), NULL, DlgDeleteContactUI, (LPARAM)&param);
return;
@@ -503,29 +499,26 @@ static void SaveListItem(HANDLE hContact, const char* szEmail, int list, int iPr
proto->MSN_AddUser(hContact, szEmail, proto->Lists_GetNetId(szEmail), list);
}
-static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)
+static void SaveSettings(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem)
{
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) SaveSettings(hItemT, hwndList, proto);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ SaveSettings(hItemT, hwndList, proto);
}
- else
- {
+ else {
char szEmail[MSN_MAX_EMAIL_LEN];
- if (IsHContactContact(hItem))
- {
- if (db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail))) continue;
+ if (IsHContactContact(hItem)) {
+ if (db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail)))
+ continue;
}
- else if (IsHContactInfo(hItem))
- {
-
+ else if (IsHContactInfo(hItem)) {
TCHAR buf[MSN_MAX_EMAIL_LEN];
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
WideCharToMultiByte(CP_ACP, 0, buf, -1, szEmail, sizeof(szEmail), 0, 0);
@@ -543,7 +536,7 @@ static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)
if (xorMask && newMask & (LIST_FL | LIST_LL))
{
- HANDLE hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem;
+ HCONTACT hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem;
proto->MSN_SetContactDb(hContact, szEmail);
}
@@ -557,7 +550,7 @@ static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)
}
}
}
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
}
}
@@ -639,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(nmc->hItem, nmc->hdr.hwndFrom, proto);
+ SetContactIcons((HCONTACT)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 180d3e77a3..d74d62ff33 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));
- HANDLE hContact = MSN_HContactFromEmail(MyOptions.szEmail);
+ HCONTACT 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(HANDLE hContact)
+void CMsnProto::displayEmailCount(HCONTACT hContact)
{
if (!emailEnabled || getByte("DisableHotmailCL", 0)) return;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 76e2e9f784..e9e6cf3b1a 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -32,9 +32,8 @@ HANDLE hNetMeeting, hBlockCom, hSendHotMail, hInviteChat, hViewProfile;
INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM)
{
- if (msnLoggedIn)
- {
- const HANDLE hContact = (HANDLE)wParam;
+ if (msnLoggedIn) {
+ HCONTACT hContact = (HCONTACT)wParam;
char tEmail[MSN_MAX_EMAIL_LEN];
db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail));
@@ -52,7 +51,7 @@ INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM)
INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)
{
- HANDLE hContact = MSN_HContactFromEmail(MyOptions.szEmail);
+ HCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1);
MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox");
@@ -61,7 +60,7 @@ INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)
INT_PTR CMsnProto::MsnSendHotmail(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char szEmail[MSN_MAX_EMAIL_LEN];
if (MSN_IsMeByContact(hContact, szEmail))
@@ -86,7 +85,7 @@ INT_PTR CMsnProto::MsnSetupAlerts(WPARAM, LPARAM)
INT_PTR CMsnProto::MsnViewProfile(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char buf[64], *cid;
if (hContact == NULL)
@@ -128,7 +127,7 @@ INT_PTR CMsnProto::MsnInviteCommand(WPARAM, LPARAM)
int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char szEmail[MSN_MAX_EMAIL_LEN];
if ( !MSN_IsMyContact(hContact))
@@ -158,10 +157,9 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
int CMsnProto::OnContactDoubleClicked(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
- if (emailEnabled && MSN_IsMeByContact(hContact))
- {
+ if (emailEnabled && MSN_IsMeByContact(hContact)) {
MsnSendHotmail(wParam, 0);
return 1;
}
@@ -175,7 +173,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM)
{
if (!msnLoggedIn) return 0;
- HANDLE hContact = HANDLE(wParam);
+ HCONTACT hContact = HCONTACT(wParam);
char szEmail[MSN_MAX_EMAIL_LEN];
if (MSN_IsMeByContact(hContact, szEmail)) return 0;
@@ -361,7 +359,7 @@ void CMsnProto::MSN_EnableMenuItems(bool bEnable)
//////////////////////////////////////////////////////////////////////////////////////
-static CMsnProto* GetProtoInstanceByHContact(HANDLE hContact)
+static CMsnProto* GetProtoInstanceByHContact(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -376,31 +374,31 @@ static CMsnProto* GetProtoInstanceByHContact(HANDLE hContact)
static INT_PTR MsnMenuBlockCommand(WPARAM wParam, LPARAM lParam)
{
- CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
+ CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->MsnBlockCommand(wParam, lParam) : 0;
}
static INT_PTR MsnMenuViewProfile(WPARAM wParam, LPARAM lParam)
{
- CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
+ CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->MsnViewProfile(wParam, lParam) : 0;
}
static INT_PTR MsnMenuSendNetMeeting(WPARAM wParam, LPARAM lParam)
{
- CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
+ CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->MsnSendNetMeeting(wParam, lParam) : 0;
}
static INT_PTR MsnMenuSendHotmail(WPARAM wParam, LPARAM lParam)
{
- CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
+ CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
return (ppro) ? ppro->MsnSendHotmail(wParam, lParam) : 0;
}
static int MSN_OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
+ CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)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 f774da7cde..4e2a8bfb0e 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)
- HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
+ HCONTACT 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(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
+void CMsnProto::MSN_GetAvatarFileName(HCONTACT 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(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
+void CMsnProto::MSN_GetCustomSmileyFileName(HCONTACT 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) {
- HANDLE hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
+ HCONTACT 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) {
- HANDLE hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
+ HCONTACT 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, HANDLE hContact)
+void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HCONTACT 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 HANDLE hContact, const TCHAR* msg, int flags)
+void CMsnProto::MSN_ShowPopup(const HCONTACT 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(HANDLE hContact)
+bool CMsnProto::MSN_IsMyContact(HCONTACT hContact)
{
const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
}
-bool CMsnProto::MSN_IsMeByContact(HANDLE hContact, char* szEmail)
+bool CMsnProto::MSN_IsMeByContact(HCONTACT hContact, char* szEmail)
{
char tEmail[MSN_MAX_EMAIL_LEN];
char *emailPtr = szEmail ? szEmail : tEmail;
@@ -1212,7 +1212,7 @@ bool CMsnProto::MSN_IsMeByContact(HANDLE hContact, char* szEmail)
return _stricmp(emailPtr, MyOptions.szEmail) == 0;
}
-bool MSN_MsgWndExist(HANDLE hContact)
+bool MSN_MsgWndExist(HCONTACT hContact)
{
MessageWindowInputData msgWinInData =
{ sizeof(MessageWindowInputData), hContact, MSG_WINDOW_UFLAG_MSG_BOTH };
@@ -1222,7 +1222,7 @@ bool MSN_MsgWndExist(HANDLE hContact)
bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
res = res || msgWinData.hwndWindow;
if (res) {
- msgWinInData.hContact = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ msgWinInData.hContact = (HCONTACT)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 894e4dee30..0bbd87c01b 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)
{
- HANDLE hContact = MSN_HContactFromEmail(E.wlid);
+ HCONTACT 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);
- HANDLE hContact = MSN_HContactFromEmail(wlid);
+ HCONTACT 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 26aa551c2d..b4c00ca167 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));
- HANDLE hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
+ HCONTACT 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 8c631aca5a..697bb49c0b 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(HANDLE hContact, TInfoType mType)
+filetransfer* CMsnProto::p2p_getThreadSession(HCONTACT hContact, TInfoType mType)
{
EnterCriticalSection(&sessionLock);
@@ -129,7 +129,7 @@ filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
return result;
}
-void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
+void CMsnProto::p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType)
{
EnterCriticalSection(&sessionLock);
@@ -147,7 +147,7 @@ void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
LeaveCriticalSection(&sessionLock);
}
-filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
+filetransfer* CMsnProto::p2p_getAvatarSession(HCONTACT hContact)
{
EnterCriticalSection(&sessionLock);
@@ -165,7 +165,7 @@ filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
return result;
}
-bool CMsnProto::p2p_isAvatarOnly(HANDLE hContact)
+bool CMsnProto::p2p_isAvatarOnly(HCONTACT hContact)
{
EnterCriticalSection(&sessionLock);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index d6f7fbef5c..950d8575ef 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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
-HANDLE CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
+HCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
{
- HANDLE hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);
+ HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);
if (flags & PALF_TEMPORARY)
{
@@ -277,7 +277,7 @@ HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv
return AddToListByEmail(email, nick, flags);
}
-int CMsnProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int CMsnProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
{
Proto_AuthRecv(m_szModuleName, pre);
return 0;
@@ -286,7 +286,7 @@ int CMsnProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CMsnProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+int __cdecl CMsnProto::AuthRequest(HCONTACT 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;
- HANDLE hContact = MSN_HContactFromEmail(email, nick, true, 0);
+ HCONTACT 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;
- HANDLE hContact = MSN_HContactFromEmail(email);
+ HCONTACT 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(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE __cdecl CMsnProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -546,7 +546,7 @@ HANDLE __cdecl CMsnProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const PRO
/////////////////////////////////////////////////////////////////////////////////////////
// MsnFileCancel - cancels the active file transfer
-int __cdecl CMsnProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int __cdecl CMsnProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -579,7 +579,7 @@ int __cdecl CMsnProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnFileDeny - rejects the file transfer request
-int __cdecl CMsnProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/)
+int __cdecl CMsnProto::FileDeny(HCONTACT 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;
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact)
+HANDLE __cdecl CMsnProto::GetAwayMsg(HCONTACT hContact)
{
AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo));
inf->hContact = hContact;
@@ -681,7 +681,7 @@ HANDLE __cdecl CMsnProto::GetAwayMsg(HANDLE hContact)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnGetCaps - obtain the protocol capabilities
-DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HANDLE hContact)
+DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HCONTACT hContact)
{
switch(type) {
case PFLAGNUM_1:
@@ -718,7 +718,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HANDLE hContact)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnGetInfo - nothing to do, cause we cannot obtain information from the server
-int __cdecl CMsnProto::GetInfo(HANDLE hContact, int infoType)
+int __cdecl CMsnProto::GetInfo(HCONTACT hContact, int infoType)
{
return 1;
}
@@ -726,7 +726,7 @@ int __cdecl CMsnProto::GetInfo(HANDLE hContact, int infoType)
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CMsnProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CMsnProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -735,7 +735,7 @@ int __cdecl CMsnProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnRecvFile - creates a database event from the file request been received
-int __cdecl CMsnProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
+int __cdecl CMsnProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -743,7 +743,7 @@ int __cdecl CMsnProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnRecvMessage - creates a database event from the message been received
-int __cdecl CMsnProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CMsnProto::RecvMsg(HCONTACT 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(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CMsnProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int __cdecl CMsnProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 1;
}
@@ -765,7 +765,7 @@ int __cdecl CMsnProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CMsnProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CMsnProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
return 1;
}
@@ -773,7 +773,7 @@ int __cdecl CMsnProto::SendContacts(HANDLE hContact, int flags, int nContacts, H
/////////////////////////////////////////////////////////////////////////////////////////
// MsnSendFile - initiates a file transfer
-HANDLE __cdecl CMsnProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE __cdecl CMsnProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
if (!msnLoggedIn)
return 0;
@@ -826,14 +826,14 @@ HANDLE __cdecl CMsnProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescripti
struct TFakeAckParams
{
- inline TFakeAckParams(HANDLE p2, long p3, const char* p4, CMsnProto *p5) :
+ inline TFakeAckParams(HCONTACT p2, long p3, const char* p4, CMsnProto *p5) :
hContact(p2),
id(p3),
msg(p4),
proto(p5)
{}
- HANDLE hContact;
+ HCONTACT hContact;
long id;
const char* msg;
CMsnProto *proto;
@@ -846,12 +846,12 @@ void CMsnProto::MsnFakeAck(void* arg)
Sleep(150);
tParam->proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE,
tParam->msg ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
- (HANDLE)tParam->id, LPARAM(tParam->msg));
+ (HCONTACT)tParam->id, LPARAM(tParam->msg));
delete tParam;
}
-int __cdecl CMsnProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CMsnProto::SendMsg(HCONTACT 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(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
+int __cdecl CMsnProto::RecvAwayMsg(HCONTACT 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(HANDLE hContact, int type)
+int __cdecl CMsnProto::UserIsTyping(HCONTACT hContact, int type)
{
if (!msnLoggedIn) return 0;
@@ -1108,7 +1108,7 @@ int __cdecl CMsnProto::UserIsTyping(HANDLE hContact, int type)
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CMsnProto::SendUrl(HANDLE hContact, int flags, const char* url)
+int __cdecl CMsnProto::SendUrl(HCONTACT hContact, int flags, const char* url)
{
return 1;
}
@@ -1116,7 +1116,7 @@ int __cdecl CMsnProto::SendUrl(HANDLE hContact, int flags, const char* url)
/////////////////////////////////////////////////////////////////////////////////////////
// MsnSetApparentMode - controls contact visibility
-int __cdecl CMsnProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CMsnProto::SetApparentMode(HCONTACT 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 8d95a7e76d..1e351b900b 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -37,18 +37,18 @@ struct CMsnProto : public PROTO<CMsnProto>
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
@@ -56,24 +56,24 @@ struct CMsnProto : public PROTO<CMsnProto>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -195,7 +195,7 @@ struct CMsnProto : public PROTO<CMsnProto>
bool getMyAvatarFile(char *url, TCHAR *fname);
void MSN_GoOffline(void);
- void MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type);
+ void MSN_GetCustomSmileyFileName(HCONTACT 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<CMsnProto>
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(HANDLE hContact, DWORD dwValue, bool always);
+ void sttSetMirVer(HCONTACT 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, HANDLE hContact = NULL);
- void MSN_ShowPopup(const HANDLE hContact, const TCHAR* msg, int flags);
+ 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_ShowError(const char* msgtext, ...);
void MSN_SetNicknameUtf(const char* nickname);
@@ -337,7 +337,7 @@ struct CMsnProto : public PROTO<CMsnProto>
void p2p_cancelAllSessions(void);
void p2p_redirectSessions(const char* wlid);
void p2p_startSessions(const char* wlid);
- void p2p_clearThreadSessions(HANDLE hContact, TInfoType mType);
+ void p2p_clearThreadSessions(HCONTACT 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<CMsnProto>
void P2pSessions_Init(void);
void P2pSessions_Uninit(void);
- filetransfer* p2p_getAvatarSession(HANDLE hContact);
- filetransfer* p2p_getThreadSession(HANDLE hContact, TInfoType mType);
+ filetransfer* p2p_getAvatarSession(HCONTACT hContact);
+ filetransfer* p2p_getThreadSession(HCONTACT 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(HANDLE hContact);
+ bool p2p_isAvatarOnly(HCONTACT hContact);
unsigned p2p_getMsgId(const char* wlid, int inc);
unsigned p2p_getPktNum(const char* wlid);
@@ -413,7 +413,7 @@ struct CMsnProto : public PROTO<CMsnProto>
void MSN_ChatStart(ThreadData* info);
void MSN_KillChatSession(const TCHAR* id);
- HANDLE MSN_GetChatInernalHandle(HANDLE hContact);
+ HCONTACT MSN_GetChatInernalHandle(HCONTACT 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<CMsnProto>
/////////////////////////////////////////////////////////////////////////////////////////
// MSN contact list
- int Lists_Add(int list, int netId, const char* email, HANDLE hContact = NULL, const char* nick = NULL, const char* invite = NULL);
+ int Lists_Add(int list, int netId, const char* email, HCONTACT 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<CMsnProto>
void Lists_Wipe(void);
MsnContact* Lists_Get(const char* email);
- MsnContact* Lists_Get(HANDLE hContact);
+ MsnContact* Lists_Get(HCONTACT hContact);
MsnContact* Lists_GetNext(int& i);
MsnPlace* Lists_GetPlace(const char* wlid);
@@ -446,30 +446,30 @@ struct CMsnProto : public PROTO<CMsnProto>
void MSN_FindYahooUser(const char* email);
bool MSN_RefreshContactList(void);
- bool MSN_IsMyContact(HANDLE hContact);
- bool MSN_IsMeByContact(HANDLE hContact, char* szEmail = NULL);
- bool MSN_AddUser(HANDLE hContact, const char* email, int netId, int flags, const char *msg = NULL);
+ 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);
void MSN_AddAuthRequest(const char *email, const char *nick, const char *reason);
- void MSN_SetContactDb(HANDLE hContact, const char *szEmail);
- HANDLE MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false);
- HANDLE AddToListByEmail(const char *email, const char *nick, DWORD flags);
+ 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);
/////////////////////////////////////////////////////////////////////////////////////////
// MSN server groups
- void MSN_AddGroup(const char* pName, const char* pId, bool init);
- void MSN_DeleteGroup(const char* pId);
- void MSN_FreeGroups(void);
- LPCSTR MSN_GetGroupById(const char* pId);
- LPCSTR MSN_GetGroupByName(const char* pName);
- void MSN_SetGroupName(const char* pId, const char* pName);
+ void MSN_AddGroup(const char* pName, const char* pId, bool init);
+ void MSN_DeleteGroup(const char* pId);
+ void MSN_FreeGroups(void);
+ LPCSTR MSN_GetGroupById(const char* pId);
+ LPCSTR MSN_GetGroupByName(const char* pName);
+ void MSN_SetGroupName(const char* pId, const char* pName);
- void MSN_MoveContactToGroup(HANDLE hContact, const char* grpName);
- void MSN_RenameServerGroup(LPCSTR szId, const char* newName);
- void MSN_DeleteServerGroup(LPCSTR szId);
- void MSN_RemoveEmptyGroups(void);
- void MSN_SyncContactToServerGroup(HANDLE hContact, const char* szContId, ezxml_t cgrp);
- void MSN_UploadServerGroups(char* group);
+ void MSN_MoveContactToGroup(HCONTACT 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_UploadServerGroups(char* group);
/////////////////////////////////////////////////////////////////////////////////////////
// MSN Authentication
@@ -485,12 +485,12 @@ struct CMsnProto : public PROTO<CMsnProto>
void AvatarQueue_Init(void);
void AvatarQueue_Uninit(void);
- void MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
+ void MSN_GetAvatarFileName(HCONTACT 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(HANDLE hContact, LPCSTR pszUrl);
+ void pushAvatarRequest(HCONTACT hContact, LPCSTR pszUrl);
bool loadHttpAvatar(AvatarQueueEntry *p);
/////////////////////////////////////////////////////////////////////////////////////////
@@ -504,7 +504,7 @@ struct CMsnProto : public PROTO<CMsnProto>
void processMailData(char* mailData);
void sttNotificationMessage(char* msgBody, bool isInitial);
- void displayEmailCount(HANDLE hContact);
+ void displayEmailCount(HCONTACT hContact);
/////////////////////////////////////////////////////////////////////////////////////////
// MSN SOAP Address Book
@@ -526,7 +526,7 @@ struct CMsnProto : public PROTO<CMsnProto>
ezxml_t abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr);
char* GetABHost(const char* service, bool isSharing);
- void SetAbParam(HANDLE hContact, const char *name, const char *par);
+ void SetAbParam(HCONTACT 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<CMsnProto>
//////////////////////////////////////////////////////////////////////////////////////
- TCHAR* GetContactNameT(HANDLE hContact);
+ TCHAR* GetContactNameT(HCONTACT hContact);
- int getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result);
+ int getStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result);
int getStringUtf(const char* name, DBVARIANT* result);
- void setStringUtf(HANDLE hContact, const char* name, const char* value);
+ void setStringUtf(HCONTACT hContact, const char* name, const char* value);
};
extern OBJLIST<CMsnProto> g_Instances;
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp
index 10f22e1df1..5f528760f0 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(HANDLE hContact, const char *name, const char *par)
+void CMsnProto::SetAbParam(HCONTACT 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;
- HANDLE hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
+ HCONTACT 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);
- HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
+ HCONTACT 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
{
- HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
+ HCONTACT 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 bf86fc1706..472e7fafd8 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(HANDLE hContact, const char* grpName)
+void CMsnProto::MSN_MoveContactToGroup(HCONTACT 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(HANDLE hContact, const char* szContId, ezxml_t cgrp)
+void CMsnProto::MSN_SyncContactToServerGroup(HCONTACT 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 3816e2035e..78655c0035 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 <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////////////////
// Standard functions
-int CMsnProto::getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result)
+int CMsnProto::getStringUtf(HCONTACT 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(HANDLE hContact, const char* name, const char* value)
+void CMsnProto::setStringUtf(HCONTACT hContact, const char* name, const char* value)
{ db_set_utf(hContact, m_szModuleName, name, value);
}
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* CMsnProto::GetContactNameT(HANDLE hContact)
+TCHAR* CMsnProto::GetContactNameT(HCONTACT 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 5ed7d2f7b3..73a74e0670 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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char tEmail[MSN_MAX_EMAIL_LEN];
if (MSN_IsMeByContact(hContact, tEmail)) return 0;
@@ -257,8 +257,7 @@ INT_PTR CMsnProto::SendNudge(WPARAM wParam, LPARAM lParam)
int netId = Lists_GetNetId(tEmail);
- switch (netId)
- {
+ switch (netId) {
case NETID_UNKNOWN:
hContact = MSN_GetChatInernalHandle(hContact);
@@ -381,7 +380,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM wParam, LPARAM lParam)
int CMsnProto::OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
if (!msnLoggedIn) //should never happen for MSN contacts
return 0;
@@ -425,7 +424,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam)
{
if (!msnLoggedIn || !MyOptions.ManageServer) return 0;
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
const CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam;
if (hContact == NULL)
@@ -459,7 +458,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam)
int CMsnProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
if (!msnLoggedIn)
@@ -620,7 +619,7 @@ INT_PTR CMsnProto::GetUnreadEmailCount(WPARAM wParam, LPARAM lParam)
INT_PTR CMsnProto::OnLeaveChat(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 95f07482ec..582ea94452 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();
}
-HANDLE ThreadData::getContactHandle(void)
+HCONTACT 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 a7f3027cbe..5abc87ed2a 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)
{
- HANDLE hContact = MSN_HContactFromEmail(wlid);
+ HCONTACT 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; i<mJoinedContactsWLID.getCount(); ++i)
{
const char* wlid = mJoinedContactsWLID[i];
- HANDLE hContact = proto->MSN_HContactFromEmail(wlid);
+ HCONTACT 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 1cd3e04c2b..95f0ba5cea 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)
{
- HANDLE hContact = getContactHandle();
+ HCONTACT hContact = getContactHandle();
if (mJoinedContactsWLID.getCount() == 0 || termPending)
res = true;
@@ -96,7 +96,7 @@ bool ThreadData::isTimeout(void)
if (proto->getByte("EnableSessionPopup", 0))
{
- HANDLE hContact = NULL;
+ HCONTACT 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 31fb4ae58b..1c14409e74 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -366,7 +366,7 @@ HANDLE OmegleProto::GetChatHandle()
/*if (facy.chatHandle_ != NULL)
return facy.chatHandle_;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
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))
@@ -377,7 +377,7 @@ HANDLE OmegleProto::GetChatHandle()
return NULL;*/
GC_INFO gci = {0};
- gci.Flags = HCONTACT;
+ gci.Flags = GCF_HCONTACT;
gci.pszModule = m_szModuleName;
gci.pszID = m_tszUserName;
CallService(MS_GC_GETINFO, 0, (LPARAM)&gci);
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp
index 90049ab2cd..e98fa84271 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(HANDLE hContact, int flags, const char *msg)
+int OmegleProto::SendMsg(HCONTACT 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 245fa749ea..ef213f5066 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, HANDLE hContact )
+DWORD_PTR OmegleProto::GetCaps( int type, HCONTACT hContact )
{
switch(type) {
case PFLAGNUM_1:
@@ -210,7 +210,7 @@ int OmegleProto::OnPreShutdown(WPARAM wParam,LPARAM lParam)
int OmegleProto::OnContactDeleted(WPARAM wparam,LPARAM)
{
- //HANDLE hContact = (HANDLE)wparam;
+ //HCONTACT hContact = (HCONTACT)wparam;
OnLeaveChat(NULL, NULL);
return 0;
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h
index dc774a56b3..507faea578 100644
--- a/protocols/Omegle/src/proto.h
+++ b/protocols/Omegle/src/proto.h
@@ -49,18 +49,18 @@ public:
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const PROTOCHAR* szMessage );
+ virtual int __cdecl AuthRecv( HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl AuthRequest( HCONTACT hContact, const PROTOCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
+ virtual HANDLE __cdecl FileAllow( HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
+ virtual int __cdecl FileCancel( HCONTACT hContact, HANDLE hTransfer );
+ virtual int __cdecl FileDeny( HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
+ virtual int __cdecl GetInfo( HCONTACT hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
@@ -68,24 +68,24 @@ public:
virtual HWND __cdecl SearchAdvanced( HWND owner );
virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTOFILEEVENT* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts( HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvFile( HCONTACT hContact, PROTOFILEEVENT* );
+ virtual int __cdecl RecvMsg( HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvUrl( HCONTACT hContact, PROTORECVEVENT* );
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts( HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList );
+ virtual HANDLE __cdecl SendFile( HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles );
+ virtual int __cdecl SendMsg( HCONTACT hContact, int flags, const char* msg );
+ virtual int __cdecl SendUrl( HCONTACT hContact, int flags, const char* url );
- virtual int __cdecl SetApparentMode( HANDLE hContact, int mode );
+ virtual int __cdecl SetApparentMode( HCONTACT hContact, int mode );
virtual int __cdecl SetStatus( int iNewStatus );
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
+ virtual HANDLE __cdecl GetAwayMsg( HCONTACT hContact );
+ virtual int __cdecl RecvAwayMsg( HCONTACT hContact, int mode, PROTORECVEVENT* evt );
virtual int __cdecl SetAwayMsg( int iStatus, const PROTOCHAR* msg );
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping( HCONTACT hContact, int type );
virtual int __cdecl OnEvent( PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam );
diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp
index 1bad2bfca9..817c2c02a9 100644
--- a/protocols/Omegle/src/stubs.cpp
+++ b/protocols/Omegle/src/stubs.cpp
@@ -42,12 +42,12 @@ int OmegleProto::AuthDeny(HANDLE hDbEvent,const PROTOCHAR *reason)
return 1;
}
-int OmegleProto::AuthRecv(HANDLE hContact,PROTORECVEVENT *)
+int OmegleProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int OmegleProto::AuthRequest(HANDLE hContact,const PROTOCHAR *message)
+int OmegleProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message)
{
return 1;
}
@@ -57,17 +57,17 @@ HANDLE OmegleProto::ChangeInfo(int type,void *info_data)
return NULL;
}
-HANDLE OmegleProto::FileAllow(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *path)
+HANDLE OmegleProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path)
{
return NULL;
}
-int OmegleProto::FileCancel(HANDLE hContact,HANDLE hTransfer)
+int OmegleProto::FileCancel(HCONTACT hContact,HANDLE hTransfer)
{
return 1;
}
-int OmegleProto::FileDeny(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *reason)
+int OmegleProto::FileDeny(HCONTACT 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( HANDLE hContact, int infoType )
+int OmegleProto::GetInfo( HCONTACT hContact, int infoType )
{
return 1;
}
@@ -107,47 +107,47 @@ HWND OmegleProto::CreateExtendedSearchUI(HWND owner)
return NULL;
}
-int OmegleProto::RecvContacts(HANDLE hContact,PROTORECVEVENT *)
+int OmegleProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int OmegleProto::RecvFile(HANDLE hContact,PROTORECVFILET *)
+int OmegleProto::RecvFile(HCONTACT hContact,PROTORECVFILET *)
{
return 1;
}
-int OmegleProto::RecvUrl(HANDLE hContact,PROTORECVEVENT *)
+int OmegleProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int OmegleProto::SendContacts(HANDLE hContact,int flags,int nContacts,HANDLE *hContactsList)
+int OmegleProto::SendContacts(HCONTACT hContact,int flags,int nContacts,HCONTACT *hContactsList)
{
return 1;
}
-HANDLE OmegleProto::SendFile(HANDLE hContact,const PROTOCHAR *desc, PROTOCHAR **files)
+HANDLE OmegleProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files)
{
return NULL;
}
-int OmegleProto::SendUrl(HANDLE hContact,int flags,const char *url)
+int OmegleProto::SendUrl(HCONTACT hContact,int flags,const char *url)
{
return 1;
}
-int OmegleProto::SetApparentMode(HANDLE hContact,int mode)
+int OmegleProto::SetApparentMode(HCONTACT hContact,int mode)
{
return 1;
}
-int OmegleProto::RecvAwayMsg(HANDLE hContact,int mode,PROTORECVEVENT *evt)
+int OmegleProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt)
{
return 1;
}
-int OmegleProto::UserIsTyping(HANDLE hContact, int type)
+int OmegleProto::UserIsTyping(HCONTACT hContact, int type)
{
return 1;
}
@@ -157,12 +157,12 @@ int OmegleProto::SetAwayMsg(int iStatus, const PROTOCHAR* msg)
return 1;
}
-HANDLE OmegleProto::GetAwayMsg( HANDLE hContact )
+HANDLE OmegleProto::GetAwayMsg( HCONTACT hContact )
{
return NULL;
}
-int OmegleProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int OmegleProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
return 1;
}
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp
index 786e2c2340..78e1f9d135 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(HANDLE hContact)
+static OmegleProto * GetInstanceByHContact(HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if (!proto)
diff --git a/protocols/Skype/src/skype_avatars.cpp b/protocols/Skype/src/skype_avatars.cpp
index a42bd24dc3..0ff7d40b56 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, HANDLE hContact)
+bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, HCONTACT hContact)
{
bool result = false;
@@ -21,7 +21,7 @@ bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, HANDLE hContact)
return result;
}
-wchar_t * CSkypeProto::GetContactAvatarFilePath(HANDLE hContact)
+wchar_t * CSkypeProto::GetContactAvatarFilePath(HCONTACT 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 ba6b123824..a7c96da731 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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));
- HANDLE hContact = param->ppro->GetContactBySid(sid);
+ HCONTACT 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;
- HANDLE hContact = NULL;
+ HCONTACT 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);
- HANDLE hContact = (HANDLE)::SendMessage(GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETITEMDATA, i, 0);
+ HCONTACT hContact = (HCONTACT)::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 01b62ea3ed..cfc6bb4aab 100644
--- a/protocols/Skype/src/skype_chat.cpp
+++ b/protocols/Skype/src/skype_chat.cpp
@@ -256,16 +256,14 @@ void ChatRoom::Start(const ConversationRef &conversation, bool showWindow)
this->conversation->SetChatRoom(this);
GC_INFO gci = { 0 };
- gci.Flags = BYID | HCONTACT;
+ gci.Flags = GCF_BYID | GCF_HCONTACT;
gci.pszModule = ppro->m_szModuleName;
gci.pszID = this->cid;
- if ( !::CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
- {
+ if ( !::CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
this->hContact = gci.hContact;
ptrW cid( ::db_get_wsa(gci.hContact, ppro->m_szModuleName, SKYPE_SETTINGS_SID));
- if (cid == NULL)
- {
+ if (cid == NULL) {
this->conversation->GetPropIdentity(data);
cid = ::mir_utf8decodeW(data);
::db_set_ws(gci.hContact, ppro->m_szModuleName, SKYPE_SETTINGS_SID, cid);
@@ -984,7 +982,7 @@ void ChatRoom::OnParticipantChanged(const ParticipantRef &participant, int prop)
///
-void CSkypeProto::ChatValidateContact(HANDLE hItem, HWND hwndList, const StringList &contacts)
+void CSkypeProto::ChatValidateContact(HCONTACT hItem, HWND hwndList, const StringList &contacts)
{
if (this->IsProtoContact(hItem) && !this->isChatRoom(hItem))
{
@@ -996,19 +994,18 @@ void CSkypeProto::ChatValidateContact(HANDLE hItem, HWND hwndList, const StringL
::SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
}
-void CSkypeProto::ChatPrepare(HANDLE hItem, HWND hwndList, const StringList &contacts)
+void CSkypeProto::ChatPrepare(HCONTACT hItem, HWND hwndList, const StringList &contacts)
{
if (hItem == NULL)
- hItem = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
- while (hItem)
- {
- HANDLE hItemN = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ while (hItem) {
+ HCONTACT hItemN = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) this->ChatPrepare(hItemT, hwndList, contacts);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ this->ChatPrepare(hItemT, hwndList, contacts);
}
else if (IsHContactContact(hItem))
this->ChatValidateContact(hItem, hwndList, contacts);
@@ -1017,39 +1014,33 @@ void CSkypeProto::ChatPrepare(HANDLE hItem, HWND hwndList, const StringList &con
}
}
-void CSkypeProto::GetInvitedContacts(HANDLE hItem, HWND hwndList, StringList &chatTargets)
+void CSkypeProto::GetInvitedContacts(HCONTACT hItem, HWND hwndList, StringList &chatTargets)
{
if (hItem == NULL)
- hItem = (HANDLE)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
- while (hItem)
- {
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ while (hItem) {
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItemT)
this->GetInvitedContacts(hItemT, hwndList, chatTargets);
}
- else
- {
+ else {
int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- if (chk)
- {
- if (IsHContactInfo(hItem))
- {
+ if (chk) {
+ if (IsHContactInfo(hItem)) {
TCHAR buf[128] = _T("");
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
-
- if (buf[0]) chatTargets.insert(buf);
+ if (buf[0])
+ chatTargets.insert(buf);
}
- else
- {
+ else {
ptrW login( ::db_get_wsa(hItem, this->m_szModuleName, SKYPE_SETTINGS_SID));
chatTargets.insert(login);
}
}
}
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
}
}
@@ -1057,8 +1048,7 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam
{
ChatRoomParam *param = (ChatRoomParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -1076,8 +1066,7 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
SendDlgItemMessage(hwndDlg, IDC_CHAT_JOINING, BM_SETCHECK, param->enableJoining, 0);
- for (int i = 1; i < SIZEOF(ChatRoom::Roles) - 4; i++)
- {
+ for (int i = 1; i < SIZEOF(ChatRoom::Roles) - 4; i++) {
int nItem = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CHAT_ROLES), CB_ADDSTRING, 0, (LPARAM)::TranslateW(ChatRoom::Roles[i]));
if (i == Participant::WRITER)
@@ -1095,13 +1084,11 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_NOTIFY:
{
NMCLISTCONTROL *nmc = (NMCLISTCONTROL *)lParam;
- if (nmc->hdr.idFrom == IDC_CCLIST)
- {
- switch (nmc->hdr.code)
- {
+ if (nmc->hdr.idFrom == IDC_CCLIST) {
+ switch (nmc->hdr.code) {
case CLN_NEWCONTACT:
if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- param->ppro->ChatValidateContact(nmc->hItem, nmc->hdr.hwndFrom, param->invitedContacts);
+ param->ppro->ChatValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->invitedContacts);
break;
case CLN_LISTREBUILT:
@@ -1205,19 +1192,17 @@ INT_PTR CSkypeProto::CreateChatRoomCommand(WPARAM, LPARAM)
return 0;
}
-void CSkypeProto::ChatRoomInvite(HANDLE hContact)
+void CSkypeProto::ChatRoomInvite(HCONTACT hContact)
{
ptrT chat_id(::db_get_tsa(hContact, this->m_szModuleName, "ChatRoomID"));
GC_INFO gci = { 0 };
- gci.Flags = BYID | USERS | DATA;
+ gci.Flags = GCF_BYID | GCF_USERS | GCF_DATA;
gci.pszModule = this->m_szModuleName;
gci.pszID = chat_id;
- if ( !::CallService(MS_GC_GETINFO, 0, (LPARAM)&gci))
- {
+ if ( !::CallService(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
ChatRoom *room = (ChatRoom *)gci.dwItemData;
- if (room != NULL && gci.pszUsers != NULL)
- {
+ if (room != NULL && gci.pszUsers != NULL) {
StringList invitedContacts(_A2T(gci.pszUsers));
ChatRoomParam *param = new ChatRoomParam(NULL, invitedContacts, this);
@@ -1232,7 +1217,7 @@ void CSkypeProto::ChatRoomInvite(HANDLE hContact)
void CSkypeProto::CloseAllChatSessions()
{
GC_INFO gci = {0};
- gci.Flags = BYINDEX | ID | DATA;
+ gci.Flags = GCF_BYINDEX | GCF_ID | GCF_DATA;
gci.pszModule = this->m_szModuleName;
int count = ::CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)this->m_szModuleName);
@@ -1252,7 +1237,7 @@ void CSkypeProto::CloseAllChatSessions()
ChatRoom *CSkypeProto::FindChatRoom(const wchar_t *cid)
{
GC_INFO gci = { 0 };
- gci.Flags = BYID | DATA;
+ gci.Flags = GCF_BYID | GCF_DATA;
gci.pszModule = this->m_szModuleName;
gci.pszID = (wchar_t*)cid;
@@ -1364,7 +1349,7 @@ int __cdecl CSkypeProto::OnGCEventHook(WPARAM, LPARAM lParam)
case CHAT_LIST_MENU::ICM_CONF_INVITE:
{
GC_INFO gci = { 0 };
- gci.Flags = BYID | USERS;
+ gci.Flags = GCF_BYID | GCF_USERS;
gci.pszModule = this->m_szModuleName;
gci.pszID = gch->pDest->ptszID;
if ( !::CallService(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.pszUsers != NULL)
@@ -1399,7 +1384,7 @@ int __cdecl CSkypeProto::OnGCEventHook(WPARAM, LPARAM lParam)
case CHAT_LIST_MENU::ICM_COPY_SID:
{
- HANDLE hContact = this->GetContactBySid(gch->ptszUID);
+ HCONTACT hContact = this->GetContactBySid(gch->ptszUID);
if (!hContact)
{
ptrW sid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID));
@@ -1471,7 +1456,7 @@ int __cdecl CSkypeProto::OnGCMenuHook(WPARAM, LPARAM lParam)
if (member->GetRank() > Participant::SPECTATOR)
DisableChatMenuItem(ICM_ROLE);
- HANDLE hContact = this->GetContactBySid(gcmi->pszUID);
+ HCONTACT hContact = this->GetContactBySid(gcmi->pszUID);
if (hContact == NULL)
DisableChatMenuItem(ICM_DETAILS);
else if(this->getByte(hContact, "Auth", 0) == 0)
@@ -1504,7 +1489,7 @@ void CSkypeProto::UpdateChatUserStatus(const ContactRef &contact)
ptrW sid(::mir_utf8decodeW(identity));
GC_INFO gci = { 0 };
- gci.Flags = BYINDEX | DATA;
+ gci.Flags = GCF_BYINDEX | GCF_DATA;
gci.pszModule = this->m_szModuleName;
int count = ::CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)this->m_szModuleName);
@@ -1533,7 +1518,7 @@ void CSkypeProto::UpdateChatUserNick(const ContactRef &contact)
ptrW nick(::mir_utf8decodeW(((CContact::Ref)contact)->GetNick()));
GC_INFO gci = { 0 };
- gci.Flags = BYINDEX | DATA;
+ gci.Flags = GCF_BYINDEX | GCF_DATA;
gci.pszModule = this->m_szModuleName;
int count = ::CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)this->m_szModuleName);
@@ -1554,7 +1539,7 @@ void CSkypeProto::UpdateChatUserNick(const ContactRef &contact)
INT_PTR __cdecl CSkypeProto::OnJoinChat(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact)
{
ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID"));
@@ -1582,9 +1567,8 @@ INT_PTR __cdecl CSkypeProto::OnJoinChat(WPARAM wParam, LPARAM)
INT_PTR __cdecl CSkypeProto::OnLeaveChat(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
- if (hContact)
- {
+ HCONTACT hContact = (HCONTACT)wParam;
+ if (hContact) {
ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID"));
ChatRoom *room = this->FindChatRoom(cid);
diff --git a/protocols/Skype/src/skype_chat.h b/protocols/Skype/src/skype_chat.h
index 3235622348..eb5e7d432e 100644
--- a/protocols/Skype/src/skype_chat.h
+++ b/protocols/Skype/src/skype_chat.h
@@ -129,7 +129,7 @@ private:
CConversation::Ref conversation;
- HANDLE hContact;
+ HCONTACT hContact;
OBJLIST<ChatMember> members;
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index 33042e728d..325d70f508 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(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactAuthState(HCONTACT hContact, const ContactRef &contact)
{
uint newTS = 0;
contact->GetPropAuthreqTimestamp(newTS);
@@ -23,7 +23,7 @@ void CSkypeProto::UpdateContactAuthState(HANDLE hContact, const ContactRef &cont
}
}
-void CSkypeProto::UpdateContactStatus(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactStatus(HCONTACT hContact, const ContactRef &contact)
{
Contact::AVAILABILITY availability;
contact->GetPropAvailability(availability);
@@ -40,7 +40,7 @@ void CSkypeProto::UpdateContactStatus(HANDLE hContact, const ContactRef &contact
}
}
-void CSkypeProto::UpdateContactClient(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactClient(HCONTACT hContact, const ContactRef &contact)
{
bool isMobile = false;
contact->HasCapability(Contact::CAPABILITY_MOBILE_DEVICE, isMobile/*, true*/);
@@ -48,7 +48,7 @@ void CSkypeProto::UpdateContactClient(HANDLE hContact, const ContactRef &contact
this->setTString(hContact, "MirVer", isMobile ? L"SkypeMobile" : L"Skype");
}
-void CSkypeProto::UpdateContactOnlineSinceTime(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactOnlineSinceTime(HCONTACT hContact, const ContactRef &contact)
{
uint newTS = 0;
contact->GetPropLastonlineTimestamp(newTS);
@@ -57,7 +57,7 @@ void CSkypeProto::UpdateContactOnlineSinceTime(HANDLE hContact, const ContactRef
this->setDword(hContact, "OnlineSinceTS", newTS);
}
-void CSkypeProto::UpdateContactLastEventDate(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactLastEventDate(HCONTACT 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);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
::mir_free(sid);
SEObject *contactObj = contact.fetch();
@@ -148,14 +148,14 @@ void CSkypeProto::OnContactListChanged(const ContactRef &contact)
}
}
-bool CSkypeProto::IsProtoContact(HANDLE hContact)
+bool CSkypeProto::IsProtoContact(HCONTACT hContact)
{
return ::lstrcmpiA(::GetContactProto(hContact), this->m_szModuleName) == 0;
}
-HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid)
+HCONTACT CSkypeProto::GetContactBySid(const wchar_t *sid)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
::EnterCriticalSection(&this->contact_search_lock);
@@ -171,7 +171,7 @@ HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid)
return hContact;
}
-HANDLE CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
+HCONTACT CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
{
// db_event_getContact
DWORD body[3];
@@ -180,34 +180,33 @@ HANDLE CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
dbei.pBlob = (PBYTE)&body;
if (::db_event_get(hEvent, &dbei))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (strcmp(dbei.szModule, this->m_szModuleName) != 0)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
return ::DbGetAuthEventContact(&dbei);
}
-HANDLE CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary)
+HCONTACT CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary)
{
ptrW sid(::mir_utf8decodeW(contact->GetSid()));
CContact::AVAILABILITY availability;
contact->GetPropAvailability(availability);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
if ( !hContact)
{
- hContact = (HANDLE)::CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0);
::CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)this->m_szModuleName);
ptrW nick(::mir_utf8decodeW(contact->GetNick()));
- switch(availability)
- {
+ switch(availability) {
case CContact::SKYPEOUT:
this->setByte(hContact, "IsSkypeOut", 1);
break;
@@ -256,7 +255,7 @@ void __cdecl CSkypeProto::LoadContactList(void* data)
{
CContact::Ref contact = this->contactList[i];
- HANDLE hContact = this->AddContact(contact);
+ HCONTACT hContact = this->AddContact(contact);
if ( !isFirstLoad)
{
@@ -294,7 +293,7 @@ void __cdecl CSkypeProto::LoadAuthWaitList(void*)
}
}
-bool CSkypeProto::IsContactOnline(HANDLE hContact)
+bool CSkypeProto::IsContactOnline(HCONTACT hContact)
{
return this->getWord(hContact, SKYPE_SETTINGS_STATUS, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE;
}
@@ -303,7 +302,7 @@ void CSkypeProto::SetAllContactStatus(int status)
{
::EnterCriticalSection(&this->contact_search_lock);
- for (HANDLE hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName))
+ for (HCONTACT hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName))
{
if (this->getByte(hContact, "IsSkypeOut", 0) != 0)
continue;
@@ -356,7 +355,7 @@ void __cdecl CSkypeProto::SearchBySidAsync(void* arg)
{
mir_ptr<wchar_t> sid((wchar_t*)arg);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
if (hContact)
{
this->ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact);
@@ -463,7 +462,7 @@ void CSkypeProto::OnContactsReceived(const ConversationRef &conversation, const
CContact::Ref author;
this->GetContact(data, author);
- HANDLE hContact = this->AddContact(author);
+ HCONTACT hContact = this->AddContact(author);
SEBinary guid;
message->GetPropGuid(guid);
@@ -519,7 +518,7 @@ void CSkypeProto::OnContactsSent(const ConversationRef &conversation, const Mess
CContact::Ref receiver;
this->GetContact(data, receiver);
- HANDLE hContact = this->AddContact(receiver);
+ HCONTACT 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 ddc780098e..2390897d10 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(HANDLE hContact, DWORD timestamp, SEBinary &guid, int flag)
+bool CSkypeProto::IsMessageInDB(HCONTACT 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(HANDLE hContact, DWORD timestamp, SEBinary &guid
return false;
}
-HANDLE CSkypeProto::AddDBEvent(HANDLE hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+HANDLE CSkypeProto::AddDBEvent(HCONTACT 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);
- HANDLE hContact = this->AddContact(contact);
+ HCONTACT 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(HANDLE hContact, DWORD timestamp, SEBinary &guid, const char *message, bool isUnread)
+void CSkypeProto::RaiseMessageSentEvent(HCONTACT 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 9eeb4bd25c..b0dd1f5802 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;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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((HANDLE)lParam, ::GetDlgItem(hwndDlg, IDC_TIMEZONE), TZF_PLF_CB);
+ tmi.prepareList((HCONTACT)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 e86de2e396..7e399ba829 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)lParam)) && lParam)
+ if ((!this->IsProtoContact((HCONTACT)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;
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 37a465481d..264f6e14c2 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(HANDLE hContact)
+CSkypeProto* CSkypeProto::GetContactInstance(HCONTACT 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 f8083bb3e7..52849b5efd 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if ( !hContact)
return 0;
@@ -66,19 +66,19 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
template<int (__cdecl CSkypeProto::*Service)(WPARAM, LPARAM)>
INT_PTR GlobalService(WPARAM wParam, LPARAM lParam)
{
- CSkypeProto *ppro = CSkypeProto::GetContactInstance((HANDLE)wParam);
+ CSkypeProto *ppro = CSkypeProto::GetContactInstance((HCONTACT)wParam);
return ppro ? (ppro->*Service)(wParam, lParam) : 0;
}
int CSkypeProto::RequestAuth(WPARAM wParam, LPARAM lParam)
{
- return this->AuthRequest((HANDLE)wParam, LPGENT("Hi! I\'d like to add you to my contact list"));
+ return this->AuthRequest((HCONTACT)wParam, LPGENT("Hi! I\'d like to add you to my contact list"));
}
int CSkypeProto::GrantAuth(WPARAM wParam, LPARAM lParam)
{
CContact::Ref contact;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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((HANDLE)wParam);
+ CSkypeProto* ppro = CSkypeProto::GetContactInstance((HCONTACT)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 d0e4ea81da..f82b89cb9e 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);
- HANDLE hContact = this->AddContact(author, true);
+ HCONTACT 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));
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT 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);
- HANDLE hContact = this->AddContact(author);
+ HCONTACT 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);
- HANDLE hContact = this->AddContact(author);
+ HCONTACT 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(HANDLE hContact, time_t timestamp)
+void CSkypeProto::SyncHistoryCommand(HCONTACT 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((HANDLE)wParam, timestamp);
+ this->SyncHistoryCommand((HCONTACT)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((HANDLE)wParam, timestamp);
+ this->SyncHistoryCommand((HCONTACT)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((HANDLE)wParam, timestamp);
+ this->SyncHistoryCommand((HCONTACT)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((HANDLE)wParam, timestamp);
+ this->SyncHistoryCommand((HCONTACT)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((HANDLE)wParam, timestamp);
+ this->SyncHistoryCommand((HCONTACT)wParam, timestamp);
return 0;
}
int CSkypeProto::SyncAllTimeHistoryCommand(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact)
{
ptrW sid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID));
@@ -312,4 +312,4 @@ int CSkypeProto::SyncAllTimeHistoryCommand(WPARAM wParam, LPARAM lParam)
}
}
return 0;
-} \ No newline at end of file
+}
diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp
index bd59491c34..6c8cb4e96d 100644
--- a/protocols/Skype/src/skype_profile.cpp
+++ b/protocols/Skype/src/skype_profile.cpp
@@ -1,7 +1,7 @@
#include "skype.h"
#include <sstream>
-void CSkypeProto::UpdateProfileAvatar(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileAvatar(SEObject *obj, HCONTACT 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, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileAboutText(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileAboutText(SEObject *obj, HCONTACT hContact)
{
ptrW aboutText(::mir_utf8decodeW(obj->GetStrProp(/* *::P_ABOUT */ 18)));
if ( !::wcslen(aboutText))
@@ -59,7 +59,7 @@ void CSkypeProto::UpdateProfileAboutText(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "About", aboutText);
}
-void CSkypeProto::UpdateProfileBirthday(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileBirthday(SEObject *obj, HCONTACT hContact)
{
uint data = obj->GetUintProp(/* *::P_BIRTHDAY */ 7);
if (data > 0)
@@ -96,7 +96,7 @@ void CSkypeProto::UpdateProfileBirthday(SEObject *obj, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileCity(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileCity(SEObject *obj, HCONTACT hContact)
{
ptrW city(::mir_utf8decodeW(obj->GetStrProp(/* *::P_CITY */ 12)));
if ( !::wcslen(city))
@@ -105,7 +105,7 @@ void CSkypeProto::UpdateProfileCity(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "City", city);
}
-void CSkypeProto::UpdateProfileCountry(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileCountry(SEObject *obj, HCONTACT hContact)
{
char *country;
ptrA isocode(::mir_strdup(obj->GetStrProp(/* *::P_COUNTRY */ 10)));
@@ -118,7 +118,7 @@ void CSkypeProto::UpdateProfileCountry(SEObject *obj, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileEmails(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileEmails(SEObject *obj, HCONTACT hContact)
{
ptrW emails(::mir_utf8decodeW(obj->GetStrProp(/* *::P_EMAILS */ 16)));
if (::wcscmp(emails, L"") == 0)
@@ -141,7 +141,7 @@ void CSkypeProto::UpdateProfileEmails(SEObject *obj, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileFullName(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileFullName(SEObject *obj, HCONTACT hContact)
{
ptrW fullname(::mir_utf8decodeW(obj->GetStrProp(/* *::P_FULLNAME */ 5)));
if ( !::wcslen(fullname))
@@ -159,7 +159,7 @@ void CSkypeProto::UpdateProfileFullName(SEObject *obj, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileGender(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileGender(SEObject *obj, HCONTACT hContact)
{
uint data = obj->GetUintProp(/* *::P_GENDER */ 8);
if (data)
@@ -168,7 +168,7 @@ void CSkypeProto::UpdateProfileGender(SEObject *obj, HANDLE hContact)
this->delSetting(hContact, "Gender");
}
-void CSkypeProto::UpdateProfileHomepage(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileHomepage(SEObject *obj, HCONTACT hContact)
{
ptrW homepage(::mir_utf8decodeW(obj->GetStrProp(/* *::P_HOMEPAGE */ 17)));
if (::wcscmp(homepage, L"") == 0)
@@ -177,7 +177,7 @@ void CSkypeProto::UpdateProfileHomepage(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "Homepage", homepage);
}
-void CSkypeProto::UpdateProfileLanguages(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileLanguages(SEObject *obj, HCONTACT hContact)
{
ptrW isocodes(::mir_utf8decodeW(obj->GetStrProp(/* *::P_LANGUAGES */ 9)));
@@ -199,7 +199,7 @@ void CSkypeProto::UpdateProfileLanguages(SEObject *obj, HANDLE hContact)
}
}
-void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, HCONTACT hContact)
{
ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_MOBILE */ 15)));
if ( !::wcslen(phone))
@@ -208,7 +208,7 @@ void CSkypeProto::UpdateProfileMobilePhone(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "Cellular", phone);
}
-void CSkypeProto::UpdateProfileNick(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileNick(SEObject *obj, HCONTACT hContact)
{
ptrW nick;
if (hContact)
@@ -225,7 +225,7 @@ void CSkypeProto::UpdateProfileNick(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "Nick", nick);
}
-void CSkypeProto::UpdateProfilePhone(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfilePhone(SEObject *obj, HCONTACT hContact)
{
ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_MOBILE */ 13)));
if ( !::wcslen(phone))
@@ -234,7 +234,7 @@ void CSkypeProto::UpdateProfilePhone(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "Phone", phone);
}
-void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, HCONTACT hContact)
{
ptrW phone(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PHONE_OFFICE */ 14)));
if ( !::wcslen(phone))
@@ -243,7 +243,7 @@ void CSkypeProto::UpdateProfileOfficePhone(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "CompanyPhone", phone);
}
-void CSkypeProto::UpdateProfileState(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileState(SEObject *obj, HCONTACT hContact)
{
ptrW state(::mir_utf8decodeW(obj->GetStrProp(/* *::P_PROVINCE */ 11)));
if ( !::wcslen(state))
@@ -252,7 +252,7 @@ void CSkypeProto::UpdateProfileState(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "State", state);
}
-void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, HCONTACT hContact)
{
ptrW statusMessage(::mir_utf8decodeW(obj->GetStrProp(/* *::P_MOOD_TEXT */ 26)));
if ( !::wcslen(statusMessage))
@@ -261,7 +261,7 @@ void CSkypeProto::UpdateProfileStatusMessage(SEObject *obj, HANDLE hContact)
this->setTString(hContact, "XStatusMsg", statusMessage);
}
-void CSkypeProto::UpdateProfileTimezone(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfileTimezone(SEObject *obj, HCONTACT hContact)
{
LONG data = obj->GetUintProp(/* *::P_TIMEZONE */ 27);
if (data > 0)
@@ -286,7 +286,7 @@ void CSkypeProto::UpdateProfileTimezone(SEObject *obj, HANDLE hContact)
else this->delSetting(hContact, "Timezone");
}
-void CSkypeProto::UpdateProfile(SEObject *obj, HANDLE hContact)
+void CSkypeProto::UpdateProfile(SEObject *obj, HCONTACT 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 8c9308d78c..27aed96317 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -79,7 +79,7 @@ int __cdecl CSkypeProto::Authorize(HANDLE hDbEvent)
{
if (this->IsOnline() && hDbEvent)
{
- HANDLE hContact = this->GetContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -93,7 +93,7 @@ int __cdecl CSkypeProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
{
if (this->IsOnline())
{
- HANDLE hContact = this->GetContactFromAuthEvent(hDbEvent);
+ HCONTACT hContact = this->GetContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -103,7 +103,7 @@ int __cdecl CSkypeProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
return 1;
}
-int __cdecl CSkypeProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CSkypeProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
{
DWORD flags = 0;
@@ -124,7 +124,7 @@ int __cdecl CSkypeProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
return 0;
}
-int __cdecl CSkypeProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
+int __cdecl CSkypeProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage)
{
if (this->IsOnline() && hContact)
{
@@ -144,7 +144,7 @@ int __cdecl CSkypeProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
HANDLE __cdecl CSkypeProto::ChangeInfo( int iInfoType, void* pInfoData ) { return 0; }
-HANDLE __cdecl CSkypeProto::FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath )
+HANDLE __cdecl CSkypeProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath )
{
uint oid = (uint)hTransfer;
@@ -193,7 +193,7 @@ HANDLE __cdecl CSkypeProto::FileAllow( HANDLE hContact, HANDLE hTransfer, const
return hTransfer;
}
-int __cdecl CSkypeProto::FileCancel( HANDLE hContact, HANDLE hTransfer )
+int __cdecl CSkypeProto::FileCancel(HCONTACT hContact, HANDLE hTransfer )
{
uint oid = (uint)hTransfer;
@@ -217,7 +217,7 @@ int __cdecl CSkypeProto::FileCancel( HANDLE hContact, HANDLE hTransfer )
return 1;
}
-int __cdecl CSkypeProto::FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason )
+int __cdecl CSkypeProto::FileDeny(HCONTACT 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, HANDLE hContact)
+DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, HCONTACT hContact)
{
switch(type)
{
@@ -318,7 +318,7 @@ DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, HANDLE hContact)
}
}
-int __cdecl CSkypeProto::GetInfo( HANDLE hContact, int infoType ) { return 0; }
+int __cdecl CSkypeProto::GetInfo(HCONTACT 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( HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CSkypeProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre)
{
this->debugLogW(L"Incoming contacts");
::db_unset(hContact, "CList", "Hidden");
@@ -372,14 +372,14 @@ int __cdecl CSkypeProto::RecvContacts( HANDLE hContact, PROTORECVEVENT* pre)
(PBYTE)pre->szMessage);
}
-int __cdecl CSkypeProto::RecvFile( HANDLE hContact, PROTORECVFILET* pre)
+int __cdecl CSkypeProto::RecvFile(HCONTACT hContact, PROTORECVFILET* pre)
{
this->debugLogW(L"Incoming file transfer");
::db_unset(hContact, "CList", "Hidden");
return ::Proto_RecvFile(hContact, pre);
}
-int __cdecl CSkypeProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CSkypeProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
{
this->debugLogW(L"Incoming message");
::db_unset(hContact, "CList", "Hidden");
@@ -401,9 +401,9 @@ int __cdecl CSkypeProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
(PBYTE)message);
}
-int __cdecl CSkypeProto::RecvUrl(HANDLE hContact, PROTORECVEVENT *) { return 0; }
+int __cdecl CSkypeProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT *) { return 0; }
-int __cdecl CSkypeProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE *hContactsList)
+int __cdecl CSkypeProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
if (this->IsOnline() && hContact && hContactsList)
{
@@ -454,7 +454,7 @@ int __cdecl CSkypeProto::SendContacts(HANDLE hContact, int flags, int nContacts,
return 0;
}
-HANDLE __cdecl CSkypeProto::SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR **ppszFiles)
+HANDLE __cdecl CSkypeProto::SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles)
{
if (this->IsOnline() && hContact && ppszFiles)
{
@@ -525,7 +525,7 @@ HANDLE __cdecl CSkypeProto::SendFile(HANDLE hContact, const TCHAR *szDescription
return 0;
}
-int __cdecl CSkypeProto::SendMsg(HANDLE hContact, int flags, const char *msg)
+int __cdecl CSkypeProto::SendMsg(HCONTACT hContact, int flags, const char *msg)
{
this->debugLogW(L"Outcoming message");
SEStringList targets;
@@ -546,9 +546,9 @@ int __cdecl CSkypeProto::SendMsg(HANDLE hContact, int flags, const char *msg)
return 0;
}
-int __cdecl CSkypeProto::SendUrl(HANDLE hContact, int flags, const char *url) { return 0; }
+int __cdecl CSkypeProto::SendUrl(HCONTACT hContact, int flags, const char *url) { return 0; }
-int __cdecl CSkypeProto::SetApparentMode(HANDLE hContact, int mode) { return 0; }
+int __cdecl CSkypeProto::SetApparentMode(HCONTACT 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(HANDLE hContact) { return 0; }
-int __cdecl CSkypeProto::RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT *evt) { return 0; }
+HANDLE __cdecl CSkypeProto::GetAwayMsg(HCONTACT hContact) { return 0; }
+int __cdecl CSkypeProto::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 0; }
int __cdecl CSkypeProto::SetAwayMsg(int m_iStatus, const TCHAR *msg) { return 0; }
-int __cdecl CSkypeProto::UserIsTyping(HANDLE hContact, int type)
+int __cdecl CSkypeProto::UserIsTyping(HCONTACT 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 8534c395e1..761607c9c4 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -26,12 +26,12 @@ struct ContactParam
struct BlockParam
{
- HANDLE hContact;
+ HCONTACT hContact;
CSkypeProto *ppro;
bool remove;
bool abuse;
- BlockParam(HANDLE hContact, CSkypeProto *ppro) : ppro(ppro)
+ BlockParam(HCONTACT hContact, CSkypeProto *ppro) : ppro(ppro)
{
this->hContact = hContact;
}
@@ -184,18 +184,18 @@ public:
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason );
+ 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 int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const 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( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode( HANDLE hContact, int mode );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode );
virtual int __cdecl SetStatus( int iNewStatus );
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type );
virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
@@ -228,7 +228,7 @@ public:
static CSkypeProto* InitSkypeProto(const char* protoName, const wchar_t* userName);
static int UninitSkypeProto(CSkypeProto* ppro);
- static CSkypeProto* GetContactInstance(HANDLE hContact);
+ static CSkypeProto* GetContactInstance(HCONTACT hContact);
static void UninitInstances();
// icons
@@ -321,9 +321,9 @@ protected:
INT_PTR __cdecl SetMyNickName(WPARAM, LPARAM);
// avatars
- bool IsAvatarChanged(const SEBinary &avatar, HANDLE hContact = NULL);
+ bool IsAvatarChanged(const SEBinary &avatar, HCONTACT hContact = NULL);
- wchar_t* GetContactAvatarFilePath(HANDLE hContact);
+ wchar_t* GetContactAvatarFilePath(HCONTACT 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(HANDLE hContact, time_t timestamp);
+ void SyncHistoryCommand(HCONTACT 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(HANDLE hItem, HWND hwndList, const StringList &contacts);
- void ChatPrepare(HANDLE hItem, HWND hwndList, const StringList &contacts);
+ void ChatValidateContact(HCONTACT hItem, HWND hwndList, const StringList &contacts);
+ void ChatPrepare(HCONTACT hItem, HWND hwndList, const StringList &contacts);
- void GetInvitedContacts(HANDLE hItem, HWND hwndList, StringList &invitedContacts);
+ void GetInvitedContacts(HCONTACT hItem, HWND hwndList, StringList &invitedContacts);
void ChatRoomParseUriComands(const wchar_t *commands);
- void ChatRoomInvite(HANDLE hContact);
+ void ChatRoomInvite(HCONTACT hContact);
void CloseAllChatSessions();
@@ -391,11 +391,11 @@ protected:
OBJLIST<ChatRoom> chatRooms;
// contacts
- void UpdateContactAuthState(HANDLE hContact, const ContactRef &contact);
- void UpdateContactStatus(HANDLE hContact, const ContactRef &contact);
- void UpdateContactClient(HANDLE hContact, const ContactRef &contact);
- void UpdateContactOnlineSinceTime(HANDLE hContact, const ContactRef &contact);
- void UpdateContactLastEventDate(HANDLE hContact, const ContactRef &contact);
+ 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 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(HANDLE hContact);
- HANDLE GetContactBySid(const wchar_t* sid);
- HANDLE GetContactFromAuthEvent(HANDLE hEvent);
- HANDLE AddContact(CContact::Ref contact, bool isTemporary = false);
+ bool IsProtoContact(HCONTACT hContact);
+ HCONTACT GetContactBySid(const wchar_t* sid);
+ HCONTACT GetContactFromAuthEvent(HANDLE hEvent);
+ HCONTACT AddContact(CContact::Ref contact, bool isTemporary = false);
- bool IsContactOnline(HANDLE hContact);
+ bool IsContactOnline(HCONTACT hContact);
void SetAllContactStatus(int status);
void __cdecl LoadContactList(void*);
@@ -420,25 +420,25 @@ protected:
void __cdecl SearchByEmailAsync(void*);
// profile
- void UpdateProfileAvatar(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileAboutText(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileBirthday(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileCity(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileCountry(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileEmails(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileFullName(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileGender(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileHomepage(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileLanguages(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileMobilePhone(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileNick(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfilePhone(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileOfficePhone(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileState(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileStatusMessage(SEObject *obj, HANDLE hContact = NULL);
- void UpdateProfileTimezone(SEObject *obj, HANDLE hContact = NULL);
-
- void UpdateProfile(SEObject *obj, HANDLE hContact = NULL);
+ 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 __cdecl LoadOwnInfo(void*);
@@ -456,8 +456,8 @@ protected:
static bool FileExists(wchar_t *path);
- static void ShowNotification(const wchar_t *message, int flags = 0, HANDLE hContact = NULL);
- static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, HANDLE hContact = NULL);
+ 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 CopyToClipboard(const wchar_t *text);
@@ -472,7 +472,7 @@ protected:
//
int SendBroadcast(int type, int result, HANDLE hProcess, LPARAM lParam);
- int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
+ int SendBroadcast(HCONTACT 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(HANDLE hContact, DWORD timestamp, SEBinary &guid, int flag = 0);
+ bool IsMessageInDB(HCONTACT hContact, DWORD timestamp, SEBinary &guid, int flag = 0);
- HANDLE AddDBEvent(HANDLE hContact, WORD type, DWORD time, DWORD flags = 0, DWORD cbBlob = 0, PBYTE pBlob = 0);
+ HANDLE AddDBEvent(HCONTACT hContact, WORD type, DWORD time, DWORD flags = 0, DWORD cbBlob = 0, PBYTE pBlob = 0);
void RaiseMessageSentEvent(
- HANDLE hContact,
+ HCONTACT 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 27be882ada..e95287b65b 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(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
+int CSkypeProto::SendBroadcast(HCONTACT 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, HANDLE hContact)
+void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, HCONTACT 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, HANDLE hContact)
+void CSkypeProto::ShowNotification(const wchar_t *message, int flags, HCONTACT hContact)
{
CSkypeProto::ShowNotification(::TranslateT(MODULE), message, flags, hContact);
}
diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp
index ead7b9ffc8..127f962792 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(HANDLE hContact) {
+HANDLE add_contextmenu(HCONTACT 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((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0))
+ if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (db_get_b((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) {
+ if (db_get_b((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
+ if (db_get_b((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
+ db_get_b((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
mi=SkypeOutHupItem();
db_free(&dbv);
} else {
mi=SkypeOutCallItem();
- if(!db_get((HANDLE)wParam,"UserInfo","MyPhone0",&dbv)) {
+ if(!db_get((HCONTACT)wParam,"UserInfo","MyPhone0",&dbv)) {
db_free(&dbv);
mi.flags=0;
}
@@ -306,16 +306,15 @@ int ClistDblClick(WPARAM wParam, LPARAM lParam) {
}
*/
-HANDLE find_contact(char *name) {
- char *szProto;
+HCONTACT find_contact(char *name)
+{
int tCompareResult;
- HANDLE hContact;
DBVARIANT dbv;
// already on list?
- for (hContact=(HANDLE)db_find_first();hContact != NULL;hContact=db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact=db_find_next(hContact))
{
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+ 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)
{
if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
@@ -327,16 +326,16 @@ HANDLE find_contact(char *name) {
}
return NULL;
}
-HANDLE find_contactT(TCHAR *name) {
- char *szProto;
+
+HCONTACT find_contactT(TCHAR *name)
+{
int tCompareResult;
- HANDLE hContact;
DBVARIANT dbv;
// already on list?
- for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact))
+ for (HCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact))
{
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+ 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)
{
if (db_get_ts(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
@@ -350,8 +349,9 @@ HANDLE find_contactT(TCHAR *name) {
}
-HANDLE add_contact(char *name, DWORD flags) {
- HANDLE hContact;
+HCONTACT add_contact(char *name, DWORD flags)
+{
+ HCONTACT hContact;
// already on list?
if (hContact=find_contact(name)) {
@@ -365,7 +365,7 @@ HANDLE add_contact(char *name, DWORD flags) {
// no, so add
LOG(("add_contact: Adding %s", name));
- hContact=(HANDLE)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
+ hContact=(HCONTACT)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 @@ HANDLE add_contact(char *name, DWORD flags) {
}
void logoff_contacts(BOOL bCleanup) {
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
DBVARIANT dbv={0};
diff --git a/protocols/SkypeClassic/src/contacts.h b/protocols/SkypeClassic/src/contacts.h
index 35a400c3e9..1cc71571a5 100644
--- a/protocols/SkypeClassic/src/contacts.h
+++ b/protocols/SkypeClassic/src/contacts.h
@@ -1,11 +1,14 @@
// Prototypes
-HANDLE add_contextmenu(HANDLE hContact);
-HANDLE find_contact(char *name);
-HANDLE find_contactT(TCHAR *name);
-HANDLE add_contact(char *name, DWORD flags);
+HANDLE add_contextmenu(HCONTACT hContact);
HANDLE add_mainmenu(void);
+
+HCONTACT find_contact(char *name);
+HCONTACT find_contactT(TCHAR *name);
+HCONTACT add_contact(char *name, DWORD flags);
+
CLISTMENUITEM HupItem(void);
CLISTMENUITEM CallItem(void);
+
void logoff_contacts(BOOL bCleanup);
int PrebuildContactMenu(WPARAM, LPARAM);
//int ClistDblClick(WPARAM, LPARAM); \ No newline at end of file
diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp
index 0a1ea0441b..dd38a9d990 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;
- HANDLE hContact;
+ HCONTACT hContact;
CONTACTINFO ci = {0};
TCHAR *twho;
@@ -165,10 +165,10 @@ void RemChatContact(gchat_contacts *gc, const TCHAR *who) {
}
}
-HANDLE find_chat(LPCTSTR chatname) {
+HCONTACT find_chat(LPCTSTR chatname) {
char *szProto;
int tCompareResult;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
@@ -187,10 +187,10 @@ HANDLE find_chat(LPCTSTR chatname) {
}
#ifdef _UNICODE
-HANDLE find_chatA(char *chatname) {
+HCONTACT find_chatA(char *chatname) {
char *szProto;
int tCompareResult;
- HANDLE hContact;
+ HCONTACT 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();
- HANDLE hContact = db_find_first(), hInvitedUser;
+ HCONTACT 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 = (HANDLE)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL);
+ hInvitedUser = (HCONTACT)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 (HANDLE hContact, GCHOOK *gch)
+static void KickUser (HCONTACT hContact, GCHOOK *gch)
{
char *ptr;
@@ -566,7 +566,7 @@ static void KickUser (HANDLE hContact, GCHOOK *gch)
void SetChatTopic(const TCHAR *szChatId, TCHAR *szTopic, BOOL bSet)
{
- HANDLE hContact = find_chat (szChatId);
+ HCONTACT 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: {
- HANDLE hContact;
+ HCONTACT 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: {
- HANDLE hContact = find_contactT(gch->ptszUID);
+ HCONTACT 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: {
- HANDLE hContact = find_contactT(gch->ptszUID);
+ HCONTACT 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
UNREFERENCED_PARAMETER(lParam);
@@ -837,7 +837,7 @@ INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam)
INT_PTR GCOnJoinChat(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
UNREFERENCED_PARAMETER(lParam);
diff --git a/protocols/SkypeClassic/src/gchat.h b/protocols/SkypeClassic/src/gchat.h
index 1b3cfcbe73..13ef26afe6 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 {
- HANDLE hContact;
+ HCONTACT 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);
-HANDLE find_chat(LPCTSTR chatname);
+HCONTACT find_chat(LPCTSTR chatname);
#ifdef _UNICODE
-HANDLE find_chatA(char *chatname);
+HCONTACT 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 20a75aaea5..49e0c528b7 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -123,7 +123,7 @@ typedef struct {
} fetchmsg_arg;
typedef struct {
- HANDLE hContact;
+ HCONTACT 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((HANDLE)wParam);
+ add_contextmenu((HCONTACT)wParam);
return 0;
}
@@ -280,7 +280,7 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
int retval;
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1;
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1;
retval=SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal);
db_free(&dbv);
if (retval) return 1;
@@ -288,7 +288,8 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) {
return 0;
}
-void GetInfoThread(HANDLE hContact) {
+void GetInfoThread(void *hContact)
+{
DBVARIANT dbv;
int i;
char *ptr;
@@ -301,10 +302,9 @@ void GetInfoThread(HANDLE hContact) {
char *pszProps[] = {
"BIRTHDAY", "COUNTRY", "SEX", "MOOD_TEXT", "TIMEZONE", "IS_VIDEO_CAPABLE"};
-
LOG (("GetInfoThread started."));
EnterCriticalSection (&QueryThreadMutex);
- if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (db_get_s((HCONTACT)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(HANDLE 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, SKYPE_PROTONAME, "Nick", ptr);
+ db_set_utf((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", ptr);
bSetNick = TRUE;
}
free (ptr);
@@ -328,7 +328,7 @@ void GetInfoThread(HANDLE hContact) {
if (!bSetNick) {
// Still no nick set, so use SKYPE Nickname
- db_set_s(hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal);
+ db_set_s((HCONTACT)hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal);
}
@@ -345,7 +345,7 @@ void GetInfoThread(HANDLE hContact) {
ACKDATA ack = {0};
ack.cbSize = sizeof( ACKDATA );
ack.szModule = SKYPE_PROTONAME;
- ack.hContact = hContact;
+ ack.hContact = (HCONTACT)hContact;
ack.type = ACKTYPE_AVATAR;
ack.result = ACKRESULT_STATUS;
@@ -359,13 +359,14 @@ void GetInfoThread(HANDLE hContact) {
if (ptr=SkypeGet ("USER", dbv.pszVal, m_settings[i].SkypeSetting)) free (ptr);
}
- ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(SKYPE_PROTONAME, (HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
LeaveCriticalSection(&QueryThreadMutex);
db_free(&dbv);
LOG (("GetInfoThread terminated gracefully."));
}
-time_t SkypeTime(time_t *timer) {
+time_t SkypeTime(time_t *timer)
+{
struct _timeb tb;
EnterCriticalSection (&TimeMutex);
@@ -448,11 +449,11 @@ INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam) {
UNREFERENCED_PARAMETER(lParam);
- if (db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0;
+ if (db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) {
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0;
SkypeSend ("GET CHAT %s CHATMESSAGES", dbv.pszVal);
} else {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0;
+ if (db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0;
SkypeSend("SEARCH %sS %s", cmdMessage, dbv.pszVal);
}
db_free(&dbv);
@@ -500,7 +501,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) {
while (token) {
CCSDATA ccs={0};
PROTORECVEVENT pre={0};
- HANDLE hContact;
+ HCONTACT hContact;
char *firstname=NULL, *lastname=NULL, *pCurBlob;
LOG(("Awaiting auth: %s", token));
@@ -512,7 +513,7 @@ void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) {
pre.timestamp=(DWORD)SkypeTime(NULL);
/* blob is: */
- //DWORD protocolSpecific HANDLE hContact
+ //DWORD protocolSpecific HCONTACT hContact
//ASCIIZ nick, firstName, lastName, e-mail, requestReason
if (firstname=SkypeGet("USER", token, "FULLNAME"))
if (lastname=strchr(firstname, ' ')) {
@@ -869,9 +870,10 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
char *ptr, *msgptr, szPartnerHandle[32], szBuf[128];
int direction=0, msglen = 0;
DWORD timestamp = 0, lwr=0;
- CCSDATA ccs={0};
- PROTORECVEVENT pre={0};
- HANDLE hContact = NULL, hDbEvent, hChat = NULL;
+ CCSDATA ccs={0};
+ PROTORECVEVENT pre={0};
+ HCONTACT hContact = NULL, hChat = NULL;
+ HANDLE hDbEvent;
DBEVENTINFO dbei={0};
DBVARIANT dbv={0};
fetchmsg_arg args;
@@ -1033,7 +1035,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
free_nonutf_tchar_string((void*)gcd.ptszID);
if (!args.bDontMarkSeen)
{
- MsgList_Add (pre.lParam, INVALID_HANDLE_VALUE);
+ MsgList_Add(pre.lParam, INVALID_HANDLE_VALUE);
SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
}
__leave;
@@ -1271,7 +1273,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
// Check if the timestamp is valid
dbei.cbSize=sizeof(dbei);
dbei.cbBlob=0;
- if (hDbEvent=db_event_first(hContact)) {
+ if (hDbEvent = db_event_first(hContact)) {
db_event_get(hDbEvent,&dbei);
lwr=dbei.timestamp;
}
@@ -1306,7 +1308,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) {
if (db_get_b(hContact, "MetaContacts", "IsSubcontact", 0))
{
DWORD dwMetaLink = db_get_dw(hContact, "MetaContacts", "MetaLink", MAXDWORD);
- HANDLE hMetaContact;
+ HCONTACT hMetaContact;
if (dwMetaLink != MAXDWORD && (hMetaContact = GetMetaHandle(dwMetaLink)))
{
@@ -1361,8 +1363,8 @@ void FetchMessageThreadSync(fetchmsg_arg *pargs) {
/*
if (pargs->bIsRead && pMsgEvent->hEvent != INVALID_HANDLE_VALUE)
{
- HANDLE hContact;
- if ((int)(hContact = (HANDLE)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1)
+ HCONTACT hContact;
+ if ((int)(hContact = (HCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1)
CallService (MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDBEvent);
}
*/
@@ -1416,9 +1418,10 @@ char *GetCallerHandle(char *szSkypeMsg) {
}
-HANDLE GetCallerContact(char *szSkypeMsg) {
+HCONTACT GetCallerContact(char *szSkypeMsg)
+{
char *szHandle;
- HANDLE hContact=NULL;
+ HCONTACT hContact=NULL;
if (!(szHandle=GetCallerHandle(szSkypeMsg))) return NULL;
if (!(hContact=find_contact(szHandle))) {
@@ -1438,17 +1441,15 @@ HANDLE GetCallerContact(char *szSkypeMsg) {
return hContact;
}
-HANDLE GetMetaHandle(DWORD dwId) {
- HANDLE hContact;
- char *szProto;
-
- for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+HCONTACT GetMetaHandle(DWORD dwId)
+{
+ for (HCONTACT 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)
- return hContact;
- }
- return 0;
+ return hContact;
+ }
+ return 0;
}
LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
@@ -1476,7 +1477,7 @@ LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
}
void RingThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
DBEVENTINFO dbei={0};
DBVARIANT dbv;
char *ptr = NULL;
@@ -1604,7 +1605,8 @@ l_exitRT:
}
void EndCallThread(char *szSkypeMsg) {
- HANDLE hContact=NULL, hDbEvent;
+ HCONTACT hContact=NULL;
+ HANDLE hDbEvent;
DBEVENTINFO dbei={0};
DBVARIANT dbv;
int tCompareResult;
@@ -1640,7 +1642,7 @@ void EndCallThread(char *szSkypeMsg) {
if (!HasVoiceService()) {
dbei.cbSize=sizeof(dbei);
- hDbEvent=db_event_firstUnread(hContact);
+ hDbEvent = db_event_firstUnread(hContact);
while(hDbEvent) {
dbei.cbBlob=0;
db_event_get(hDbEvent, &dbei);
@@ -1666,7 +1668,7 @@ void EndCallThread(char *szSkypeMsg) {
}
void HoldCallThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
LOG(("HoldCallThread started"));
if (!szSkypeMsg) {
@@ -1682,7 +1684,7 @@ void HoldCallThread(char *szSkypeMsg) {
}
void ResumeCallThread(char *szSkypeMsg) {
- HANDLE hContact;
+ HCONTACT hContact;
LOG(("ResumeCallThread started"));
if (!szSkypeMsg) {
@@ -1740,7 +1742,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam)
static char *onlinestatus=NULL;
static BOOL RestoreUserStatus=FALSE;
int sstat, oldstatus, flag;
- HANDLE hContact;
+ HCONTACT hContact;
fetchmsg_arg *args;
static int iReentranceCnt = 0;
@@ -2088,7 +2090,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam)
} else
if (strncmp(ptr, " FRIENDLYNAME ", 14) == 0) {
// Chat session name
- HANDLE hContact;
+ HCONTACT hContact;
*ptr=0;
if (hContact = find_chatA(szSkypeMsg+5))
@@ -2356,7 +2358,7 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam)
return iRet;
}
-int __stdcall SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
+int __stdcall SendBroadcast( HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
{
ACKDATA ack = {0};
ack.cbSize = sizeof( ACKDATA );
@@ -2369,14 +2371,14 @@ int __stdcall SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProc
return CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack );
}
-static void __cdecl SkypeGetAwayMessageThread( HANDLE hContact )
+static void __cdecl SkypeGetAwayMessageThread(void *hContact)
{
DBVARIANT dbv;
- if ( !db_get_ts( hContact, "CList", "StatusMsg", &dbv )) {
- SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal );
+ if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv )) {
+ SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal );
db_free( &dbv );
}
- else SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 );
+ else SendBroadcast((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 );
}
INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam)
@@ -2385,7 +2387,7 @@ INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam)
UNREFERENCED_PARAMETER(wParam);
- pthread_create( SkypeGetAwayMessageThread, ccs->hContact );
+ pthread_create(SkypeGetAwayMessageThread, ccs->hContact);
return 1;
}
@@ -2447,7 +2449,8 @@ static int _GetFileSize(char* filename)
*/
void RetrieveUserAvatar(void *param)
{
- HANDLE hContact = (HANDLE) param, file;
+ HCONTACT hContact = (HCONTACT) param;
+ HANDLE file;
PROTO_AVATAR_INFORMATION AI={0};
ACKDATA ack = {0};
DBVARIANT dbv;
@@ -2774,7 +2777,7 @@ INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam)
INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv={0};
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (protocol<5 && !bIsImoproxy) return 0;
if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv)) {
@@ -2890,7 +2893,7 @@ INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam) {
if (pBlob=__skypeauth(wParam))
{
- HANDLE hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam));
+ HCONTACT hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam));
free(pBlob);
if (hContact) return (int)hContact;
}
@@ -2911,7 +2914,7 @@ INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam) {
void CleanupNicknames(char *dummy) {
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
DBVARIANT dbv, dbv2;
@@ -3011,7 +3014,7 @@ int EnumOldPluginName(const char *szSetting,LPARAM lParam)
// 0 --> No
int AnySkypeusers(void)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
int tCompareResult;
@@ -3036,7 +3039,7 @@ int AnySkypeusers(void)
DBCONTACTENUMSETTINGS cns;
DBCONTACTWRITESETTING cws;
DBVARIANT dbv;
- HANDLE hContact=NULL;
+ HCONTACT 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 3c7fd2b927..83021b91c6 100644
--- a/protocols/SkypeClassic/src/skype.h
+++ b/protocols/SkypeClassic/src/skype.h
@@ -140,7 +140,7 @@ int ShowMessageA(int iconID, char *lpzText, int mustShow);
#define ShowMessageA ShowMessage
#endif
void EndCallThread(char *);
-void GetInfoThread(HANDLE);
+void GetInfoThread(void *);
int OnDetailsInit( WPARAM, LPARAM );
INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam);
INT_PTR SkypeGetAvatarCaps(WPARAM wParam,LPARAM lParam);
@@ -172,7 +172,7 @@ int __stdcall EnterBitmapFileName( char* szDest );
void CleanupNicknames(char *dummy);
int InitVSApi();
int FreeVSApi();
-HANDLE GetMetaHandle(DWORD dwId);
+HCONTACT GetMetaHandle(DWORD dwId);
void LaunchSkypeAndSetStatusThread(void *newStatus);
// Structs
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp
index c7d8ab8010..84e886b61a 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, HANDLE hContact, DWORD maxwait)
+char *SkypeRcvMsg(char *what, time_t st, HCONTACT 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((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
res = -1; // no direct return, because dbv needs to be freed
} else {
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
+ if (db_get_s((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)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((HANDLE)wParam, SKYPE_PROTONAME, "CallId");
+ db_unset((HCONTACT)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 HANDLE hContact;
+ static HCONTACT hContact;
static unsigned int entries=0;
BOOL TempAdded=FALSE;
char number[64], *msg, *ptr=NULL;
switch (uMsg){
case WM_INITDIALOG:
- hContact=(HANDLE)lParam;
+ hContact=(HCONTACT)lParam;
Utils_RestoreWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "DIALdlg");
TranslateDialogDefault(hwndDlg);
@@ -810,10 +810,10 @@ static INT_PTR CALLBACK CallstatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
switch (uMsg){
case WM_INITDIALOG:
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
- if (!db_get_s((HANDLE)lParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (!db_get_s((HCONTACT)lParam, SKYPE_PROTONAME, "CallId", &dbv)) {
// Check, if another call is in progress
for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) {
@@ -928,7 +928,7 @@ INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
int res = -1;
- if (wParam && !db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
+ if (wParam && !db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
res=SkypeSend("SET %s STATUS FINISHED", dbv.pszVal);
pthread_create(( pThreadFunc )SkypeOutCallErrorCheck, _strdup(dbv.pszVal));
db_free(&dbv);
@@ -948,10 +948,10 @@ INT_PTR SkypeHoldCall(WPARAM wParam, LPARAM lParam) {
int retval;
LOG(("SkypeHoldCall started"));
- if (!wParam || db_get_s((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv))
+ if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv))
return -1;
retval = SkypeSend ("SET %s STATUS %s", dbv.pszVal,
- db_get_b((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD");
+ db_get_b((HCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD");
db_free(&dbv);
return retval;
}
@@ -1146,7 +1146,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
int retval;
- if (!wParam || db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (!wParam || db_get_s((HCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
return -1;
retval=SkypeSend("OPEN FILETRANSFER %s", dbv.pszVal);
db_free(&dbv);
@@ -1163,7 +1163,7 @@ INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) {
*/
INT_PTR SkypeChatCreate(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
- HANDLE hContact=(HANDLE)wParam;
+ HCONTACT hContact=(HCONTACT)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 fa4f5139a1..0d3f661dcb 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, HANDLE hContact, DWORD maxwait);
+char *SkypeRcvMsg(char *what, time_t st, HCONTACT 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 75b90967f2..8b90c78780 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:
{
- HANDLE hContact;
+ HCONTACT 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};
- HANDLE hContact = ( HANDLE )lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
odp.cbSize = sizeof(odp);
odp.hIcon = NULL;
diff --git a/protocols/SkypeClassic/src/voiceservice.cpp b/protocols/SkypeClassic/src/voiceservice.cpp
index 2a22bbe86c..11b1f1becd 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(HANDLE hContact, char *callId, int state)
+void NofifyVoiceService(HCONTACT hContact, char *callId, int state)
{
VOICE_CALL vc = {0};
vc.cbSize = sizeof(vc);
@@ -42,7 +42,7 @@ static INT_PTR VoiceGetInfo(WPARAM wParam, LPARAM lParam)
static HANDLE FindContactByCallId(char *callId)
{
- HANDLE hContact;
+ HCONTACT hContact;
int iCmpRes;
for (hContact = db_find_first();
hContact != NULL;
@@ -73,7 +73,7 @@ static INT_PTR VoiceCall(WPARAM wParam, LPARAM lParam)
if (!wParam) return -1;
- if (db_get_s((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
+ if (db_get_s((HCONTACT)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 0ffbd6d9ca..fce03545d2 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(HANDLE hContact, char *callId, int state) ;
+void NofifyVoiceService(HCONTACT hContact, char *callId, int state) ;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 0bf2926e3e..377d52f43c 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
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 9748f47742..e9ad52b64a 100644
--- a/protocols/Tlen/src/tlen.h
+++ b/protocols/Tlen/src/tlen.h
@@ -223,18 +223,18 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
@@ -242,24 +242,24 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT 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{
- HANDLE hContact;
+ HCONTACT 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, ...);
-HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid);
-char *TlenJIDFromHContact(TlenProtocol *proto, HANDLE hContact);
+HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid);
+char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT 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, HANDLE hContact, DWORD flags, const char *message);
+void TlenLogMessage(TlenProtocol *proto, HCONTACT 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, HANDLE hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob);
+void TlenDBAddEvent(TlenProtocol *proto, HCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob);
void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick);
-HANDLE TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary);
+HCONTACT 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 aea83f9804..f413b277ec 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, HANDLE hContact) {
+static void RemoveAvatar(TlenProtocol *proto, HCONTACT hContact) {
TCHAR tFileName[ MAX_PATH ];
if (hContact == NULL) {
proto->threadData->avatarHash[0] = '\0';
@@ -77,7 +77,7 @@ static void RemoveAvatar(TlenProtocol *proto, HANDLE hContact) {
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
-static void SetAvatar(TlenProtocol *proto, HANDLE hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format) {
+static void SetAvatar(TlenProtocol *proto, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT 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) {
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
} TLENGETAVATARTHREADDATA;
static void TlenGetAvatarThread(void *ptr) {
@@ -234,7 +234,7 @@ static void TlenGetAvatarThread(void *ptr) {
NETLIBHTTPREQUEST req;
NETLIBHTTPREQUEST *resp;
TLENGETAVATARTHREADDATA *data = (TLENGETAVATARTHREADDATA *)ptr;
- HANDLE hContact = data->hContact;
+ HCONTACT 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, HANDLE hContact) {
+void TlenGetAvatar(TlenProtocol *proto, HCONTACT 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 1db81cd3a7..c0bbfaa086 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, HANDLE hContact);
+void TlenGetAvatar(TlenProtocol *proto, HCONTACT 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 c74cfdde1a..74181bd9c3 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;
- HANDLE hContact;
+ HCONTACT hContact;
char *jid, *name, *nick;
int i;
char *str;
@@ -76,7 +76,7 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
str = TlenXmlGetAttrValue(itemNode, "subscription");
if (!strcmp(str, "remove")) {
- if ((hContact=TlenHContactFromJID(proto, jid)) != NULL) {
+ if ((hContact = TlenHContactFromJID(proto, jid)) != NULL) {
if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
}
@@ -165,7 +165,7 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode)
nick = TlenLocalNickFromJID(jid);
if (nick != NULL) {
- HANDLE hContact;
+ HCONTACT 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 (HANDLE hContact = db_find_first(proto->m_szModuleName); hContact; ) {
- HANDLE hNext = hContact = db_find_next(hContact, proto->m_szModuleName);
+ for (HCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; ) {
+ HCONTACT 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];
- HANDLE hContact;
+ HCONTACT hContact;
char *nText;
// TlenLog("<iq/> 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) {
- HANDLE hContact;
+ HCONTACT 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) {
- HANDLE hContact;
+ HCONTACT 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 ad62fbf4c3..670d014fc6 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, HANDLE hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob)
+void TlenDBAddEvent(TlenProtocol *proto, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) 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, HANDLE hContact)
+char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact)
{
char *p = NULL;
DBVARIANT dbv;
@@ -83,14 +83,14 @@ char *TlenJIDFromHContact(TlenProtocol *proto, HANDLE hContact)
return p;
}
-HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid)
+HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid)
{
DBVARIANT dbv;
char *p;
if (jid == NULL)
return NULL;
- for (HANDLE hContact = db_find_first(proto->m_szModuleName); hContact; hContact = db_find_next(hContact, proto->m_szModuleName)) {
+ for (HCONTACT 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 @@ HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid)
return NULL;
}
-HANDLE TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary)
+HCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (jid == NULL || jid[0] == '\0')
return NULL;
if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) 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 843d4f4c98..05d609947c 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];
- HANDLE hContact;
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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 (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
+ for (HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
if (!isOnline)
return 1;
- if ((hContact=(HANDLE) wParam) != NULL && isOnline) {
+ if ((hContact=(HCONTACT)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 3f0156f3f8..7f3f769ef2 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, HANDLE hContact) {
+BOOL SendPicture(TlenProtocol *proto, HCONTACT 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 178134007d..a15922a5a4 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 *, HANDLE hContact);
+BOOL SendPicture(TlenProtocol *, HCONTACT hContact);
#endif /* _TLEN_PICTURE_H */
diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp
index 617ec7e2ca..d37c9bcdc6 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)
{
- HANDLE hContact;
+ HCONTACT 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"));
- HANDLE hContact = TlenHContactFromJID(proto, ownJid);
+ HCONTACT 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 52ab263c8c..3eff4c7b86 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, HANDLE hContact)
+DWORD_PTR TlenProtocol::GetCaps(int type, HCONTACT 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 HANDLE AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags)
+static HCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags)
{
- HANDLE hContact;
+ HCONTACT hContact;
char *jid, *nick;
if ((hContact=TlenHContactFromJID(proto, newJid)) == NULL) {
// not already there: add
jid = mir_strdup(newJid); _strlwr(jid);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
if ((nick=TlenNickFromJID(newJid)) == NULL)
@@ -216,7 +216,7 @@ static HANDLE AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flag
HANDLE TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)
{
- HANDLE hContact;
+ HCONTACT hContact;
TLEN_SEARCH_RESULT *jsr = (TLEN_SEARCH_RESULT*)psr;
if (jsr->hdr.cbSize != sizeof(TLEN_SEARCH_RESULT))
return (int) NULL;
@@ -257,7 +257,7 @@ HANDLE TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent
char *lastName = firstName + strlen(firstName) + 1;
char *jid = lastName + strlen(lastName) + 1;
- HANDLE hContact = (HANDLE) AddToListByJID(this, jid, flags);
+ HCONTACT hContact = (HCONTACT) 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) {
- HANDLE hContact;
+ HCONTACT 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(HANDLE hContact, int infoType)
+int TlenProtocol::GetInfo(HCONTACT hContact, int infoType)
{
DBVARIANT dbv;
int iqId;
@@ -500,7 +500,7 @@ int TlenProtocol::GetInfo(HANDLE hContact, int infoType)
return 0;
}
-int TlenProtocol::SetApparentMode(HANDLE hContact, int mode)
+int TlenProtocol::SetApparentMode(HCONTACT hContact, int mode)
{
DBVARIANT dbv;
int oldMode;
@@ -539,12 +539,12 @@ int TlenProtocol::SetApparentMode(HANDLE hContact, int mode)
struct SENDACKTHREADDATA
{
- __inline SENDACKTHREADDATA(TlenProtocol *_ppro, HANDLE _hContact, int _msgid=0) :
+ __inline SENDACKTHREADDATA(TlenProtocol *_ppro, HCONTACT _hContact, int _msgid=0) :
proto(_ppro), hContact(_hContact), msgid(_msgid)
{}
TlenProtocol *proto;
- HANDLE hContact;
+ HCONTACT hContact;
int msgid;
};
@@ -599,7 +599,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr)
INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ( HANDLE )wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
if (isOnline && !db_get(hContact, m_szModuleName, "jid", &dbv)) {
TlenSend(this, "<m tp='a' to='%s'/>", dbv.pszVal);
@@ -609,7 +609,7 @@ INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam)
return 0;
}
-int TlenProtocol::SendMsg(HANDLE hContact, int flags, const char* msgRAW)
+int TlenProtocol::SendMsg(HCONTACT 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(HANDLE hContact)
+HANDLE TlenProtocol::GetAwayMsg(HCONTACT hContact)
{
SENDACKTHREADDATA *tdata = new SENDACKTHREADDATA(this, hContact, 0);
forkthread((void (__cdecl *)(void*))TlenGetAwayMsgThread, 0, (void*)tdata);
return (HANDLE)1;
}
-int TlenProtocol::RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt)
+int TlenProtocol::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt)
{
return 0;
}
-HANDLE TlenProtocol::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE TlenProtocol::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
TLEN_FILE_TRANSFER *ft;
TLEN_LIST_ITEM *item;
@@ -752,7 +752,7 @@ HANDLE TlenProtocol::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHA
return (HANDLE)hTransfer;
}
-int TlenProtocol::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+int TlenProtocol::FileDeny(HCONTACT 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(HANDLE hContact, HANDLE hTransfer)
+int TlenProtocol::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *) hTransfer;
debugLogA("Invoking FileCancel()");
@@ -794,7 +794,7 @@ int TlenProtocol::FileCancel(HANDLE hContact, HANDLE hTransfer)
return 0;
}
-HANDLE TlenProtocol::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE TlenProtocol::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
TLEN_FILE_TRANSFER *ft;
int i, j;
@@ -862,25 +862,25 @@ HANDLE TlenProtocol::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, P
return (HANDLE) ft;
}
-int TlenProtocol::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList){
+int TlenProtocol::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList){
return 0;
}
-int TlenProtocol::SendUrl(HANDLE hContact, int flags, const char* urlt){
+int TlenProtocol::SendUrl(HCONTACT hContact, int flags, const char* urlt){
return 0;
}
-int TlenProtocol::RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt)
{
return Proto_RecvMessage(hContact, evt);
}
-int TlenProtocol::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
+int TlenProtocol::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
{
return Proto_RecvFile(hContact, evt);
}
-int TlenProtocol::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int TlenProtocol::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 0;
}
@@ -904,12 +904,12 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam)
if (!isConnected) return 0;
if (!strcmp(cws->szModule, "CList")) {
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
char *szProto, *nick, *jid, *group;
- hContact = (HANDLE) wParam;
+ hContact = (HCONTACT) 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 = (HANDLE) wParam;
+// hContact = (HCONTACT) 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((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto == NULL || strcmp(szProto, m_szModuleName))
return 0;
DBVARIANT dbv;
- if (!db_get((HANDLE) wParam, m_szModuleName, "jid", &dbv)) {
+ if (!db_get((HCONTACT)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(HANDLE hContact, int type)
+int TlenProtocol::UserIsTyping(HCONTACT 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(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt)
{
return 1;
}
// PSS_AUTHREQUEST
-int TlenProtocol::AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage)
+int TlenProtocol::AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage)
{
return 1;
}
@@ -1217,7 +1217,7 @@ HANDLE TlenProtocol::ChangeInfo(int iInfoType, void* pInfoData)
}
-int TlenProtocol::RecvContacts(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt)
{
return 1;
}
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 00ec568e86..40ae861fcf 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 (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
+ for (HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT 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 825bbfe3c4..22ed3651e7 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;
- HANDLE hContact = (HANDLE) lParam;
+ HCONTACT hContact = (HCONTACT) 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;
- HANDLE hContact;
+ HCONTACT 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 = (HANDLE) lParam;
+ data->hContact = (HCONTACT) 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:
{
- HANDLE hContact = (HANDLE) ((LPPSHNOTIFY) lParam)->lParam;
+ HCONTACT hContact = (HCONTACT) ((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 5ac920336e..8f8837454b 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, HANDLE hContact, DWORD flags, const char *message)
+void TlenLogMessage(TlenProtocol *proto, HCONTACT 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 9739aa53a7..57cab89d2a 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)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
TLEN_FILE_TRANSFER *ft;
if (!isOnline)
return 1;
- if ((hContact=(HANDLE) wParam) != NULL) {
+ if ((hContact=(HCONTACT)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];
- HANDLE hContact;
+ HCONTACT 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 6867783ea0..df581c8586 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<DWORD>(update.status.time);
DBVARIANT nick;
- HANDLE hContact = UsernameToHContact(update.username.c_str());
+ HCONTACT 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(HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if( isChatRoom(hContact))
continue;
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp
index 938f9350ff..bb332624e4 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<typename T>
-inline static T db_pod_get(HANDLE hContact,const char *module,const char *setting,T errorValue)
+inline static T db_pod_get(HCONTACT 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(HANDLE hContact,const char *module,const char *settin
}
template<typename T>
-inline static INT_PTR db_pod_set(HANDLE hContact,const char *module,const char *setting,T val)
+inline static INT_PTR db_pod_set(HCONTACT 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(HANDLE hContact,const std::string &url) : hContact(hContact),url(url) {}
- HANDLE hContact;
+ update_avatar(HCONTACT hContact,const std::string &url) : hContact(hContact),url(url) {}
+ HCONTACT 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(HANDLE hContact,const std::string &url,bool force)
+void TwitterProto::UpdateAvatar(HCONTACT hContact,const std::string &url,bool force)
{
DBVARIANT dbv = {0};
@@ -493,7 +493,7 @@ void TwitterProto::UpdateFriends()
if(i->username == twit_.get_username())
continue;
- HANDLE hContact = AddToClientList(i->username.c_str(),i->status.text.c_str());
+ HCONTACT 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(HANDLE hContact,const std::string &text)
+void TwitterProto::ShowContactPopup(HCONTACT 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;
- HANDLE hContact = AddToClientList(i->username.c_str(),"");
+ HCONTACT 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)
{
- HANDLE hContact = AddToClientList(i->username.c_str(),"");
+ HCONTACT 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 f9772bf7b6..9a37a50284 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();
- HANDLE hContact = UsernameToHContact(name);
+ HCONTACT hContact = UsernameToHContact(name);
UpdateAvatar(hContact,user.profile_image_url);
}
catch(const std::exception &e)
@@ -60,7 +60,7 @@ void TwitterProto::UpdateInfoWorker(void *hContact)
std::string username;
DBVARIANT dbv;
- if(!db_get_s(hContact,m_szModuleName,TWITTER_KEY_UN,&dbv))
+ if (!db_get_s((HCONTACT)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,user.profile_image_url,true);
- ProtoBroadcastAck(hContact,ACKTYPE_GETINFO,ACKRESULT_SUCCESS,0,0);
+ UpdateAvatar((HCONTACT)hContact, user.profile_image_url, true);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, 0, 0);
}
-int TwitterProto::GetInfo(HANDLE hContact,int info_type)
+int TwitterProto::GetInfo(HCONTACT 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,"CList","StatusMsg",&dbv)) {
- ProtoBroadcastAck(hContact,ACKTYPE_AWAYMSG,ACKRESULT_SUCCESS, (HANDLE)1,(LPARAM)dbv.ptszVal);
+ if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv)) {
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
- else ProtoBroadcastAck(hContact,ACKTYPE_AWAYMSG,ACKRESULT_FAILED, (HANDLE)1,0);
+ else ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_FAILED, (HANDLE)1, 0);
}
-HANDLE TwitterProto::GetAwayMsg(HANDLE hContact)
+HANDLE TwitterProto::GetAwayMsg(HCONTACT hContact)
{
ForkThread(&TwitterProto::GetAwayMsgWorker, hContact);
return (HANDLE)1;
@@ -188,7 +188,7 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam)
if(m_iStatus != ID_STATUS_ONLINE)
return 0;
- const HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ const HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
if(!IsMyContact(hContact))
return 0;
@@ -208,7 +208,7 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam)
// *************************
-bool TwitterProto::IsMyContact(HANDLE hContact,bool include_chat)
+bool TwitterProto::IsMyContact(HCONTACT hContact,bool include_chat)
{
char *proto = GetContactProto(hContact);
if(proto && strcmp(m_szModuleName,proto) == 0) {
@@ -219,9 +219,9 @@ bool TwitterProto::IsMyContact(HANDLE hContact,bool include_chat)
else return false;
}
-HANDLE TwitterProto::UsernameToHContact(const char *name)
+HCONTACT TwitterProto::UsernameToHContact(const char *name)
{
- for(HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
{
if( db_get_b(hContact, m_szModuleName, "ChatRoom", 0))
continue;
@@ -242,10 +242,10 @@ HANDLE TwitterProto::UsernameToHContact(const char *name)
return 0;
}
-HANDLE TwitterProto::AddToClientList(const char *name,const char *status)
+HCONTACT TwitterProto::AddToClientList(const char *name, const char *status)
{
// First, check if this contact exists
- HANDLE hContact = UsernameToHContact(name);
+ HCONTACT hContact = UsernameToHContact(name);
if(hContact)
return hContact;
@@ -253,7 +253,7 @@ HANDLE TwitterProto::AddToClientList(const char *name,const char *status)
AddChatContact(name);
// If not, make a new contact!
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if(hContact)
{
if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0)
@@ -282,7 +282,7 @@ HANDLE TwitterProto::AddToClientList(const char *name,const char *status)
void TwitterProto::SetAllContactStatuses(int status)
{
- for(HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
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 d034fe6772..33b7a019ea 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,HANDLE)
+DWORD_PTR TwitterProto::GetCaps(int type, HCONTACT)
{
switch(type)
{
@@ -113,7 +113,7 @@ DWORD_PTR TwitterProto::GetCaps(int type,HANDLE)
// *************************
-int TwitterProto::RecvMsg(HANDLE hContact,PROTORECVEVENT *pre)
+int TwitterProto::RecvMsg(HCONTACT hContact,PROTORECVEVENT *pre)
{
Proto_RecvMessage(hContact, pre);
return 0;
@@ -123,11 +123,11 @@ int TwitterProto::RecvMsg(HANDLE hContact,PROTORECVEVENT *pre)
struct send_direct
{
- __inline send_direct(HANDLE _hContact, const std::string &_msg, int _msgid) :
+ __inline send_direct(HCONTACT _hContact, const std::string &_msg, int _msgid) :
hContact(_hContact), msg(_msg), msgid(_msgid)
{}
- HANDLE hContact;
+ HCONTACT hContact;
std::string msg;
int msgid;
};
@@ -151,7 +151,7 @@ void TwitterProto::SendSuccess(void *p)
delete data;
}
-int TwitterProto::SendMsg(HANDLE hContact,int flags,const char *msg)
+int TwitterProto::SendMsg(HCONTACT 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
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
HWND hDlg = CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_TWEET),0,tweet_proc,reinterpret_cast<LPARAM>(this));
@@ -264,7 +264,7 @@ INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam,LPARAM)
INT_PTR TwitterProto::VisitHomepage(WPARAM wParam,LPARAM)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
DBVARIANT dbv;
// TODO: remove this
@@ -398,7 +398,7 @@ int TwitterProto::OnPreShutdown(WPARAM,LPARAM)
int TwitterProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
if(IsMyContact(hContact))
ShowContactMenus(true);
@@ -495,8 +495,8 @@ void TwitterProto::UpdateSettings()
if(in_chat_)
OnLeaveChat(0,0);
- for(HANDLE hContact = db_find_first(m_szModuleName); hContact; ) {
- HANDLE hNext = db_find_next(hContact, m_szModuleName);
+ for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) {
+ HCONTACT hNext = db_find_next(hContact, m_szModuleName);
if(isChatRoom(hContact))
CallService(MS_DB_CONTACT_DELETE,reinterpret_cast<WPARAM>(hContact),0);
hContact = hNext;
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h
index ff10081aed..16739bbfc9 100644
--- a/protocols/Twitter/src/proto.h
+++ b/protocols/Twitter/src/proto.h
@@ -41,18 +41,18 @@ public:
virtual int __cdecl Authorize(HANDLE);
virtual int __cdecl AuthDeny(HANDLE,const TCHAR *);
- virtual int __cdecl AuthRecv(HANDLE,PROTORECVEVENT *);
- virtual int __cdecl AuthRequest(HANDLE,const TCHAR *);
+ virtual int __cdecl AuthRecv(HCONTACT, PROTORECVEVENT *);
+ virtual int __cdecl AuthRequest(HCONTACT, const TCHAR *);
virtual HANDLE __cdecl ChangeInfo(int,void *);
- virtual HANDLE __cdecl FileAllow(HANDLE,HANDLE,const TCHAR *);
- virtual int __cdecl FileCancel(HANDLE,HANDLE);
- virtual int __cdecl FileDeny(HANDLE,HANDLE,const TCHAR *);
- virtual int __cdecl FileResume(HANDLE,int *,const TCHAR **);
+ virtual HANDLE __cdecl FileAllow(HCONTACT, HANDLE, const TCHAR *);
+ virtual int __cdecl FileCancel(HCONTACT, HANDLE);
+ virtual int __cdecl FileDeny(HCONTACT, HANDLE, const TCHAR *);
+ virtual int __cdecl FileResume(HANDLE, int *, const TCHAR **);
- virtual DWORD_PTR __cdecl GetCaps(int,HANDLE = 0);
- virtual int __cdecl GetInfo(HANDLE,int);
+ virtual DWORD_PTR __cdecl GetCaps(int, HCONTACT = 0);
+ virtual int __cdecl GetInfo(HCONTACT, 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(HANDLE,PROTORECVEVENT *);
- virtual int __cdecl RecvFile(HANDLE,PROTORECVFILET *);
- virtual int __cdecl RecvMsg(HANDLE,PROTORECVEVENT *);
- virtual int __cdecl RecvUrl(HANDLE,PROTORECVEVENT *);
+ 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 SendContacts(HANDLE,int,int,HANDLE *);
- virtual HANDLE __cdecl SendFile(HANDLE,const TCHAR *,TCHAR **);
- virtual int __cdecl SendMsg(HANDLE,int,const char *);
- virtual int __cdecl SendUrl(HANDLE,int,const char *);
+ 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 SetApparentMode(HANDLE,int);
+ virtual int __cdecl SetApparentMode(HCONTACT, int);
virtual int __cdecl SetStatus(int);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE);
- virtual int __cdecl RecvAwayMsg(HANDLE,int,PROTORECVEVENT *);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT);
+ virtual int __cdecl RecvAwayMsg(HCONTACT, int, PROTORECVEVENT *);
virtual int __cdecl SetAwayMsg(int,const TCHAR *);
- virtual int __cdecl UserIsTyping(HANDLE,int);
+ virtual int __cdecl UserIsTyping(HCONTACT, 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(HANDLE,const std::string &,bool force=false);
+ void UpdateAvatar(HCONTACT, 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(HANDLE,const std::string &);
+ void ShowContactPopup(HCONTACT, const std::string &);
- bool IsMyContact(HANDLE,bool include_chat = false);
- HANDLE UsernameToHContact(const char *);
- HANDLE AddToClientList(const char *,const char *);
+ bool IsMyContact(HCONTACT, bool include_chat = false);
+ HCONTACT UsernameToHContact(const char *);
+ HCONTACT 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 da781eda1a..c62ae86147 100644
--- a/protocols/Twitter/src/stubs.cpp
+++ b/protocols/Twitter/src/stubs.cpp
@@ -32,12 +32,12 @@ int TwitterProto::AuthDeny(HANDLE hDbEvent,const TCHAR *reason)
return 1;
}
-int TwitterProto::AuthRecv(HANDLE hContact,PROTORECVEVENT *)
+int TwitterProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int TwitterProto::AuthRequest(HANDLE hContact,const TCHAR *message)
+int TwitterProto::AuthRequest(HCONTACT hContact,const TCHAR *message)
{
return 1;
}
@@ -48,17 +48,17 @@ HANDLE TwitterProto::ChangeInfo(int type,void *info_data)
return NULL;
}
-HANDLE TwitterProto::FileAllow(HANDLE hContact,HANDLE hTransfer,const TCHAR *path)
+HANDLE TwitterProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const TCHAR *path)
{
return NULL;
}
-int TwitterProto::FileCancel(HANDLE hContact,HANDLE hTransfer)
+int TwitterProto::FileCancel(HCONTACT hContact,HANDLE hTransfer)
{
return 1;
}
-int TwitterProto::FileDeny(HANDLE hContact,HANDLE hTransfer,const TCHAR *reason)
+int TwitterProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const TCHAR *reason)
{
return 1;
}
@@ -83,42 +83,42 @@ HWND TwitterProto::CreateExtendedSearchUI(HWND owner)
return NULL;
}
-int TwitterProto::RecvContacts(HANDLE hContact,PROTORECVEVENT *)
+int TwitterProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int TwitterProto::RecvFile(HANDLE hContact,PROTORECVFILET *)
+int TwitterProto::RecvFile(HCONTACT hContact,PROTORECVFILET *)
{
return 1;
}
-int TwitterProto::RecvUrl(HANDLE hContact,PROTORECVEVENT *)
+int TwitterProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int TwitterProto::SendContacts(HANDLE hContact,int flags,int nContacts,HANDLE *hContactsList)
+int TwitterProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
return 1;
}
-HANDLE TwitterProto::SendFile(HANDLE hContact,const TCHAR *desc, TCHAR **files)
+HANDLE TwitterProto::SendFile(HCONTACT hContact,const TCHAR *desc, TCHAR **files)
{
return NULL;
}
-int TwitterProto::SendUrl(HANDLE hContact,int flags,const char *url)
+int TwitterProto::SendUrl(HCONTACT hContact,int flags,const char *url)
{
return 1;
}
-int TwitterProto::SetApparentMode(HANDLE hContact,int mode)
+int TwitterProto::SetApparentMode(HCONTACT hContact,int mode)
{
return 1;
}
-int TwitterProto::RecvAwayMsg(HANDLE hContact,int mode,PROTORECVEVENT *evt)
+int TwitterProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt)
{
return 1;
}
@@ -128,7 +128,7 @@ int TwitterProto::SetAwayMsg(int status,const TCHAR *msg)
return 1;
}
-int TwitterProto::UserIsTyping(HANDLE hContact,int type)
+int TwitterProto::UserIsTyping(HCONTACT 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 196905b5aa..9d8de71c0e 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(HANDLE hContact)
+static TwitterProto * GetInstanceByHContact(HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if(!proto)
@@ -68,7 +68,7 @@ static TwitterProto * GetInstanceByHContact(HANDLE hContact)
template<INT_PTR (__cdecl TwitterProto::*Fcn)(WPARAM,LPARAM)>
INT_PTR GlobalService(WPARAM wParam,LPARAM lParam)
{
- TwitterProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ TwitterProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? (proto->*Fcn)(wParam,lParam) : 0;
}
@@ -76,7 +76,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
ShowContactMenus(false);
- TwitterProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ TwitterProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? proto->OnPrebuildContactMenu(wParam,lParam) : 0;
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp
index 97441b186f..91c5f96ec5 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
- HANDLE hContact = 0;
+ HCONTACT 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 a0d8a7abc8..b36ea81976 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 (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact))
SetChatStatus(hContact, iStatus);
else if (getWord(hContact, "Status", 0) != iStatus)
@@ -33,9 +33,9 @@ void CVkProto::SetAllContactStatuses(int iStatus)
}
}
-HANDLE CVkProto::FindUser(LONG dwUserid, bool bCreate)
+HCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
LONG dbUserid = getDword(hContact, "ID", -1);
if (dbUserid == -1)
continue;
@@ -47,7 +47,7 @@ HANDLE CVkProto::FindUser(LONG dwUserid, bool bCreate)
if (!bCreate)
return NULL;
- HANDLE hNewContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hNewContact = (HCONTACT)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 3784b08b8c..15c56ba41a 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(pReq->pUserInfo, AI.filename, SIZEOF(AI.filename));
+ GetAvatarFileName((HCONTACT)pReq->pUserInfo, AI.filename, SIZEOF(AI.filename));
AI.format = ProtoGetBufferFormat(reply->pData);
FILE *out = _tfopen(AI.filename, _T("wb"));
if (out == NULL) {
- ProtoBroadcastAck(pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
+ ProtoBroadcastAck((HCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
return;
}
fwrite(reply->pData, 1, reply->dataLength, out);
fclose(out);
- ProtoBroadcastAck(pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
+ ProtoBroadcastAck((HCONTACT)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(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
+void CVkProto::GetAvatarFileName(HCONTACT 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(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%d%s"), id, szFileType);
}
-void CVkProto::SetAvatarUrl(HANDLE hContact, LPCTSTR ptszUrl)
+void CVkProto::SetAvatarUrl(HCONTACT 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 686c3f667c..31b583c62c 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -55,7 +55,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, JSONNODE *pDlg)
GC_INFO gci = { 0 };
gci.pszModule = m_szModuleName;
gci.pszID = sid;
- gci.Flags = BYID | HCONTACT;
+ gci.Flags = GCF_BYID | GCF_HCONTACT;
CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci);
c->m_hContact = gci.hContact;
@@ -287,7 +287,7 @@ CVkChatUser* CVkChatInfo::GetUserById(LPCTSTR ptszId)
/////////////////////////////////////////////////////////////////////////////////////////
-void CVkProto::SetChatStatus(HANDLE hContact, int iStatus)
+void CVkProto::SetChatStatus(HCONTACT 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 (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
+ for (HCONTACT 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)
{
- HANDLE hContact;
+ HCONTACT hContact;
switch (gch->dwData) {
case IDM_TOPIC:
@@ -425,7 +425,7 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch)
break;
case IDM_INVITE:
- hContact = (HANDLE)DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INVITE), NULL, InviteDlgProc, (LPARAM)this);
+ hContact = (HCONTACT)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 (HANDLE hContact = FindUser(cu->m_uid))
+ if (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
+ for (HCONTACT 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 8c1baa072c..2a0bfb0a90 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, HANDLE hContact)
+DWORD_PTR CVkProto::GetCaps(int type, HCONTACT hContact)
{
switch(type) {
case PFLAGNUM_1:
@@ -135,7 +135,7 @@ DWORD_PTR CVkProto::GetCaps(int type, HANDLE hContact)
//////////////////////////////////////////////////////////////////////////////
-int CVkProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int CVkProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
Proto_RecvMessage(hContact, pre);
return 0;
@@ -145,11 +145,11 @@ int CVkProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
struct TFakeAckParams
{
- __inline TFakeAckParams(HANDLE _hContact, int _msgid) :
+ __inline TFakeAckParams(HCONTACT _hContact, int _msgid) :
hContact(_hContact), msgid(_msgid)
{}
- HANDLE hContact;
+ HCONTACT hContact;
int msgid;
};
@@ -161,7 +161,7 @@ void CVkProto::SendMsgAck(void *param)
delete ack;
}
-int CVkProto::SendMsg(HANDLE hContact, int flags, const char *msg)
+int CVkProto::SendMsg(HCONTACT 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(pReq->pData, ACKTYPE_MESSAGE, iResult, pReq->pUserInfo, 0);
+ ProtoBroadcastAck((HCONTACT)pReq->pData, ACKTYPE_MESSAGE, iResult, pReq->pUserInfo, 0);
pReq->pData = NULL;
}
@@ -278,7 +278,7 @@ HANDLE CVkProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return NULL;
}
-int CVkProto::AuthRequest(HANDLE hContact,const PROTOCHAR *message)
+int CVkProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message)
{
return 0;
}
@@ -295,7 +295,7 @@ int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason)
return 1;
}
-int CVkProto::UserIsTyping(HANDLE hContact, int type)
+int CVkProto::UserIsTyping(HCONTACT hContact, int type)
{
return 0;
}
@@ -305,7 +305,7 @@ HANDLE CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
return NULL;
}
-int CVkProto::AuthRecv(HANDLE hContact,PROTORECVEVENT *)
+int CVkProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
@@ -316,17 +316,17 @@ HANDLE CVkProto::ChangeInfo(int type,void *info_data)
return NULL;
}
-HANDLE CVkProto::FileAllow(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *path)
+HANDLE CVkProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path)
{
return NULL;
}
-int CVkProto::FileCancel(HANDLE hContact,HANDLE hTransfer)
+int CVkProto::FileCancel(HCONTACT hContact,HANDLE hTransfer)
{
return 1;
}
-int CVkProto::FileDeny(HANDLE hContact,HANDLE hTransfer,const PROTOCHAR *reason)
+int CVkProto::FileDeny(HCONTACT 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(HANDLE hContact, int infoType)
+int CVkProto::GetInfo(HCONTACT 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(HANDLE hContact,PROTORECVEVENT *)
+int CVkProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int CVkProto::RecvFile(HANDLE hContact,PROTORECVFILET *)
+int CVkProto::RecvFile(HCONTACT hContact,PROTORECVFILET *)
{
return 1;
}
-int CVkProto::RecvUrl(HANDLE hContact,PROTORECVEVENT *)
+int CVkProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *)
{
return 1;
}
-int CVkProto::SendContacts(HANDLE hContact,int flags,int nContacts,HANDLE *hContactsList)
+int CVkProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
return 1;
}
-HANDLE CVkProto::SendFile(HANDLE hContact,const PROTOCHAR *desc, PROTOCHAR **files)
+HANDLE CVkProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files)
{
return NULL;
}
-int CVkProto::SendUrl(HANDLE hContact,int flags,const char *url)
+int CVkProto::SendUrl(HCONTACT hContact,int flags,const char *url)
{
return 1;
}
-int CVkProto::SetApparentMode(HANDLE hContact,int mode)
+int CVkProto::SetApparentMode(HCONTACT hContact,int mode)
{
return 1;
}
-int CVkProto::RecvAwayMsg(HANDLE hContact,int mode,PROTORECVEVENT *evt)
+int CVkProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt)
{
return 1;
}
-HANDLE CVkProto::GetAwayMsg(HANDLE hContact)
+HANDLE CVkProto::GetAwayMsg(HCONTACT hContact)
{
return 0; // Status messages are disabled
}
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index b4906e97d5..7d247b2776 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;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
OBJLIST<CVkChatUser> m_users;
OBJLIST<CVkChatMessage> m_msgs;
@@ -121,18 +121,18 @@ struct CVkProto : public PROTO<CVkProto>
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason);
+ 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 int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
@@ -140,24 +140,24 @@ struct CVkProto : public PROTO<CVkProto>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTORECVFILET*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -259,10 +259,10 @@ private:
void OnLoggedOut();
void ShutdownSession();
- void SetAvatarUrl(HANDLE hContact, LPCTSTR ptszUrl);
- void GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen);
+ void SetAvatarUrl(HCONTACT hContact, LPCTSTR ptszUrl);
+ void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen);
- HANDLE FindUser(LONG userid, bool bCreate = false);
+ HCONTACT 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(HANDLE hContact, int iStatus);
+ void SetChatStatus(HCONTACT 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 d51b0e96e5..cac5aee537 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;
- HANDLE hContact;
+ HCONTACT 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<void> arContacts(10, PtrKeySortT);
if (bCleanContacts)
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
if (!isChatRoom(hContact))
arContacts.insert(hContact);
@@ -321,7 +321,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
continue;
CMString tszNick;
- HANDLE hContact = FindUser(_ttoi(szValue), true);
+ HCONTACT 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));
- HANDLE hContact = FindUser(uid, true);
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT 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 63551a953f..81fd154153 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()) {
- HANDLE hContact = this->ContactIDToHContact(chat_id);
+ HCONTACT 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 ead537fc1d..fb3a7bea5f 100644
--- a/protocols/WhatsApp/src/contacts.cpp
+++ b/protocols/WhatsApp/src/contacts.cpp
@@ -1,6 +1,6 @@
#include "common.h"
-bool WhatsAppProto::IsMyContact(HANDLE hContact, bool include_chat)
+bool WhatsAppProto::IsMyContact(HCONTACT hContact, bool include_chat)
{
const char *proto = GetContactProto(hContact);
if( proto && strcmp(m_szModuleName,proto) == 0 )
@@ -14,10 +14,10 @@ bool WhatsAppProto::IsMyContact(HANDLE hContact, bool include_chat)
return false;
}
-HANDLE WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool dont_check, const char *new_name,
+HCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool dont_check, const char *new_name,
bool isChatRoom, bool isHidden)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (!dont_check) {
// First, check if this contact exists
@@ -55,7 +55,7 @@ HANDLE WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool d
}
// If not, make a new contact!
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact)
{
if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) == 0)
@@ -111,33 +111,28 @@ HANDLE WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool d
else CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
}
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-HANDLE WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
+HCONTACT WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
{
// Cache
- std::map<string, HANDLE>::iterator it = this->hContactByJid.find(phoneNumber);
+ std::map<string, HCONTACT>::iterator it = this->hContactByJid.find(phoneNumber);
if (it != this->hContactByJid.end())
return it->second;
const char* idForContact = "ID";
const char* idForChat = "ChatRoomID";
- for(HANDLE hContact = db_find_first();
- hContact;
- hContact = db_find_next(hContact))
- {
- if(!IsMyContact(hContact, true))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ if (!IsMyContact(hContact, true))
continue;
const char* id = isChatRoom(hContact) ? idForChat : idForContact;
DBVARIANT dbv;
- if( !getString(hContact, id, &dbv))
- {
- if( strcmp(phoneNumber.c_str(),dbv.pszVal) == 0 )
- {
+ if (!getString(hContact, id, &dbv)) {
+ if (strcmp(phoneNumber.c_str(), dbv.pszVal) == 0) {
db_free(&dbv);
this->hContactByJid[phoneNumber] = hContact;
return hContact;
@@ -152,13 +147,10 @@ HANDLE WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
void WhatsAppProto::SetAllContactStatuses(int status, bool reset_client)
{
- for (HANDLE hContact = db_find_first();
- hContact;
- hContact = db_find_next(hContact))
- {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (!IsMyContact(hContact))
continue;
-
+
if (reset_client) {
DBVARIANT dbv;
if (!getTString(hContact, "MirVer", &dbv)) {
@@ -170,7 +162,7 @@ void WhatsAppProto::SetAllContactStatuses(int status, bool reset_client)
db_set_ws(hContact, "CList", "StatusMsg", _T(""));
}
- if (getWord(hContact, "Status",ID_STATUS_OFFLINE) != status)
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
setWord(hContact, "Status", status);
}
}
@@ -179,7 +171,7 @@ void WhatsAppProto::ProcessBuddyList(void*)
{
std::vector<std::string> jids;
DBVARIANT dbv;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (!IsMyContact(hContact))
continue;
@@ -227,7 +219,7 @@ void WhatsAppProto::SearchAckThread(void *targ)
void WhatsAppProto::onAvailable(const std::string& paramString, bool paramBoolean)
{
- HANDLE hContact = this->AddToContactList(paramString, 0, false);
+ HCONTACT hContact = this->AddToContactList(paramString, 0, false);
if (hContact != NULL)
{
if (paramBoolean)
@@ -254,7 +246,7 @@ void WhatsAppProto::onAvailable(const std::string& paramString, bool paramBoolea
void WhatsAppProto::onLastSeen(const std::string& paramString1, int paramInt, std::string* paramString2)
{
/*
- HANDLE hContact = this->ContactIDToHContact(paramString1);
+ HCONTACT hContact = this->ContactIDToHContact(paramString1);
if (hContact == NULL)
{
// This contact was searched
@@ -270,13 +262,13 @@ void WhatsAppProto::onLastSeen(const std::string& paramString1, int paramInt, st
// #TODO
}
*/
- HANDLE hContact = this->AddToContactList(paramString1, 0, false);
+ HCONTACT hContact = this->AddToContactList(paramString1, 0, false);
setDword(hContact, WHATSAPP_KEY_LAST_SEEN, paramInt);
this->UpdateStatusMsg(hContact);
}
-void WhatsAppProto::UpdateStatusMsg(HANDLE hContact)
+void WhatsAppProto::UpdateStatusMsg(HCONTACT hContact)
{
std::wstringstream ss;
@@ -312,7 +304,7 @@ void WhatsAppProto::onPictureChanged(const std::string& from, const std::string&
void WhatsAppProto::onSendGetPicture(const std::string& jid, const std::vector<unsigned char>& data, const std::string& oldId, const std::string& newId)
{
- HANDLE hContact = this->ContactIDToHContact(jid);
+ HCONTACT hContact = this->ContactIDToHContact(jid);
if (hContact)
{
debugLogA("Updating avatar for jid %s", jid.c_str());
@@ -350,7 +342,7 @@ void WhatsAppProto::onSendGetPictureIds(std::map<string,string>* ids)
{
for (std::map<string,string>::iterator it = ids->begin(); it != ids->end(); ++it)
{
- HANDLE hContact = this->AddToContactList(it->first);
+ HCONTACT hContact = this->AddToContactList(it->first);
if (hContact != NULL)
{
DBVARIANT dbv;
@@ -373,14 +365,14 @@ void WhatsAppProto::onSendGetPictureIds(std::map<string,string>* ids)
}
}
-string WhatsAppProto::GetContactDisplayName(HANDLE hContact)
+string WhatsAppProto::GetContactDisplayName(HCONTACT hContact)
{
return string((CHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0));
}
string WhatsAppProto::GetContactDisplayName(const string& jid)
{
- HANDLE hContact = this->ContactIDToHContact(jid);
+ HCONTACT hContact = this->ContactIDToHContact(jid);
return hContact ? this->GetContactDisplayName(hContact) : (string("+")+ Utilities::removeWaDomainFromJid(jid));
}
@@ -397,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());
- HANDLE hContact = ContactIDToHContact(gjid);
+ HCONTACT hContact = ContactIDToHContact(gjid);
if (!hContact)
{
debugLogA("Group info requested for non existing contact '%s'", gjid.c_str());
@@ -417,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());
- HANDLE hContact = this->AddToContactList(from, 0, false, newSubject.c_str(), true);
+ HCONTACT 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());
- HANDLE hContact = this->AddToContactList(paramString1);
+ HCONTACT hContact = this->AddToContactList(paramString1);
std::string groupName(this->GetContactDisplayName(hContact));
if (paramString2.compare(this->jid) == 0)
@@ -446,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());
- HANDLE hContact = this->ContactIDToHContact(paramString1);
+ HCONTACT hContact = this->ContactIDToHContact(paramString1);
if (!hContact)
return;
@@ -473,7 +465,7 @@ void WhatsAppProto::onLeaveGroup(const std::string& paramString)
{
// Won't be called for unknown reasons!
debugLogA("%s", this->GetContactDisplayName(paramString).c_str());
- HANDLE hContact = this->ContactIDToHContact(paramString);
+ HCONTACT hContact = this->ContactIDToHContact(paramString);
if (hContact)
setByte(hContact, "IsGroupMember", 0);
}
@@ -482,8 +474,7 @@ void WhatsAppProto::onGetParticipants(const std::string& gjid, const std::vector
{
debugLogA("%s", this->GetContactDisplayName(gjid).c_str());
- HANDLE hUserContact;
- HANDLE hContact = this->ContactIDToHContact(gjid);
+ HCONTACT hUserContact, hContact = this->ContactIDToHContact(gjid);
if (!hContact)
return;
@@ -534,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((HANDLE) wParam);
- string b = GetContactDisplayName((HANDLE) lParam);
+ string a = GetContactDisplayName((HCONTACT)wParam);
+ string b = GetContactDisplayName((HCONTACT)lParam);
debugLogA("Request add user %s to group %s", a.c_str(), b.c_str());
if (!this->isOnline())
@@ -543,14 +534,14 @@ INT_PTR __cdecl WhatsAppProto::OnAddContactToGroup(WPARAM wParam, LPARAM, LPARAM
DBVARIANT dbv;
- if (getString((HANDLE)wParam, "ID", &dbv))
+ if (getString((HCONTACT)wParam, "ID", &dbv))
return NULL;
std::vector<string> participants;
participants.push_back(string(dbv.pszVal));
db_free(&dbv);
- if (getString((HANDLE)lParam, "ID", &dbv))
+ if (getString((HCONTACT)lParam, "ID", &dbv))
return NULL;
this->connection->sendAddParticipants(string(dbv.pszVal), participants);
@@ -562,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((HANDLE) wParam);
- string b = GetContactDisplayName((HANDLE) lParam);
+ string a = GetContactDisplayName((HCONTACT)wParam);
+ string b = GetContactDisplayName((HCONTACT)lParam);
debugLogA("Request remove user %s from group %s", a.c_str(), b.c_str());
if (!this->isOnline())
@@ -571,14 +562,14 @@ INT_PTR __cdecl WhatsAppProto::OnRemoveContactFromGroup(WPARAM wParam, LPARAM, L
DBVARIANT dbv;
- if (getString((HANDLE)lParam, "ID", &dbv))
+ if (getString((HCONTACT)lParam, "ID", &dbv))
return NULL;
std::vector<string> participants;
participants.push_back(string(dbv.pszVal));
db_free(&dbv);
- if (getString((HANDLE)wParam, "ID", &dbv))
+ if (getString((HCONTACT)wParam, "ID", &dbv))
return NULL;
this->connection->sendRemoveParticipants(string(dbv.pszVal), participants);
@@ -601,7 +592,7 @@ void WhatsAppProto::onParticipatingGroups(const std::vector<string>& paramVector
void WhatsAppProto::HandleReceiveGroups(const std::vector<string>& groups, bool isOwned)
{
- HANDLE hContact;
+ HCONTACT hContact;
map<HANDLE, bool> 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
@@ -641,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;
- HANDLE hContact = this->AddToContactList(jid, 0, false, NULL, true);
+ HCONTACT hContact = this->AddToContactList(jid, 0, false, NULL, true);
setByte(hContact, "SimpleChatRoom", 2);
}
@@ -668,7 +659,7 @@ void __cdecl WhatsAppProto::SendSetGroupNameWorker(void* data)
string groupName(ibr->value);
mir_free(ibr->value);
DBVARIANT dbv;
- if (!getString(*((HANDLE*) ibr->userData), WHATSAPP_KEY_ID, &dbv) && this->isOnline())
+ if (!getString(*((HCONTACT*)ibr->userData), WHATSAPP_KEY_ID, &dbv) && this->isOnline())
{
this->connection->sendSetNewSubject(dbv.pszVal, groupName);
db_free(&dbv);
@@ -691,7 +682,7 @@ void __cdecl WhatsAppProto::SendCreateGroupWorker(void* data)
INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
input_box* ib = new input_box;
if (getTString(hContact, WHATSAPP_KEY_PUSH_NAME, &dbv))
@@ -719,7 +710,7 @@ INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam
INT_PTR __cdecl WhatsAppProto::OnLeaveGroup(WPARAM wParam, LPARAM)
{
DBVARIANT dbv;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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 d48fbfb573..a2543cf20d 100644
--- a/protocols/WhatsApp/src/entities.h
+++ b/protocols/WhatsApp/src/entities.h
@@ -3,18 +3,18 @@
struct send_direct
{
- send_direct(HANDLE hContact,const std::string &msg, HANDLE msgid, bool isChat = false)
+ send_direct(HCONTACT hContact,const std::string &msg, HANDLE msgid, bool isChat = false)
: hContact(hContact), msg(msg), msgid(msgid)
{}
- HANDLE hContact;
+ HCONTACT hContact;
std::string msg;
HANDLE msgid;
};
struct send_typing
{
- send_typing(HANDLE hContact,const int status) : hContact(hContact), status(status) {}
- HANDLE hContact;
+ send_typing(HCONTACT hContact,const int status) : hContact(hContact), status(status) {}
+ HCONTACT hContact;
int status;
};
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp
index 00ddab1e12..c5c911ade8 100644
--- a/protocols/WhatsApp/src/messages.cpp
+++ b/protocols/WhatsApp/src/messages.cpp
@@ -1,6 +1,6 @@
#include "common.h"
-int WhatsAppProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int WhatsAppProto::RecvMsg(HCONTACT 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("]: "));
}
- HANDLE hContact = this->AddToContactList(paramFMessage->key->remote_jid, 0, false,
+ HCONTACT 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(HANDLE hContact, int flags, const char *msg)
+int WhatsAppProto::SendMsg(HCONTACT 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)
{
- HANDLE hContact = this->AddToContactList(paramString, 0, false);
+ HCONTACT 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(HANDLE hContact,int type)
+int WhatsAppProto::UserIsTyping(HCONTACT hContact,int type)
{
if (hContact && isOnline())
ForkThread(&WhatsAppProto::SendTypingWorker, new send_typing(hContact, type));
@@ -165,7 +165,7 @@ void WhatsAppProto::onMessageStatusUpdate(FMessage* fmsg)
{
debugLogA("");
- HANDLE hContact = this->ContactIDToHContact(fmsg->key->remote_jid);
+ HCONTACT 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 6b61cca21c..c7239ee4e2 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, HANDLE hContact )
+DWORD_PTR WhatsAppProto::GetCaps( int type, HCONTACT hContact )
{
switch(type)
{
@@ -139,7 +139,7 @@ HANDLE WhatsAppProto::AddToList( int flags, PROTOSEARCHRESULT* psr )
return NULL;
}
-int WhatsAppProto::AuthRequest(HANDLE hContact,const PROTOCHAR *message)
+int WhatsAppProto::AuthRequest(HCONTACT 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;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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, HANDLE contact, DWORD flags, TCHAR* url)
+void WhatsAppProto::NotifyEvent(const string& title, const string& info, HCONTACT 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, HANDLE
mir_free(rawInfo);
}
-void WhatsAppProto::NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, TCHAR* szUrl)
+void WhatsAppProto::NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT 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 d8bdab70a6..80e954d71a 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -37,18 +37,18 @@ public:
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason ) { return 1; }
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* ) { return 1; }
- virtual int __cdecl AuthRequest( HANDLE hContact, const PROTOCHAR* szMessage );
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ) { return 1; }
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ) { return NULL; }
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath ) { return NULL; }
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer ) { return 1; }
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason ) { return 1; }
+ 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 int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ) { return 1; }
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType ) { return 1; }
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
+ virtual int __cdecl GetInfo(HCONTACT 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( HANDLE hContact, PROTORECVEVENT* ) { return 1; }
- virtual int __cdecl RecvFile( HANDLE hContact, PROTOFILEEVENT* ) { return 1; }
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* ) { return 1; }
+ 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 SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList ) { return 1; }
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) { return NULL; }
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url ) { 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 SetApparentMode( HANDLE hContact, int mode ) { return 1; }
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ) { return 1; }
virtual int __cdecl SetStatus( int iNewStatus );
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact ) { return NULL; }
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt ) { return 1; }
- virtual int __cdecl SendAwayMsg( HANDLE hContact, HANDLE hProcess, const char* msg ) { return 1; }
+ 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 int __cdecl SetAwayMsg( int iStatus, const PROTOCHAR* msg ) { return 1; }
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT 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
- HANDLE AddToContactList(const std::string& jid, BYTE type = 0, bool dont_check = false,
+ HCONTACT 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(HANDLE, bool include_chat = false);
- HANDLE ContactIDToHContact(const std::string&);
+ bool IsMyContact(HCONTACT hContact, bool include_chat = false);
+ HCONTACT ContactIDToHContact(const std::string&);
void SetAllContactStatuses(int status, bool reset_client = false);
- void UpdateStatusMsg(HANDLE hContact);
- string GetContactDisplayName(HANDLE hContact);
+ void UpdateStatusMsg(HCONTACT hContact);
+ string GetContactDisplayName(HCONTACT hContact);
string GetContactDisplayName(const string& jid);
void InitContactMenus();
void HandleReceiveGroups(const std::vector<string>& groups, bool isOwned);
- bool IsGroupChat(HANDLE hC, bool checkIsAdmin = false)
+ bool IsGroupChat(HCONTACT hC, bool checkIsAdmin = false)
{
return getByte(hC, "SimpleChatRoom", 0) > (checkIsAdmin ? 1 : 0);
}
@@ -165,9 +165,8 @@ public:
string phoneNumber;
string jid;
string nick;
- std::map<string, HANDLE> hContactByJid;
- //std::map<HANDLE, std::vector<HANDLE>> membersByGroupContact;
- map<HANDLE, map<HANDLE, bool>> isMemberByGroupContact;
+ std::map<string, HCONTACT> hContactByJid;
+ map<HCONTACT, map<HCONTACT, bool>> isMemberByGroupContact;
// WhatsApp Events
virtual void onMessageForMe(FMessage* paramFMessage, bool paramBoolean);
@@ -206,8 +205,8 @@ public:
virtual void onLeaveGroup(const std::string& paramString);
// Information providing
- void NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, TCHAR* url=NULL);
- void NotifyEvent(const string& title, const string& info, HANDLE contact, DWORD flags, TCHAR* url=NULL);
+ 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);
};
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index e5285ddf0a..3e64694ade 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(HANDLE hContact)
+static WhatsAppProto* GetInstanceByHContact(HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if( !proto )
@@ -56,14 +56,14 @@ static WhatsAppProto* GetInstanceByHContact(HANDLE hContact)
template<INT_PTR (__cdecl WhatsAppProto::*Fcn)(WPARAM,LPARAM)>
INT_PTR GlobalService(WPARAM wParam,LPARAM lParam)
{
- WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? (proto->*Fcn)(wParam,lParam) : 0;
}
template<INT_PTR (__cdecl WhatsAppProto::*Fcn)(WPARAM,LPARAM,LPARAM)>
INT_PTR GlobalServiceParam(WPARAM wParam,LPARAM lParam, LPARAM lParam2)
{
- WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(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; i<SIZEOF(g_hContactMenuItems); i++)
Menu_ShowItem(g_hContactMenuItems[i], false);
- WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(wParam));
+ WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HCONTACT>(wParam));
return proto ? proto->OnPrebuildContactMenu(wParam,lParam) : 0;
}
@@ -104,7 +104,7 @@ void WhatsAppProto::InitContactMenus()
int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(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<HANDLE, map<HANDLE, bool>>::iterator it = this->isMemberByGroupContact.begin();
+ for (map<HCONTACT, map<HCONTACT, bool>>::iterator it = this->isMemberByGroupContact.begin();
it != this->isMemberByGroupContact.end(); ++it)
{
- map<HANDLE, bool>::iterator memberIt = it->second.find(hContact);
+ map<HCONTACT, bool>::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<HANDLE, map<HANDLE, bool>>::iterator groupsIt = this->isMemberByGroupContact.find(hContact);
+ map<HCONTACT, map<HCONTACT, bool>>::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<HANDLE, bool>::iterator it = groupsIt->second.begin(); it != groupsIt->second.end(); ++it)
+ for (map<HCONTACT, bool>::iterator it = groupsIt->second.begin(); it != groupsIt->second.end(); ++it)
{
if (!getString(it->first, "ID", &dbv))
{
diff --git a/protocols/Xfire/src/baseProtocol.h b/protocols/Xfire/src/baseProtocol.h
index 7946c2adcb..64abc5720c 100644
--- a/protocols/Xfire/src/baseProtocol.h
+++ b/protocols/Xfire/src/baseProtocol.h
@@ -29,59 +29,14 @@
//=====================================================
// Includes (yea why not include lots of stuff :D )
//=====================================================
-#include <windows.h>
-#include <gdiplus.h>
-#include <Wininet.h>
-#include <commctrl.h>
-#include <stdio.h>
-#include <time.h>
-#include <stddef.h>
-#include <process.h>
-#include <string.h>
-#include <winsock.h>
-#include "resource.h"
-#include <winbase.h>
-#include <tlhelp32.h>
-#include <Psapi.h>
-#include <string.h>
-#include <Iphlpapi.h>
-
-//Miranda SDK headers
-#include <newpluginapi.h>
-#include <m_clist.h>
-#include <m_clui.h>
-#include <m_skin.h>
-#include <m_langpack.h>
-#include <m_protomod.h>
-#include <m_database.h>
-#include <m_system.h>
-#include <m_protocols.h>
-#include <m_protomod.h>
-#include <m_protosvc.h>
-#include <m_protoint.h>
-#include <m_userinfo.h>
-#include <m_options.h>
-#include <m_utils.h>
-#include <m_ignore.h>
-#include <m_netlib.h>
-#include <m_avatars.h>
-#include <m_folders.h>
-#include <m_assocmgr.h>
-#include <m_icolib.h>
-#include <m_genmenu.h>
-#include <m_extraicons.h>
-#include <m_xstatus.h>
-#include "services.h"
-
-/*#pragma comment(lib, "atl.lib")
-#include <atldef.h>
-#define _ATL_DLL_IMPL
-#include <atliface.h>*/
+#pragma once
#ifndef _BASEPROTO_H
#define _BASEPROTO_H
+#include "services.h"
+
//=======================================================
// Definitions
//=======================================================
@@ -103,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(HANDLE h);
+BOOL IsXFireContact(HCONTACT 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);
@@ -200,7 +155,7 @@ struct XFire_FoundGame
struct XFire_SetAvatar
{
- HANDLE hContact;
+ HCONTACT hContact;
char* username;
};
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp
index 4c596001a0..a7f2ba8042 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 HANDLE handlingBuddys(xfirelib::BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
+extern HCONTACT 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 7ab1e26878..ee6f2a22b4 100644
--- a/protocols/Xfire/src/buddylist.h
+++ b/protocols/Xfire/src/buddylist.h
@@ -37,60 +37,60 @@
namespace xfirelib {
- using namespace std;
+ using namespace std;
- struct Client;
- struct BuddyListEntry;
+ struct Client;
+ struct BuddyListEntry;
- class BuddyList : public PacketListener {
- public:
- BuddyList(Client *client);
- ~BuddyList();
-
- vector <BuddyListEntry *> * getEntries() { return entries; }
- vector <BuddyListEntry *> * getEntriesClan() { return entriesClan; }
-
- void receivedPacket(XFirePacket *packet);
- BuddyListEntry *getBuddyById(long userid);
- BuddyListEntry *getBuddyBySid(const char *sid);
- BuddyListEntry *getBuddyByName(string username);
- private:
- void initEntries(BuddyListNamesPacket* buddynames);
- void initEntriesClan(ClanBuddyListNamesPacket* buddynames);
- void updateOnlineBuddies(BuddyListOnlinePacket* buddiesOnline);
- void updateBuddiesGame(BuddyListGamesPacket* buddiesGames);
- void updateFriendsofFriend(FriendsBuddyListNamesPacket* friends);
-
- Client *client;
- vector <BuddyListEntry *> * entries;
- vector <BuddyListEntry *> * entriesClan;
- };
+ class BuddyList : public PacketListener {
+ public:
+ BuddyList(Client *client);
+ ~BuddyList();
+
+ vector <BuddyListEntry *> * getEntries() { return entries; }
+ vector <BuddyListEntry *> * getEntriesClan() { return entriesClan; }
+
+ void receivedPacket(XFirePacket *packet);
+ BuddyListEntry *getBuddyById(long userid);
+ BuddyListEntry *getBuddyBySid(const char *sid);
+ BuddyListEntry *getBuddyByName(string username);
+ private:
+ void initEntries(BuddyListNamesPacket* buddynames);
+ void initEntriesClan(ClanBuddyListNamesPacket* buddynames);
+ void updateOnlineBuddies(BuddyListOnlinePacket* buddiesOnline);
+ void updateBuddiesGame(BuddyListGamesPacket* buddiesGames);
+ void updateFriendsofFriend(FriendsBuddyListNamesPacket* friends);
+
+ Client *client;
+ vector <BuddyListEntry *> * entries;
+ vector <BuddyListEntry *> * entriesClan;
+ };
class BuddyListEntry {
public:
- BuddyListEntry();
- ~BuddyListEntry();
- bool isOnline();
-
- void setSid(const char *sid);
-
- long userid;
- char sid[16];
- string nick;
- string username;
- string statusmsg;
- string gameinfo;
- long game;
- long game2;
- HANDLE hcontact;
- int clanid;
-
- //lastpopup
- char* lastpopup;
-
- XFireGame *gameObj;
- XFireGame *game2Obj;
+ BuddyListEntry();
+ ~BuddyListEntry();
+ bool isOnline();
+
+ void setSid(const char *sid);
+
+ long userid;
+ char sid[16];
+ string nick;
+ string username;
+ string statusmsg;
+ string gameinfo;
+ long game;
+ long game2;
+ HCONTACT hcontact;
+ int clanid;
+
+ //lastpopup
+ char* lastpopup;
+
+ XFireGame *gameObj;
+ XFireGame *game2Obj;
};
typedef BuddyListEntry *PBuddyListEntry;
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index b663fd50b5..bc9e744231 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);
-HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan);
-HANDLE CList_FindContact (int uid);
+HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan);
+HCONTACT 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(HANDLE hContact, char* username);
+//void SetAvatar(HCONTACT 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);
-HANDLE handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
+HCONTACT 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);
@@ -514,7 +514,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
db_free(&dbv);
}
CreateGroup(Translate(fofname),"fofgroup");
- HANDLE hc=handlingBuddys(entry,-1,Translate(fofname));
+ HCONTACT hc=handlingBuddys(entry,-1,Translate(fofname));
if (hc)
{
CheckAvatar(entry);
@@ -608,8 +608,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
xfire_newc.nick=(char*)invite->nick.c_str();
xfire_newc.id=0;
- HANDLE handle=CList_AddContact(xfire_newc,TRUE,TRUE,0);
-
+ HCONTACT handle = CList_AddContact(xfire_newc,TRUE,TRUE,0);
if (handle) { // invite nachricht mitsenden
string str = (char*)invite->msg.c_str();
@@ -999,7 +998,7 @@ int ExtraListRebuild(WPARAM wparam, LPARAM lparam)
int ExtraImageApply1(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)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 +1010,7 @@ int ExtraImageApply1(WPARAM wparam, LPARAM lparam)
int ExtraImageApply2(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact=(HANDLE)wparam;
+ HCONTACT hContact=(HCONTACT)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,18 +1326,18 @@ static void SetStatusLate( LPVOID param )
static void SendAck( LPVOID param )
{
- ProtoBroadcastAck(protocolname, param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
static void SendBadAck( LPVOID param )
{
- ProtoBroadcastAck(protocolname, param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!")));
+ ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!")));
}
static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ( HANDLE )wParam;
- DBVARIANT dbv;
+ HCONTACT hContact = (HCONTACT)wParam;
+ DBVARIANT dbv;
if (lParam==PROTOTYPE_SELFTYPING_ON)
{
@@ -1364,9 +1363,9 @@ static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam)
INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA *) lParam;
PROTORECVEVENT* pre = (PROTORECVEVENT*)ccs->lParam;
- DBVARIANT dbv;
+ DBVARIANT dbv;
int sended=0;
db_get_s(ccs->hContact, protocolname, "Username",&dbv);
@@ -1377,13 +1376,10 @@ INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
mir_forkthread(SendAck,ccs->hContact);
sended=1;
}
- else
- {
- mir_forkthread(SendBadAck,ccs->hContact);
- }
- db_free(&dbv);
+ else mir_forkthread(SendBadAck,ccs->hContact);
- return sended;
+ db_free(&dbv);
+ return sended;
}
//=======================================================
@@ -1598,15 +1594,15 @@ INT_PTR GetStatus(WPARAM wParam,LPARAM lParam)
return ID_STATUS_OFFLINE;
}
-HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
+HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (xfc.username == NULL)
return 0;
// here we create a new one since no one is to be found
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
if ( hContact ) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)protocolname );
@@ -1668,7 +1664,7 @@ HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
return false;
}
-BOOL IsXFireContact(HANDLE hContact)
+BOOL IsXFireContact(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto != NULL && !lstrcmpiA(szProto, protocolname))
@@ -1677,9 +1673,9 @@ BOOL IsXFireContact(HANDLE hContact)
return FALSE;
}
-HANDLE CList_FindContact (int uid)
+HCONTACT CList_FindContact (int uid)
{
- for (HANDLE hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname))
+ for (HCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname))
if ( db_get_dw(hContact, protocolname, "UserId", -1) == uid)
return hContact;
@@ -1689,7 +1685,7 @@ HANDLE CList_FindContact (int uid)
void CList_MakeAllOffline()
{
vector<HANDLE> fhandles;
- for (HANDLE hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) {
+ for (HCONTACT 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)
@@ -1770,7 +1766,7 @@ void SetAvatar2(LPVOID lparam) {
}
void SetAvatar(LPVOID lparam)
-//void SetAvatar(HANDLE hContact, char* username)
+//void SetAvatar(HCONTACT hContact, char* username)
{
//EnterCriticalSection(&avatarMutex);
//WaitForSingleObject(hMutex, INFINITE);
@@ -1932,14 +1928,14 @@ static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, "Port", -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, "Port", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "ServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, "Port", -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "Port", -1));
db_free(&dbv);
@@ -1965,14 +1961,14 @@ static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, "VPort", -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, "VPort", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, "VServerIP",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "VServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, "VPort", -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "VPort", -1));
db_free(&dbv);
@@ -1997,7 +1993,7 @@ static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
char temp[64]="";
- if (db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv))
return 0;
strcpy(temp,"http://xfire.com/profile/");
@@ -2013,7 +2009,7 @@ static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) {
DBVARIANT dbv;
char temp[64]="";
- int clanid=db_get_dw((HANDLE)wParam, protocolname, "Clan",-1);
+ int clanid=db_get_dw((HCONTACT)wParam, protocolname, "Clan",-1);
mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp,&dbv))
@@ -2074,7 +2070,7 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam)
int RebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
bool bEnabled = true, bEnabled2 = true;
DBVARIANT dbv;
@@ -2688,9 +2684,9 @@ void setBuddyStatusMsg(BuddyListEntry *entry)
}
}*/
-HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
+HCONTACT handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
{
- HANDLE hContact;
+ HCONTACT hContact;
string game;
if (entry==NULL)
@@ -3257,14 +3253,14 @@ INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam)
int ContactDeleted(WPARAM wParam,LPARAM lParam)
{
- if (!db_get_b((HANDLE)wParam, protocolname, "DontSendDenyPacket", 0))
- if (db_get_b((HANDLE)wParam,"CList","NotOnList",0))
+ if (!db_get_b((HCONTACT)wParam, protocolname, "DontSendDenyPacket", 0))
+ if (db_get_b((HCONTACT)wParam,"CList","NotOnList",0))
{
if (myClient!=NULL)
if (myClient->client->connected)
{
DBVARIANT dbv2;
- if (!db_get((HANDLE)wParam,protocolname,"Username",&dbv2)) {
+ if (!db_get((HCONTACT)wParam,protocolname,"Username",&dbv2)) {
SendDenyInvitationPacket deny;
deny.name = dbv2.pszVal;
myClient->client->send( &deny );
@@ -3297,7 +3293,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam)
char temp[256];
DBVARIANT dbv;
- if (!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (!db_get_s((HCONTACT)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)
@@ -3308,7 +3304,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam)
{
SendRemoveBuddyPacket removeBuddy;
- removeBuddy.userid=db_get_dw((HANDLE)wParam,protocolname,"UserId",0);
+ removeBuddy.userid=db_get_dw((HCONTACT)wParam,protocolname,"UserId",0);
if (removeBuddy.userid!=0)
{
@@ -3326,7 +3322,7 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam)
{
DBVARIANT dbv;
- if (!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (!db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv))
{
if (MessageBox(NULL,TranslateT("Block this user from ever contacting you again?"),TranslateT("Block Confirmation"),MB_YESNO|MB_ICONQUESTION)==IDYES)
{
@@ -3353,7 +3349,7 @@ INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3373,7 +3369,7 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3382,8 +3378,8 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
if (game)
{
DBVARIANT dbv; //dbv.pszVal
- int port=db_get_w((HANDLE)wParam, protocolname, "Port",0);
- if (!db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ int port=db_get_w((HCONTACT)wParam, protocolname, "Port",0);
+ if (!db_get_s((HCONTACT)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 687b27284f..28eb283f66 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,HANDLE hcontact,char* username) {
+void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HCONTACT 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 0964ef983b..e4fad3b387 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,HANDLE hcontact,char* username); \ No newline at end of file
+void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, HCONTACT hcontact,char* username); \ No newline at end of file
diff --git a/protocols/Xfire/src/socket.h b/protocols/Xfire/src/socket.h
index 370aeb74f7..17fdd46bc6 100644
--- a/protocols/Xfire/src/socket.h
+++ b/protocols/Xfire/src/socket.h
@@ -10,14 +10,6 @@
#include "stdafx.h"
-#include <sys/types.h>
-//#include <netinet/in.h>
-//#include <netdb.h>
-//#include <unistd.h>
-#include <string>
-//#include <arpa/inet.h>
-#include <winsock2.h>
-
#include "socketexception.h"
diff --git a/protocols/Xfire/src/stdafx.h b/protocols/Xfire/src/stdafx.h
index 3b6a0d7bd2..c6055649f3 100644
--- a/protocols/Xfire/src/stdafx.h
+++ b/protocols/Xfire/src/stdafx.h
@@ -9,10 +9,12 @@
#define _WIN32_WINNT 0x0501 // Ändern Sie dies in den geeigneten Wert für andere Versionen von Windows.
#endif
+#include <sys/types.h>
#include <stdio.h>
#include <cstdlib>
#include <tchar.h>
#include <iostream>
+#include <string>
#define uint unsigned int
#define socklen_t int
@@ -33,4 +35,44 @@
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"gdi32.lib")
-// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
+#include <winsock2.h>
+#include <gdiplus.h>
+#include <Wininet.h>
+#include <commctrl.h>
+#include <stdio.h>
+#include <time.h>
+#include <stddef.h>
+#include <process.h>
+#include <string.h>
+#include <tlhelp32.h>
+#include <Psapi.h>
+#include <string.h>
+#include <Iphlpapi.h>
+
+#include "resource.h"
+
+//Miranda SDK headers
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_clui.h>
+#include <m_skin.h>
+#include <m_langpack.h>
+#include <m_protomod.h>
+#include <m_database.h>
+#include <m_system.h>
+#include <m_protocols.h>
+#include <m_protomod.h>
+#include <m_protosvc.h>
+#include <m_protoint.h>
+#include <m_userinfo.h>
+#include <m_options.h>
+#include <m_utils.h>
+#include <m_ignore.h>
+#include <m_netlib.h>
+#include <m_avatars.h>
+#include <m_folders.h>
+#include <m_assocmgr.h>
+#include <m_icolib.h>
+#include <m_genmenu.h>
+#include <m_extraicons.h>
+#include <m_xstatus.h>
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp
index 0ae7e662f6..bb30eccb98 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,HANDLE hcontact,int type)
+void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HCONTACT hcontact,int type)
{
DBVARIANT dbv;
if (!db_get(hcontact,protocolname,feld,&dbv)) {
@@ -91,14 +91,14 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, feld2, -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, feld2, -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, feld1,&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, feld1,&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, feld2, -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, feld2, -1));
db_free(&dbv);
@@ -118,7 +118,7 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
return 0;
}
-void addToList(HWND listbox,HANDLE hContact,char*key,char*val)
+void addToList(HWND listbox,HCONTACT hContact,char*key,char*val)
{
DBVARIANT dbv;
if (!db_get(hContact,protocolname,val,&dbv))
@@ -245,7 +245,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
case PSN_INFOCHANGED:
{
char* szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((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((HANDLE)lParam))
+ if (!IsXFireContact((HCONTACT)lParam))
return 0;
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp
index 47318c1b3e..4eb38181ac 100644
--- a/protocols/Yahoo/src/avatar.cpp
+++ b/protocols/Yahoo/src/avatar.cpp
@@ -155,7 +155,6 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
PROTO_AVATAR_INFORMATIONT AI;
struct avatar_info *avt = ( avatar_info* )pavt;
int error = 0;
- HANDLE hContact = 0;
TCHAR buf[4096];
if (avt == NULL) {
@@ -172,7 +171,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
LOG(("yahoo_recv_avatarthread who:%s url:%s checksum: %d", avt->who, avt->pic_url, avt->cksum));
- hContact = getbuddyH(avt->who);
+ HCONTACT hContact = getbuddyH(avt->who);
if (!hContact) {
LOG(("ERROR: Can't find buddy: %s", avt->who));
@@ -259,7 +258,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
void CYahooProto::ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type)
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
LOG(("[ext_yahoo_got_picture] for %s with url %s (checksum: %d) type: %d", who, pic_url, cksum, type));
@@ -451,7 +450,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p
void CYahooProto::ext_got_picture_checksum(const char *me, const char *who, int cksum)
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
LOG(("ext_yahoo_got_picture_checksum for %s checksum: %d", who, cksum));
@@ -489,7 +488,7 @@ void CYahooProto::ext_got_picture_checksum(const char *me, const char *who, int
void CYahooProto::ext_got_picture_update(const char *me, const char *who, int buddy_icon)
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
LOG(("ext_got_picture_update for %s buddy_icon: %d", who, buddy_icon));
@@ -507,7 +506,7 @@ void CYahooProto::ext_got_picture_update(const char *me, const char *who, int bu
void CYahooProto::ext_got_picture_status(const char *me, const char *who, int buddy_icon)
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
LOG(("ext_yahoo_got_picture_status for %s buddy_icon: %d", who, buddy_icon));
@@ -573,7 +572,7 @@ void CYahooProto::ext_got_avatar_share(int buddy_icon)
setByte("ShareAvatar", buddy_icon );
}
-void CYahooProto::reset_avatar(HANDLE hContact)
+void CYahooProto::reset_avatar(HCONTACT hContact)
{
LOG(("[YAHOO_RESET_AVATAR]"));
@@ -587,7 +586,7 @@ void CYahooProto::request_avatar(const char* who)
return;
}
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (!hContact)
return;
@@ -607,7 +606,7 @@ void CYahooProto::request_avatar(const char* who)
else LOG(("Avatar Not Available for: %s Last Check: %ld Current: %ld (Flood Check in Effect)", who, last_chk, cur_time));
}
-void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int type)
+void CYahooProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName);
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index 0b22d5e23f..75dbf851ea 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -244,7 +244,7 @@ void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TC
TCHAR* idt = mir_a2t(room);
TCHAR* snt = mir_a2t(who);
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt;
GCDEST gcd = { m_szModuleName, idt, evt };
@@ -395,18 +395,19 @@ int __cdecl CYahooProto::OnGCMenuHook(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Invite to chat dialog
-static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg)
+static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg)
{
bool root = !hItem;
if (root)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
while (hItem)
{
if (IsHContactGroup(hItem))
{
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) clist_chat_invite_send(hItemT, hwndList, who, room, ppro, msg);
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ clist_chat_invite_send(hItemT, hwndList, who, room, ppro, msg);
}
else
{
@@ -428,7 +429,7 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, cha
}
}
}
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
}
if (root && who)
@@ -450,26 +451,25 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, YList* &who, cha
}
}
-static void ClistValidateContact(HANDLE hItem, HWND hwndList, CYahooProto* ppro)
+static void ClistValidateContact(HCONTACT hItem, HWND hwndList, CYahooProto* ppro)
{
if (!ppro->IsMyContact(hItem) || ppro->isChatRoom(hItem) ||
ppro->getWord(hItem, "Status", ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE)
SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
}
-static void ClistChatPrepare(HANDLE hItem, HWND hwndList, CYahooProto* ppro)
+static void ClistChatPrepare(HCONTACT hItem, HWND hwndList, CYahooProto* ppro)
{
if (hItem == NULL)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
+ hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
- while (hItem)
- {
- HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
+ while (hItem) {
+ HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- if (IsHContactGroup(hItem))
- {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) ClistChatPrepare(hItemT, hwndList, ppro);
+ if (IsHContactGroup(hItem)) {
+ HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItemT)
+ ClistChatPrepare(hItemT, hwndList, ppro);
}
else if (IsHContactContact(hItem))
ClistValidateContact(hItem, hwndList, ppro);
@@ -516,7 +516,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
case CLN_NEWCONTACT:
if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- ClistValidateContact(nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
+ ClistValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
break;
case CLN_LISTREBUILT:
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp
index a3ac8bc57b..e83f9d3836 100644
--- a/protocols/Yahoo/src/file_transfer.cpp
+++ b/protocols/Yahoo/src/file_transfer.cpp
@@ -19,7 +19,7 @@
YList *file_transfers=NULL;
-static y_filetransfer* new_ft(CYahooProto* ppro, int id, HANDLE hContact, const char *who, const char *msg,
+static y_filetransfer* new_ft(CYahooProto* ppro, int id, HCONTACT hContact, const char *who, const char *msg,
const char *url, const char *ft_token, int y7, YList *fs, int sending)
{
yahoo_file_info * fi;
@@ -478,7 +478,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url,
{
LOG(("[ext_yahoo_got_file] ident:%s, who: %s, url: %s, expires: %lu, msg: %s, fname: %s, fsize: %lu ftoken: %s y7: %d", me, who, url, expires, msg, fname, fesize, ft_token == NULL ? "NULL" : ft_token, y7));
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact == NULL)
hContact = add_buddy(who, who, 0 /* NO FT for other IMs */, PALF_TEMPORARY);
@@ -533,7 +533,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url,
void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_token, int y7, YList* files)
{
- HANDLE hContact;
+ HCONTACT hContact;
y_filetransfer *ft;
YList *f;
char fn[4096];
@@ -699,7 +699,7 @@ void __cdecl CYahooProto::send_filethread(void *psf)
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles )
+HANDLE __cdecl CYahooProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles )
{
DBVARIANT dbv;
y_filetransfer *sf;
@@ -763,7 +763,7 @@ HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescri
////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, const PROTOCHAR* szPath )
+HANDLE __cdecl CYahooProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
y_filetransfer *ft = (y_filetransfer *)hTransfer;
size_t len;
@@ -792,7 +792,7 @@ HANDLE __cdecl CYahooProto::FileAllow( HANDLE /*hContact*/, HANDLE hTransfer, co
////////////////////////////////////////////////////////////////////////////////////////
// FileCancel - cancels a file transfer
-int __cdecl CYahooProto::FileCancel( HANDLE /*hContact*/, HANDLE hTransfer )
+int __cdecl CYahooProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
debugLogA("[YahooFileCancel]");
@@ -815,14 +815,14 @@ int __cdecl CYahooProto::FileCancel( HANDLE /*hContact*/, HANDLE hTransfer )
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const PROTOCHAR* )
+int __cdecl CYahooProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR*)
{
/* deny file receive request.. just ignore it! */
y_filetransfer *ft = (y_filetransfer *)hTransfer;
debugLogA("[YahooFileDeny]");
- if ( !m_bLoggedIn || ft == NULL) {
+ if (!m_bLoggedIn || ft == NULL) {
debugLogA("[YahooFileDeny] Not logged-in or some other error!");
return 1;
}
@@ -838,7 +838,7 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const
struct yahoo_file_info *fi = (struct yahoo_file_info *)ft->files->data;
debugLogA("[YahooFileDeny] DC Detected: Denying File Transfer!");
- yahoo_ftdc_deny(m_id, ft->who, fi->filename, ft->ftoken, 2);
+ yahoo_ftdc_deny(m_id, ft->who, fi->filename, ft->ftoken, 2);
}
return 0;
}
@@ -846,13 +846,13 @@ int __cdecl CYahooProto::FileDeny( HANDLE /*hContact*/, HANDLE hTransfer, const
////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int __cdecl CYahooProto::FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename )
+int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename)
{
y_filetransfer *ft = (y_filetransfer *)hTransfer;
debugLogA("[YahooFileResume] Action: %d", *action);
- if ( !m_bLoggedIn || ft == NULL) {
+ if (!m_bLoggedIn || ft == NULL) {
debugLogA("[YahooFileResume] Not loggedin or some other error!");
return 1;
}
@@ -861,14 +861,13 @@ int __cdecl CYahooProto::FileResume( HANDLE hTransfer, int* action, const PROTOC
debugLogA("[YahooFileResume] Action: %d", *action);
- if ( *action == FILERESUME_RENAME ) {
+ if (*action == FILERESUME_RENAME) {
debugLogA("[YahooFileResume] Renamed file!");
-
+
FREE(ft->pfts.tszCurrentFile);
- ft->pfts.tszCurrentFile = _tcsdup( *szFilename );
- }
+ ft->pfts.tszCurrentFile = _tcsdup(*szFilename);
+ }
- SetEvent( ft->hWaitEvent );
+ SetEvent(ft->hWaitEvent);
return 0;
}
-
diff --git a/protocols/Yahoo/src/file_transfer.h b/protocols/Yahoo/src/file_transfer.h
index f33d7cd046..cdbacd9c32 100644
--- a/protocols/Yahoo/src/file_transfer.h
+++ b/protocols/Yahoo/src/file_transfer.h
@@ -22,7 +22,7 @@ typedef struct {
char *msg;
char *ftoken;
char *relay;
- HANDLE hContact;
+ HCONTACT hContact;
int cancel;
char *url;
HANDLE hWaitEvent;
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp
index 63ef43875b..224c65677b 100644
--- a/protocols/Yahoo/src/im.cpp
+++ b/protocols/Yahoo/src/im.cpp
@@ -100,7 +100,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
/* Need to strip off formatting stuff first. Then do all decoding/converting */
LOG(("%s: %s", who, umsg));
- HANDLE hContact = add_buddy(who, who, protocol, PALF_TEMPORARY);
+ HCONTACT hContact = add_buddy(who, who, protocol, PALF_TEMPORARY);
//setWord(hContact, "yprotoid", protocol);
Set_Protocol(hContact, protocol);
@@ -152,50 +152,50 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
////////////////////////////////////////////////////////////////////////////////////////
// SendMessage - sends a message
-void __cdecl CYahooProto::im_sendacksuccess(HANDLE hContact)
+void __cdecl CYahooProto::im_sendacksuccess(void *hContact)
{
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
-void __cdecl CYahooProto::im_sendackfail(HANDLE hContact)
+void __cdecl CYahooProto::im_sendackfail(void *hContact)
{
SleepEx(1000, TRUE);
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1,
- (LPARAM) Translate("The message send timed out."));
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1,
+ (LPARAM)Translate("The message send timed out."));
}
-void __cdecl CYahooProto::im_sendackfail_longmsg(HANDLE hContact)
+void __cdecl CYahooProto::im_sendackfail_longmsg(void *hContact)
{
SleepEx(1000, TRUE);
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1,
- (LPARAM)Translate("Message is too long: Yahoo messages are limited by 800 UTF8 chars"));
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1,
+ (LPARAM)Translate("Message is too long: Yahoo messages are limited by 800 UTF8 chars"));
}
-int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
+int __cdecl CYahooProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
if (!m_bLoggedIn) {/* don't send message if we not connected! */
- ForkThread( &CYahooProto::im_sendackfail, hContact );
+ ForkThread(&CYahooProto::im_sendackfail, hContact);
return 1;
}
ptrA msg;
if (flags & PREF_UNICODE) /* convert to utf8 */
- msg = mir_utf8encodeW(( wchar_t* )&pszSrc[ strlen(pszSrc)+1 ] );
- else if ( flags & PREF_UTF )
+ msg = mir_utf8encodeW((wchar_t*)&pszSrc[strlen(pszSrc) + 1]);
+ else if (flags & PREF_UTF)
msg = mir_strdup(pszSrc);
else
msg = mir_utf8encode(pszSrc);
if (lstrlenA(msg) > 800) {
- ForkThread( &CYahooProto::im_sendackfail_longmsg, hContact );
+ ForkThread(&CYahooProto::im_sendackfail_longmsg, hContact);
return 1;
}
DBVARIANT dbv;
- if (!getString( hContact, YAHOO_LOGINID, &dbv)) {
- send_msg(dbv.pszVal, getWord( hContact, "yprotoid", 0), msg, 1);
+ if (!getString(hContact, YAHOO_LOGINID, &dbv)) {
+ send_msg(dbv.pszVal, getWord(hContact, "yprotoid", 0), msg, 1);
- ForkThread( &CYahooProto::im_sendacksuccess, hContact );
+ ForkThread(&CYahooProto::im_sendacksuccess, hContact);
db_free(&dbv);
return 1;
@@ -207,32 +207,32 @@ int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CYahooProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre )
+int __cdecl CYahooProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
{
db_unset(hContact, "CList", "Hidden");
// NUDGES
- if ( !lstrcmpA(pre->szMessage, "<ding>") && ServiceExists("NUDGE/Send")) {
+ if (!lstrcmpA(pre->szMessage, "<ding>") && ServiceExists("NUDGE/Send")) {
debugLogA("[YahooRecvMessage] Doing Nudge Service!");
NotifyEventHooks(hYahooNudge, (WPARAM)hContact, pre->timestamp);
return 0;
- }
+ }
return Proto_RecvMessage(hContact, pre);
}
//=======================================================
-//Send a nudge
+// Send a nudge
//=======================================================
INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
debugLogA("[YAHOO_SENDNUDGE]");
if (!m_bLoggedIn) {/* don't send nudge if we not connected! */
- ForkThread( &CYahooProto::im_sendackfail, hContact );
+ ForkThread(&CYahooProto::im_sendackfail, hContact);
return 1;
}
@@ -241,12 +241,9 @@ INT_PTR __cdecl CYahooProto::SendNudge(WPARAM wParam, LPARAM lParam)
send_msg(dbv.pszVal, getWord(hContact, "yprotoid", 0), "<ding>", 0);
db_free(&dbv);
- ForkThread( &CYahooProto::im_sendacksuccess, hContact );
+ ForkThread(&CYahooProto::im_sendacksuccess, hContact);
return 1;
}
return 0;
}
-
-
-
diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp
index 8af33e94b3..d1136a507a 100644
--- a/protocols/Yahoo/src/links.cpp
+++ b/protocols/Yahoo/src/links.cpp
@@ -148,7 +148,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam)
if (arg) *arg = 0;
}
- HANDLE hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */
+ HCONTACT hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */
if (hContact)
CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, (LPARAM)msg);
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp
index 68e9a1167a..8078e72d67 100644
--- a/protocols/Yahoo/src/main.cpp
+++ b/protocols/Yahoo/src/main.cpp
@@ -79,7 +79,7 @@ LIST<CYahooProto> g_instances( 1, CompareProtos );
static CYahooProto* yahooProtoInit( const char* pszProtoName, const TCHAR* tszUserName )
{
- CYahooProto* ppro = new CYahooProto( pszProtoName, tszUserName );
+ CYahooProto* ppro = new CYahooProto(pszProtoName, tszUserName);
g_instances.insert( ppro );
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index 183176cb8a..afd2138d9c 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -61,7 +61,7 @@ CYahooProto::~CYahooProto()
////////////////////////////////////////////////////////////////////////////////////////
// OnModulesLoadedEx - performs hook registration
-int CYahooProto::OnModulesLoadedEx( WPARAM, LPARAM )
+int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM)
{
HookProtoEvent( ME_USERINFO_INITIALISE, &CYahooProto::OnUserInfoInit );
HookProtoEvent( ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent);
@@ -114,7 +114,7 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )
}
char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id) : mir_utf8encode((char*)psr->id);
- HANDLE hContact = getbuddyH(id);
+ HCONTACT hContact = getbuddyH(id);
if (hContact != NULL) {
if (db_get_b(hContact, "CList", "NotOnList", 0)) {
debugLogA("[YahooAddToList] Temporary Buddy:%s already on our buddy list", id);
@@ -164,7 +164,7 @@ HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDL
return 0;
}
- HANDLE hContact = DbGetAuthEventContact(&dbei);
+ HCONTACT hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL)
debugLogA("Temp Buddy found at: %p ", hContact);
else
@@ -199,7 +199,7 @@ int CYahooProto::Authorize( HANDLE hdbe )
return 1;
/* Need to remove the buddy from our Miranda Lists */
- HANDLE hContact = DbGetAuthEventContact(&dbei);
+ HCONTACT hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL) {
ptrA who( getStringA(hContact, YAHOO_LOGINID));
if (who) {
@@ -244,7 +244,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
}
/* Need to remove the buddy from our Miranda Lists */
- HANDLE hContact = DbGetAuthEventContact(&dbei);
+ HCONTACT hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL) {
ptrA who( getStringA(hContact, YAHOO_LOGINID));
if (who) {
@@ -262,7 +262,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int __cdecl CYahooProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
{
debugLogA("[YahooRecvAuth] ");
db_unset(hContact,"CList","Hidden");
@@ -274,7 +274,7 @@ int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CYahooProto::AuthRequest( HANDLE hContact, const TCHAR* msg )
+int __cdecl CYahooProto::AuthRequest(HCONTACT hContact, const TCHAR* msg )
{
debugLogA("[YahooSendAuthRequest]");
@@ -297,7 +297,7 @@ HANDLE __cdecl CYahooProto::ChangeInfo( int /*iInfoType*/, void* )
////////////////////////////////////////////////////////////////////////////////////////
// GetCaps - return protocol capabilities bits
-DWORD_PTR __cdecl CYahooProto::GetCaps( int type, HANDLE /*hContact*/ )
+DWORD_PTR __cdecl CYahooProto::GetCaps(int type, HCONTACT hContact)
{
switch ( type ) {
case PFLAGNUM_1:
@@ -329,13 +329,13 @@ DWORD_PTR __cdecl CYahooProto::GetCaps( int type, HANDLE /*hContact*/ )
////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-void __cdecl CYahooProto::get_info_thread(HANDLE hContact)
+void __cdecl CYahooProto::get_info_thread(void *hContact)
{
SleepEx(500, TRUE);
- ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck((HCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
-int __cdecl CYahooProto::GetInfo( HANDLE hContact, int /*infoType*/ )
+int __cdecl CYahooProto::GetInfo(HCONTACT hContact, int /*infoType*/ )
{
ForkThread(&CYahooProto::get_info_thread, hContact);
return 0;
@@ -360,7 +360,7 @@ HANDLE __cdecl CYahooProto::SearchByName( const PROTOCHAR* nick, const PROTOCHAR
////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CYahooProto::RecvContacts( HANDLE /*hContact*/, PROTORECVEVENT* )
+int __cdecl CYahooProto::RecvContacts(HCONTACT/*hContact*/, PROTORECVEVENT*)
{
return 1;
}
@@ -368,7 +368,7 @@ int __cdecl CYahooProto::RecvContacts( HANDLE /*hContact*/, PROTORECVEVENT* )
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CYahooProto::RecvFile( HANDLE hContact, PROTORECVFILET* evt )
+int __cdecl CYahooProto::RecvFile(HCONTACT hContact, PROTORECVFILET* evt)
{
db_unset(hContact, "CList", "Hidden");
@@ -378,7 +378,7 @@ int __cdecl CYahooProto::RecvFile( HANDLE hContact, PROTORECVFILET* evt )
////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CYahooProto::RecvUrl( HANDLE /*hContact*/, PROTORECVEVENT* )
+int __cdecl CYahooProto::RecvUrl(HCONTACT/*hContact*/, PROTORECVEVENT*)
{
return 1;
}
@@ -386,7 +386,7 @@ int __cdecl CYahooProto::RecvUrl( HANDLE /*hContact*/, PROTORECVEVENT* )
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CYahooProto::SendContacts( HANDLE /*hContact*/, int /*flags*/, int /*nContacts*/, HANDLE* /*hContactsList*/ )
+int __cdecl CYahooProto::SendContacts(HCONTACT/*hContact*/, int /*flags*/, int /*nContacts*/, HCONTACT* /*hContactsList*/)
{
return 1;
}
@@ -394,7 +394,7 @@ int __cdecl CYahooProto::SendContacts( HANDLE /*hContact*/, int /*flags*/, int /
////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CYahooProto::SendUrl( HANDLE /*hContact*/, int /*flags*/, const char* /*url*/ )
+int __cdecl CYahooProto::SendUrl(HCONTACT/*hContact*/, int /*flags*/, const char* /*url*/)
{
return 1;
}
@@ -402,7 +402,7 @@ int __cdecl CYahooProto::SendUrl( HANDLE /*hContact*/, int /*flags*/, const char
////////////////////////////////////////////////////////////////////////////////////////
// SetApparentMode - sets the visibility status
-int __cdecl CYahooProto::SetApparentMode( HANDLE hContact, int mode )
+int __cdecl CYahooProto::SetApparentMode(HCONTACT hContact, int mode)
{
if (mode && mode != ID_STATUS_OFFLINE)
return 1;
@@ -416,7 +416,7 @@ int __cdecl CYahooProto::SetApparentMode( HANDLE hContact, int mode )
////////////////////////////////////////////////////////////////////////////////////////
// SetStatus - sets the protocol status
-int __cdecl CYahooProto::SetStatus( int iNewStatus )
+int __cdecl CYahooProto::SetStatus(int iNewStatus)
{
LOG(("[SetStatus] New status %S", pcli->pfnGetStatusModeDescription(iNewStatus, 0)));
@@ -424,7 +424,8 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus )
logout();
- } else if (!m_bLoggedIn) {
+ }
+ else if (!m_bLoggedIn) {
DBVARIANT dbv;
int err = 0;
char errmsg[80];
@@ -472,7 +473,7 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus )
if (err != 0) {
BroadcastStatus(ID_STATUS_OFFLINE);
- ShowError( TranslateT("Yahoo Login Error"), _A2T(errmsg));
+ ShowError(TranslateT("Yahoo Login Error"), _A2T(errmsg));
return 0;
}
@@ -495,12 +496,12 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus )
BroadcastStatus(ID_STATUS_CONNECTING);
- iNewStatus = (iNewStatus == ID_STATUS_INVISIBLE) ? YAHOO_STATUS_INVISIBLE: YAHOO_STATUS_AVAILABLE;
+ iNewStatus = (iNewStatus == ID_STATUS_INVISIBLE) ? YAHOO_STATUS_INVISIBLE : YAHOO_STATUS_AVAILABLE;
ForkThread(&CYahooProto::server_main, (void *)iNewStatus);
}
else if (iNewStatus == ID_STATUS_INVISIBLE) { /* other normal away statuses are set via setaway */
BroadcastStatus(iNewStatus);
- set_status(m_iStatus,NULL,(m_iStatus != ID_STATUS_ONLINE) ? 1 : 0);
+ set_status(m_iStatus, NULL, (m_iStatus != ID_STATUS_ONLINE) ? 1 : 0);
}
else {
/* clear out our message just in case, STUPID AA! */
@@ -516,13 +517,14 @@ int __cdecl CYahooProto::SetStatus( int iNewStatus )
////////////////////////////////////////////////////////////////////////////////////////
// GetAwayMsg - returns a contact's away message
-void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
+void __cdecl CYahooProto::get_status_thread(void *param)
{
int l;
DBVARIANT dbv;
char *gm = NULL, *sm = NULL, *fm;
+ HCONTACT hContact = (HCONTACT)param;
- Sleep( 150 );
+ Sleep(150);
/* Check Yahoo Games Message */
if (!getString(hContact, "YGMsg", &dbv)) {
@@ -530,7 +532,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
db_free(&dbv);
}
- if (! db_get_s(hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_s(hContact, "CList", "StatusMsg", &dbv)) {
if (lstrlenA(dbv.pszVal) >= 1)
sm = strdup(dbv.pszVal);
@@ -538,7 +540,7 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
}
else {
int status = getWord(hContact, "YStatus", (WORD)YAHOO_STATUS_OFFLINE);
- sm = yahoo_status_code( yahoo_status(status));
+ sm = yahoo_status_code(yahoo_status(status));
if (sm) sm = strdup(sm); /* we need this to go global FREE later */
}
@@ -547,18 +549,19 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
l += lstrlenA(gm) + 3;
l += lstrlenA(sm) + 1;
- fm = (char *) malloc(l);
+ fm = (char *)malloc(l);
- fm[0] ='\0';
+ fm[0] = '\0';
if (gm && lstrlenA(gm) > 0) {
/* BAH YAHOO SUCKS! WHAT A PAIN!
find first carriage return add status message then add the rest */
char *c = strchr(gm, '\r');
if (c != NULL) {
- lstrcpynA(fm,gm, c - gm + 1);
+ lstrcpynA(fm, gm, c - gm + 1);
fm[c - gm + 1] = '\0';
- } else
+ }
+ else
lstrcpyA(fm, gm);
if (sm) {
@@ -568,16 +571,17 @@ void __cdecl CYahooProto::get_status_thread(HANDLE hContact)
if (c != NULL)
lstrcatA(fm, c);
- } else if (sm) {
+ }
+ else if (sm) {
lstrcatA(fm, sm);
}
FREE(sm);
- ProtoBroadcastAck( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, (LPARAM)( TCHAR* )_A2T(fm));
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)(TCHAR*)_A2T(fm));
}
-HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact )
+HANDLE __cdecl CYahooProto::GetAwayMsg(HCONTACT hContact)
{
debugLogA("[YahooGetAwayMessage] ");
@@ -595,7 +599,7 @@ HANDLE __cdecl CYahooProto::GetAwayMsg( HANDLE hContact )
////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG
-int __cdecl CYahooProto::RecvAwayMsg( HANDLE /*hContact*/, int /*statusMode*/, PROTORECVEVENT* )
+int __cdecl CYahooProto::RecvAwayMsg(HCONTACT/*hContact*/, int /*statusMode*/, PROTORECVEVENT*)
{
return 1;
}
@@ -603,18 +607,19 @@ int __cdecl CYahooProto::RecvAwayMsg( HANDLE /*hContact*/, int /*statusMode*/, P
////////////////////////////////////////////////////////////////////////////////////////
// SetAwayMsg - sets the away status message
-int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
+int __cdecl CYahooProto::SetAwayMsg(int status, const PROTOCHAR* msg)
{
char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL;
debugLogA("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c);
- if (!m_bLoggedIn) {
+ if (!m_bLoggedIn) {
if (m_iStatus == ID_STATUS_OFFLINE) {
debugLogA("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
mir_free(c);
return 1;
- } else {
+ }
+ else {
if (m_startMsg) free(m_startMsg);
m_startMsg = c ? strdup(c) : NULL;
@@ -634,10 +639,12 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
m_startMsg = strdup(c);
if (status == ID_STATUS_ONLINE) {
set_status(YAHOO_CUSTOM_STATUS, c, 0);
- } else if (status != ID_STATUS_INVISIBLE) {
+ }
+ else if (status != ID_STATUS_INVISIBLE) {
set_status(YAHOO_CUSTOM_STATUS, c, 1);
}
- } else {
+ }
+ else {
set_status(status, NULL, 0);
m_startMsg = NULL;
}
@@ -651,32 +658,33 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
INT_PTR __cdecl CYahooProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
{
- if (!m_bLoggedIn || ! m_startMsg)
+ if (!m_bLoggedIn || !m_startMsg)
return 0;
if (lParam & SGMA_UNICODE) {
- return (INT_PTR) mir_utf8decodeW(m_startMsg);
- } else {
- return (INT_PTR) mir_utf8decodeA(m_startMsg);
+ return (INT_PTR)mir_utf8decodeW(m_startMsg);
+ }
+ else {
+ return (INT_PTR)mir_utf8decodeA(m_startMsg);
}
}
/////////////////////////////////////////////////////////////////////////////////////////
// UserIsTyping - sends a UTN notification
-int __cdecl CYahooProto::UserIsTyping( HANDLE hContact, int type )
+int __cdecl CYahooProto::UserIsTyping(HCONTACT hContact, int type)
{
if (!m_bLoggedIn)
return 0;
char *szProto = GetContactProto(hContact);
- if (szProto==NULL || strcmp(szProto, m_szModuleName))
+ if (szProto == NULL || strcmp(szProto, m_szModuleName))
return 0;
DBVARIANT dbv;
if (!getString(hContact, YAHOO_LOGINID, &dbv)) {
if (type == PROTOTYPE_SELFTYPING_OFF || type == PROTOTYPE_SELFTYPING_ON) {
- sendtyping(dbv.pszVal, getWord(hContact, "yprotoid", 0), type == PROTOTYPE_SELFTYPING_ON?1:0);
+ sendtyping(dbv.pszVal, getWord(hContact, "yprotoid", 0), type == PROTOTYPE_SELFTYPING_ON ? 1 : 0);
}
db_free(&dbv);
}
@@ -686,31 +694,31 @@ int __cdecl CYahooProto::UserIsTyping( HANDLE hContact, int type )
/////////////////////////////////////////////////////////////////////////////////////////
// OnEvent - maintain protocol events
-int __cdecl CYahooProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam )
+int __cdecl CYahooProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
- switch( eventType ) {
- case EV_PROTO_ONLOAD: return OnModulesLoadedEx( 0, 0);
+ switch (eventType) {
+ case EV_PROTO_ONLOAD: return OnModulesLoadedEx(0, 0);
//case EV_PROTO_ONEXIT: return OnPreShutdown( 0, 0);
- case EV_PROTO_ONOPTIONS: return OnOptionsInit( wParam, lParam );
-
- case EV_PROTO_ONMENU:
- MenuMainInit();
- break;
-
- case EV_PROTO_ONRENAME:
- if ( mainMenuRoot ) {
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.ptszName = m_tszUserName;
- Menu_ModifyItem(mainMenuRoot, &mi);
- }
- break;
+ case EV_PROTO_ONOPTIONS: return OnOptionsInit(wParam, lParam);
+
+ case EV_PROTO_ONMENU:
+ MenuMainInit();
+ break;
- case EV_PROTO_ONCONTACTDELETED:
- return OnContactDeleted(wParam, lParam);
+ case EV_PROTO_ONRENAME:
+ if (mainMenuRoot) {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.ptszName = m_tszUserName;
+ Menu_ModifyItem(mainMenuRoot, &mi);
+ }
+ break;
+
+ case EV_PROTO_ONCONTACTDELETED:
+ return OnContactDeleted(wParam, lParam);
- case EV_PROTO_DBSETTINGSCHANGED:
- return OnSettingChanged(wParam, lParam);
+ case EV_PROTO_DBSETTINGSCHANGED:
+ return OnSettingChanged(wParam, lParam);
}
return 1;
}
@@ -727,12 +735,12 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ppro = (CYahooProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- if ( !ppro->getString(YAHOO_LOGINID, &dbv)) {
+ if (!ppro->getString(YAHOO_LOGINID, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_HANDLE, dbv.pszVal);
db_free(&dbv);
}
- if ( !ppro->getString(YAHOO_PASSWORD, &dbv)) {
+ if (!ppro->getString(YAHOO_PASSWORD, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
db_free(&dbv);
}
@@ -741,19 +749,19 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return TRUE;
case WM_COMMAND:
- if ( LOWORD( wParam ) == IDC_NEWYAHOOACCOUNTLINK ) {
+ if (LOWORD(wParam) == IDC_NEWYAHOOACCOUNTLINK) {
CallService(MS_UTILS_OPENURL,
- 1,
- ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN ) == 1) ?
- (LPARAM) "http://edit.yahoo.co.jp/config/eval_register" :
- (LPARAM) "http://edit.yahoo.com/config/eval_register"
- );
+ 1,
+ ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN) == 1) ?
+ (LPARAM) "http://edit.yahoo.co.jp/config/eval_register" :
+ (LPARAM) "http://edit.yahoo.com/config/eval_register"
+ );
return TRUE;
}
- if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus())
+ if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
{
- switch( LOWORD( wParam )) {
+ switch (LOWORD(wParam)) {
case IDC_HANDLE:
case IDC_PASSWORD:
case IDC_YAHOO_JAPAN:
@@ -763,7 +771,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY ) {
+ if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
char str[128];
BOOL reconnectRequired = FALSE;
@@ -771,17 +779,17 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
dbv.pszVal = NULL;
- if (ppro->getString( YAHOO_LOGINID, &dbv) || lstrcmpA(str, dbv.pszVal))
+ if (ppro->getString(YAHOO_LOGINID, &dbv) || lstrcmpA(str, dbv.pszVal))
reconnectRequired = TRUE;
- if ( dbv.pszVal != NULL)
+ if (dbv.pszVal != NULL)
db_free(&dbv);
ppro->setString(YAHOO_LOGINID, str);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(str));
dbv.pszVal = NULL;
- if (ppro->getString( YAHOO_PASSWORD, &dbv) || lstrcmpA(str, dbv.pszVal))
+ if (ppro->getString(YAHOO_PASSWORD, &dbv) || lstrcmpA(str, dbv.pszVal))
reconnectRequired = TRUE;
if (dbv.pszVal != NULL)
db_free(&dbv);
@@ -790,10 +798,10 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ppro->delSetting(YAHOO_PWTOKEN);
ppro->setString(YAHOO_PASSWORD, str);
- ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN ));
+ ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN));
- if ( reconnectRequired && ppro->m_bLoggedIn )
- MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK );
+ if (reconnectRequired && ppro->m_bLoggedIn)
+ MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK);
return TRUE;
}
@@ -803,9 +811,8 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return FALSE;
}
-
INT_PTR CYahooProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)CreateDialogParam (hInstance, MAKEINTRESOURCE( IDD_YAHOOACCOUNT ),
- (HWND)lParam, first_run_dialog, (LPARAM)this );
+ return (INT_PTR)CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_YAHOOACCOUNT),
+ (HWND)lParam, first_run_dialog, (LPARAM)this);
}
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h
index 7bff1a73dd..c548585dab 100644
--- a/protocols/Yahoo/src/proto.h
+++ b/protocols/Yahoo/src/proto.h
@@ -30,18 +30,18 @@ struct CYahooProto : public PROTO<CYahooProto>
virtual int __cdecl Authorize( HANDLE hDbEvent );
virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
- virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl AuthRequest( HANDLE hContact, const TCHAR* szMessage );
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
- virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
- virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
- virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
+ virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
@@ -49,49 +49,49 @@ struct CYahooProto : public PROTO<CYahooProto>
virtual HWND __cdecl SearchAdvanced( HWND owner );
virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
- virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvFile( HANDLE hContact, PROTORECVFILET* );
- virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* );
- virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* );
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
- virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles );
- virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg );
- virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url );
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
- virtual int __cdecl SetApparentMode( HANDLE hContact, int mode );
- virtual int __cdecl SetStatus( int iNewStatus );
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
+ virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact );
- virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR* msg );
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
+ virtual int __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR *msg);
virtual INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
- virtual int __cdecl UserIsTyping( HANDLE hContact, int type );
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
- virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
+ virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
//====| Events |======================================================================
- int __cdecl OnContactDeleted( WPARAM, LPARAM );
- int __cdecl OnIdleEvent( WPARAM, LPARAM );
- int __cdecl OnModulesLoadedEx( WPARAM, LPARAM );
- int __cdecl OnOptionsInit( WPARAM, LPARAM );
- int __cdecl OnSettingChanged( WPARAM, LPARAM );
+ int __cdecl OnContactDeleted(WPARAM, LPARAM);
+ int __cdecl OnIdleEvent(WPARAM, LPARAM);
+ int __cdecl OnModulesLoadedEx(WPARAM, LPARAM);
+ int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnSettingChanged(WPARAM, LPARAM);
int __cdecl OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam);
//====| Services |====================================================================
- INT_PTR __cdecl OnABCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnCalendarCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnEditMyProfile( WPARAM, LPARAM );
- INT_PTR __cdecl OnGotoMailboxCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnRefreshCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnShowMyProfileCommand( WPARAM, LPARAM );
- INT_PTR __cdecl OnShowProfileCommand( WPARAM, LPARAM );
+ INT_PTR __cdecl OnABCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnCalendarCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnEditMyProfile(WPARAM, LPARAM);
+ INT_PTR __cdecl OnGotoMailboxCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnRefreshCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnShowMyProfileCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl OnShowProfileCommand(WPARAM, LPARAM);
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl GetUnreadEmailCount( WPARAM, LPARAM );
- INT_PTR __cdecl SendNudge( WPARAM, LPARAM );
- INT_PTR __cdecl SetMyAvatar( WPARAM, LPARAM );
+ INT_PTR __cdecl GetUnreadEmailCount(WPARAM, LPARAM);
+ INT_PTR __cdecl SendNudge(WPARAM, LPARAM);
+ INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM);
INT_PTR __cdecl CreateConference(WPARAM /*wParam*/, LPARAM /*lParam*/);
@@ -141,9 +141,9 @@ struct CYahooProto : public PROTO<CYahooProto>
void __cdecl send_avt_thread(void *psf);
void __cdecl recv_avatarthread(void *pavt);
- INT_PTR __cdecl GetAvatarInfo( WPARAM, LPARAM );
- INT_PTR __cdecl GetAvatarCaps( WPARAM, LPARAM );
- INT_PTR __cdecl GetMyAvatar( WPARAM, LPARAM );
+ INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
+ INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM);
void ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type);
void ext_got_picture_checksum(const char *me, const char *who, int cksum);
@@ -152,11 +152,11 @@ struct CYahooProto : public PROTO<CYahooProto>
void ext_got_picture_upload(const char *me, const char *url, unsigned int ts);
void ext_got_avatar_share(int buddy_icon);
- void reset_avatar(HANDLE hContact);
+ void reset_avatar(HCONTACT hContact);
void request_avatar(const char* who);
void SendAvatar(const TCHAR *szFile);
- void GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int type);
+ void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, int cbLen, int type);
//====| chat.cpp |====================================================================
void ChatRegister(void);
@@ -195,13 +195,13 @@ struct CYahooProto : public PROTO<CYahooProto>
void send_msg(const char *id, int protocol, const char *msg, int utf8);
- void __cdecl im_sendacksuccess(HANDLE hContact);
- void __cdecl im_sendackfail(HANDLE hContact);
- void __cdecl im_sendackfail_longmsg(HANDLE hContact);
+ void __cdecl im_sendacksuccess(void *hContact);
+ void __cdecl im_sendackfail(void *hContact);
+ void __cdecl im_sendackfail_longmsg(void *hContact);
//====| proto.cpp |===================================================================
- void __cdecl get_status_thread(HANDLE hContact);
- void __cdecl get_info_thread(HANDLE hContact);
+ void __cdecl get_status_thread(void *hContact);
+ void __cdecl get_info_thread(void *hContact);
//====| search.cpp |==================================================================
void __cdecl search_simplethread(void *snsearch);
@@ -217,26 +217,26 @@ struct CYahooProto : public PROTO<CYahooProto>
void OpenURL(const char *url, int autoLogin);
- INT_PTR __cdecl SetCustomStatCommand( WPARAM, LPARAM );
+ INT_PTR __cdecl SetCustomStatCommand(WPARAM, LPARAM);
//====| user_info.cpp |===============================================================
int __cdecl OnUserInfoInit( WPARAM wParam, LPARAM lParam );
//====| util.cpp |====================================================================
- int GetStringUtf( HANDLE hContact, const char* name, DBVARIANT* );
- DWORD SetStringUtf( HANDLE hContact, const char* valueName, const char* parValue );
+ int GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* );
+ DWORD SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue );
- DWORD Set_Protocol( HANDLE hContact, int protocol );
+ DWORD Set_Protocol(HCONTACT hContact, int protocol );
int ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags);
void ShowError(const TCHAR *title, const TCHAR *buff);
int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL );
- bool IsMyContact(HANDLE hContact);
+ bool IsMyContact(HCONTACT hContact);
//====| yahoo.cpp |===================================================================
- HANDLE add_buddy( const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags );
+ HCONTACT add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags);
const char *find_buddy( const char *yahoo_id);
- HANDLE getbuddyH(const char *yahoo_id);
+ HCONTACT getbuddyH(const char *yahoo_id);
void remove_buddy(const char *who, int protocol);
void logout();
@@ -272,7 +272,7 @@ struct CYahooProto : public PROTO<CYahooProto>
void ext_login_response(int succ, const char *url);
void ext_login(enum yahoo_status login_mode);
- void AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg);
+ void AddBuddy(HCONTACT hContact, const char *group, const TCHAR *msg);
void YAHOO_utils_logversion();
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index 4730a59211..ebf142a7ab 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -31,7 +31,7 @@
void CYahooProto::logoff_buddies()
{
//set all contacts to 'offline'
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
setWord( hContact, "Status", ID_STATUS_OFFLINE );
setDword(hContact, "IdleTS", 0);
setDword(hContact, "PictLastCheck", 0);
@@ -80,14 +80,14 @@ void CYahooProto::BroadcastStatus(int s)
//=======================================================
//Contact deletion event
//=======================================================
-int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam )
+int __cdecl CYahooProto::OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
debugLogA("[YahooContactDeleted]");
- if ( !m_bLoggedIn ) {//should never happen for Yahoo contacts
+ if (!m_bLoggedIn) {//should never happen for Yahoo contacts
debugLogA("[YahooContactDeleted] We are not Logged On!!!");
return 0;
}
@@ -103,9 +103,9 @@ int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam )
remove_buddy(dbv.pszVal, getWord(hContact, "yprotoid", 0));
db_free(&dbv);
- } else {
- debugLogA("[YahooContactDeleted] Can't retrieve contact Yahoo ID");
}
+ else debugLogA("[YahooContactDeleted] Can't retrieve contact Yahoo ID");
+
return 0;
}
@@ -244,21 +244,21 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
}
//=======================================================
-//Show buddy profile
+// Show buddy profile
//=======================================================
-INT_PTR __cdecl CYahooProto::OnShowProfileCommand( WPARAM wParam, LPARAM lParam )
+INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM lParam)
{
- char tUrl[ 4096 ];
+ char tUrl[4096];
DBVARIANT dbv;
/**
* We don't show profile for users using other IM clients through the IM server bridge
*/
- if (getWord(( HANDLE )wParam, "yprotoid", 0) != 0) {
+ if (getWord((HCONTACT)wParam, "yprotoid", 0) != 0) {
return 0;
}
- if (getString((HANDLE)wParam, YAHOO_LOGINID, &dbv))
+ if (getString((HCONTACT)wParam, YAHOO_LOGINID, &dbv))
return 0;
mir_snprintf(tUrl, sizeof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
@@ -497,7 +497,7 @@ void CYahooProto::MenuUninit( void )
int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
if (!IsMyContact(hContact)) {
debugLogA("[OnPrebuildContactMenu] Not a Yahoo Contact!!!");
return 0;
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp
index 39d5ed9027..79a2c77c64 100644
--- a/protocols/Yahoo/src/user_info.cpp
+++ b/protocols/Yahoo/src/user_info.cpp
@@ -47,7 +47,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa
break;
char* szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact == NULL) {
szProto = ppro->m_szModuleName;
@@ -118,7 +118,7 @@ int __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam )
odp.dwInitParam = (LPARAM)this;
odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
- HANDLE hContact = ( HANDLE )lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
if ( IsMyContact(hContact)) {
odp.pfnDlgProc = YahooUserInfoDlgProc;
odp.position = -1900000000;
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index 044c31ba84..2cad148fb1 100644
--- a/protocols/Yahoo/src/util.cpp
+++ b/protocols/Yahoo/src/util.cpp
@@ -39,7 +39,7 @@ int debugLogA( const char *fmt, ... )
return CallService(MS_NETLIB_LOG, (WPARAM)g_hNetlibUser, (LPARAM)str);
}
-DWORD CYahooProto::Set_Protocol( HANDLE hContact, int protocol )
+DWORD CYahooProto::Set_Protocol(HCONTACT hContact, int protocol )
{
char *s=NULL;
@@ -59,11 +59,11 @@ DWORD CYahooProto::Set_Protocol( HANDLE hContact, int protocol )
return 0;
}
-int CYahooProto::GetStringUtf(HANDLE hContact, const char* name, DBVARIANT* result)
+int CYahooProto::GetStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result)
{ return db_get_utf(hContact, m_szModuleName, name, result);
}
-DWORD CYahooProto::SetStringUtf(HANDLE hContact, const char* valueName, const char* parValue)
+DWORD CYahooProto::SetStringUtf(HCONTACT hContact, const char* valueName, const char* parValue)
{ return db_set_utf(hContact, m_szModuleName, valueName, parValue);
}
@@ -162,8 +162,8 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam)
debugLogA("DB Setting changed. YAHOO user's visible setting changed.");
DBVARIANT dbv;
- if (!getString((HANDLE)wParam, YAHOO_LOGINID, &dbv)) {
- int iAdd = (ID_STATUS_OFFLINE == getWord((HANDLE) wParam, "ApparentMode", 0));
+ if (!getString((HCONTACT)wParam, YAHOO_LOGINID, &dbv)) {
+ int iAdd = (ID_STATUS_OFFLINE == getWord((HCONTACT)wParam, "ApparentMode", 0));
stealth(dbv.pszVal, iAdd);
db_free(&dbv);
}
@@ -171,7 +171,7 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
-bool CYahooProto::IsMyContact(HANDLE hContact)
+bool CYahooProto::IsMyContact(HCONTACT hContact)
{
if (!hContact)
return false;
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp
index 980fb3461e..9c5edf2f63 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -228,7 +228,7 @@ void CYahooProto::logout()
poll_loop = 0;
}
-void CYahooProto::AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg)
+void CYahooProto::AddBuddy(HCONTACT hContact, const char *group, const TCHAR *msg)
{
DBVARIANT dbv;
char *fname=NULL, *lname=NULL, *ident=NULL, *who, *u_msg;
@@ -282,9 +282,9 @@ void CYahooProto::AddBuddy(HANDLE hContact, const char *group, const TCHAR *msg)
mir_free(u_msg);
}
-HANDLE CYahooProto::getbuddyH(const char *yahoo_id)
+HCONTACT CYahooProto::getbuddyH(const char *yahoo_id)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
if (getString(hContact, YAHOO_LOGINID, &dbv))
continue;
@@ -300,12 +300,12 @@ HANDLE CYahooProto::getbuddyH(const char *yahoo_id)
return NULL;
}
-HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags )
+HCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, int protocol, DWORD flags)
{
char *yid = NEWSTR_ALLOCA(yahoo_id);
strlwr(yid);
- HANDLE hContact = getbuddyH(yid);
+ HCONTACT hContact = getbuddyH(yid);
if (hContact != NULL) {
LOG(("[add_buddy] Found buddy id: %s, handle: %p", yid, hContact));
if ( !(flags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 1)) {
@@ -319,7 +319,7 @@ HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int
//not already there: add
LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags));
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)m_szModuleName);
setString( hContact, YAHOO_LOGINID, yid );
Set_Protocol( hContact, protocol );
@@ -340,7 +340,7 @@ HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int
const char* CYahooProto::find_buddy( const char *yahoo_id)
{
static char nick[128];
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
hContact = getbuddyH(yahoo_id);
@@ -371,7 +371,7 @@ void CYahooProto::ext_status_changed(const char *who, int protocol, int stat, co
away,
idle);
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact == NULL) {
debugLogA("Buddy Not Found. Adding...");
hContact = add_buddy(who, who, protocol, 0);
@@ -426,7 +426,7 @@ void CYahooProto::ext_status_logon(const char *who, int protocol, int stat, cons
ext_status_changed(who, protocol, stat, msg, away, idle, mobile, utf8);
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact == NULL) {
debugLogA("[ext_status_logon] Can't find handle for %s??? PANIC!!!", who);
return;
@@ -569,7 +569,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a
LOG(("ext_got_audible for %s aud: %s msg:'%s' hash: %s", who, aud, msg, aud_hash));
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact == NULL) {
LOG(("Buddy Not Found. Skipping avatar update"));
return;
@@ -600,7 +600,7 @@ void CYahooProto::ext_got_stealth(char *stealthlist)
if (stealthlist)
stealth = y_strsplit(stealthlist, ",", -1);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
if (getString( hContact, YAHOO_LOGINID, &dbv))
continue;
@@ -645,7 +645,7 @@ void CYahooProto::ext_got_buddies(YList * buds)
debugLogA(("[ext_got_buddies] Walking buddy list..."));
for (; buds; buds = buds->next) {
- HANDLE hContact;
+ HCONTACT hContact;
yahoo_buddy *bud = ( yahoo_buddy* )buds->data;
if (bud == NULL) {
@@ -719,7 +719,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg)
{
LOG(("[ext_rejected] who: %s msg: %s", who, msg));
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact != NULL) {
/*
* Make sure the contact is temporary so we could delete it w/o extra traffic
@@ -739,7 +739,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg)
void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status, int auth)
{
- HANDLE hContact=getbuddyH(who);
+ HCONTACT hContact=getbuddyH(who);
LOG(("[ext_buddy_added] %s authorized you as %s group: %s status: %d auth: %d", who, myid, group, status, auth));
@@ -778,7 +778,7 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha
{
char nick[128];
BYTE *pCurBlob;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
PROTORECVEVENT pre = { 0 };
/* NOTE: Msg is actually in UTF8 unless stated otherwise!! */
@@ -869,7 +869,7 @@ void CYahooProto::ext_typing_notify(const char *me, const char *who, int protoco
{
LOG(("[ext_typing_notify] me: '%s' who: '%s' protocol: %d stat: %d ", me, who, protocol, stat));
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (hContact)
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)stat?10:0);
@@ -904,7 +904,7 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con
LOG(("[ext_game_notify] me: %s, who: %s, stat: %d, msg: %s", me, who, stat, msg));
/* FIXME - Not Implemented - this informs you someone else is playing on Yahoo! Games */
/* Also Stubbed in Sample Client */
- HANDLE hContact = getbuddyH(who);
+ HCONTACT hContact = getbuddyH(who);
if (!hContact)
return;