From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/EmLanProto/src/mlan.cpp | 24 ++++++++++++------------ protocols/EmLanProto/src/mlan.h | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'protocols/EmLanProto') diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 32bdd1a2da..539c82bf97 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -127,7 +127,7 @@ void CMLan::SetMirandaStatus(u_int status) void CMLan::SetAllOffline() { - for (HCONTACT hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) { + for (MCONTACT hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) { db_set_w(hContact, PROTONAME, "Status", ID_STATUS_OFFLINE); db_unset(hContact, PROTONAME, "IP"); } @@ -204,7 +204,7 @@ void CMLan::Check() if (!cont->m_time) { cont->m_status = ID_STATUS_OFFLINE; - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) { db_set_w(hContact,PROTONAME,"Status",ID_STATUS_OFFLINE); @@ -236,9 +236,9 @@ void CMLan::SendPacketExt(TPacket& pak, u_long addr) delete[] buf; } -HCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status) +MCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status) { - for (HCONTACT res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) { + for (MCONTACT res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) { u_long caddr = db_get_dw(res, PROTONAME, "ipaddr", -1); if (caddr==addr.S_un.S_addr) { if (make_permanent) @@ -250,7 +250,7 @@ HCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, b } if (add_to_list) { - HCONTACT res=(HCONTACT)CallService(MS_DB_CONTACT_ADD,0,0); + MCONTACT res=(MCONTACT)CallService(MS_DB_CONTACT_ADD,0,0); CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)res,(LPARAM)PROTONAME); db_set_dw(res,PROTONAME, "ipaddr", addr.S_un.S_addr); db_set_s(res,PROTONAME, "Nick", nick); @@ -315,7 +315,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) cont->m_ver = pak.idVersion; u_int old_status = cont->m_status; cont->m_status = pak.idStatus; - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) { db_set_w(hContact,PROTONAME, "Status", cont->m_status); @@ -358,7 +358,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.idAckMessage) { - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, false, false, false); if (hContact) ProtoBroadcastAck(PROTONAME, hContact, pak.flIsUrl?ACKTYPE_URL:ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pak.idAckMessage, 0); } @@ -374,7 +374,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.idReqAwayMessage && cont) { - HCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false); + MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false); // Removed - it causes that whoisreadingawaymessage plugin was not working // if (hContact) // { @@ -459,7 +459,7 @@ int CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr) bool TempAdd = flags&PALF_TEMPORARY; - HCONTACT contact = FindContact(addr, psr->hdr.nick, true, !TempAdd, !TempAdd, psr->stat); + MCONTACT contact = FindContact(addr, psr->hdr.nick, true, !TempAdd, !TempAdd, psr->stat); if (contact != NULL) { db_set_w(contact,PROTONAME,"Status", psr->stat ); db_set_w(contact,PROTONAME,"RemoteVersion", psr->ver ); @@ -568,7 +568,7 @@ void CMLan::SearchExt(TDataHolder* hold) void CMLan::SendMessageExt(TDataHolder* hold) { Sleep(0); - if (db_get_w((HCONTACT)hold->hContact, PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE) + if (db_get_w((MCONTACT)hold->hContact, PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE) { Sleep(20); ProtoBroadcastAck(PROTONAME, hold->hContact, (hold->op==LEXT_SENDURL)?ACKTYPE_URL:ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)hold->id, 0); @@ -577,7 +577,7 @@ void CMLan::SendMessageExt(TDataHolder* hold) { TPacket pak; ZeroMemory(&pak, sizeof(pak)); - u_long addr = db_get_dw((HCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); + u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); pak.strMessage = hold->msg; pak.idMessage = hold->id; if (hold->op==LEXT_SENDURL) @@ -594,7 +594,7 @@ void CMLan::GetAwayMsgExt(TDataHolder* hold) TPacket pak; ZeroMemory(&pak, sizeof(pak)); pak.idReqAwayMessage = hold->id; - u_long addr = db_get_dw((HCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); + u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); SendPacketExt(pak, addr); ProtoBroadcastAck(PROTONAME, hold->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SENTREQUEST, (HANDLE)hold->id, 0); diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h index 41bde7544b..71d4182dfa 100644 --- a/protocols/EmLanProto/src/mlan.h +++ b/protocols/EmLanProto/src/mlan.h @@ -30,7 +30,7 @@ public: long id; long op; - HCONTACT hContact; + MCONTACT hContact; char* const msg; CMLan* lan; @@ -101,7 +101,7 @@ private: CRITICAL_SECTION m_csAccessAwayMes; void RequestStatus(bool answer=false, u_long m_addr=INADDR_BROADCAST); - HCONTACT FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status = ID_STATUS_ONLINE); + MCONTACT FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status = ID_STATUS_ONLINE); void DeleteCache(); void StartChecking(); @@ -176,7 +176,7 @@ private: int m_cid; SOCKET m_socket; u_long m_addr; - HCONTACT m_hContact; + MCONTACT m_hContact; char* m_szDescription; char** m_szFiles; -- cgit v1.2.3