From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/avatars.cpp | 6 +-- protocols/AimOscar/src/chat.cpp | 6 +-- protocols/AimOscar/src/file.cpp | 4 +- protocols/AimOscar/src/file.h | 8 ++-- protocols/AimOscar/src/links.cpp | 4 +- protocols/AimOscar/src/proto.cpp | 46 +++++++++++------------ protocols/AimOscar/src/proto.h | 74 ++++++++++++++++++------------------- protocols/AimOscar/src/server.cpp | 24 ++++++------ protocols/AimOscar/src/services.cpp | 18 ++++----- protocols/AimOscar/src/theme.cpp | 16 ++++---- protocols/AimOscar/src/theme.h | 2 +- protocols/AimOscar/src/ui.cpp | 20 +++++----- protocols/AimOscar/src/utility.cpp | 40 ++++++++++---------- 13 files changed, 134 insertions(+), 134 deletions(-) (limited to 'protocols/AimOscar') diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index a4617dbd29..a5d6c1cc5d 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . void __cdecl CAimProto::avatar_request_thread(void* param) { - HCONTACT hContact = (HCONTACT)param; + MCONTACT hContact = (MCONTACT)param; char *sn = getStringA(hContact, AIM_KEY_SN); debugLogA("Starting avatar request thread for %s)", sn); @@ -59,7 +59,7 @@ void __cdecl CAimProto::avatar_upload_thread(void* param) delete req; } -void CAimProto::avatar_request_handler(HCONTACT hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested +void CAimProto::avatar_request_handler(MCONTACT hContact, char* hash, unsigned char type)//checks to see if the avatar needs requested { if (hContact == NULL) { @@ -121,7 +121,7 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, res ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, &AI, 0); } -int CAimProto::get_avatar_filename(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) +int CAimProto::get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName); diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp index 7ba14d4e84..29b1a202dd 100644 --- a/protocols/AimOscar/src/chat.cpp +++ b/protocols/AimOscar/src/chat.cpp @@ -68,7 +68,7 @@ void CAimProto::chat_event(const char* id, const char* sn, int evt, const TCHAR* TCHAR* idt = mir_a2t(id); TCHAR* snt = mir_a2t(sn); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; @@ -137,7 +137,7 @@ int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_PRIVMESS: { char* sn = mir_t2a(gch->ptszUID); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); mir_free(sn); CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); } @@ -160,7 +160,7 @@ int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_NICKLISTMENU: { char *sn = mir_t2a(gch->ptszUID); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); mir_free(sn); switch (gch->dwData) diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 8d4972e3e4..03871937f8 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -484,7 +484,7 @@ void CAimProto::shutdown_file_transfers(void) ft_list_type::ft_list_type() : OBJLIST (10) {}; -file_transfer* ft_list_type::find_by_cookie(char* cookie, HCONTACT hContact) +file_transfer* ft_list_type::find_by_cookie(char* cookie, MCONTACT hContact) { for (int i = 0; i < getCount(); ++i) { @@ -528,7 +528,7 @@ void ft_list_type::remove_by_ft(file_transfer *ft) } } -file_transfer::file_transfer(HCONTACT hCont, char* nick, char* cookie) +file_transfer::file_transfer(MCONTACT hCont, char* nick, char* cookie) { memset(this, 0, sizeof(*this)); diff --git a/protocols/AimOscar/src/file.h b/protocols/AimOscar/src/file.h index 61bc3e9d13..4577f2bb0e 100644 --- a/protocols/AimOscar/src/file.h +++ b/protocols/AimOscar/src/file.h @@ -23,7 +23,7 @@ struct CAimProto; struct file_transfer { - HCONTACT hContact; + MCONTACT hContact; char* sn; char icbm_cookie[8]; @@ -56,7 +56,7 @@ struct file_transfer bool requester; bool success; - file_transfer(HCONTACT hCont, char* nick, char* cookie); + file_transfer(MCONTACT hCont, char* nick, char* cookie); ~file_transfer(); void listen(CAimProto* ppro); @@ -68,8 +68,8 @@ struct ft_list_type : OBJLIST { ft_list_type(); - file_transfer* find_by_handle(HCONTACT hContact); - file_transfer* find_by_cookie(char* cookie, HCONTACT hContact); + file_transfer* find_by_handle(MCONTACT hContact); + file_transfer* find_by_cookie(char* cookie, MCONTACT hContact); file_transfer* find_by_port(unsigned short port); bool find_by_ft(file_transfer *ft); diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index a4ca30f868..0286e3af93 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -113,7 +113,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam) if (!proto->contact_from_sn(sn)) /* does not yet check if sn is current user */ { - HCONTACT hContact = proto->contact_from_sn(sn, true); + MCONTACT hContact = proto->contact_from_sn(sn, true); proto->add_contact_to_group(hContact, group && group[0] ? group : AIM_DEFAULT_GROUP); } mir_free(group); @@ -137,7 +137,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam) } if (sn == NULL) return 1; /* parse failed */ - HCONTACT hContact = proto->contact_from_sn(sn, true, true); + MCONTACT hContact = proto->contact_from_sn(sn, true, true); if (hContact) CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, (LPARAM)msg); diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index c7001071cc..fb51b7e3b9 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -126,17 +126,17 @@ int CAimProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -HCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { if (state != 1) return 0; TCHAR *id = psr->id ? psr->id : psr->nick; char *sn = psr->flags & PSR_UNICODE ? mir_u2a((wchar_t*)id) : mir_strdup((char*)id); - HCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0); + MCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0); mir_free(sn); return hContact; //See authrequest for serverside addition } -HCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; } @@ -160,7 +160,7 @@ int CAimProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CAimProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) +int __cdecl CAimProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt) { return 1; } @@ -168,7 +168,7 @@ int __cdecl CAimProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CAimProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage) +int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) { //Not a real authrequest- only used b/c we don't know the group until now. if (state != 1) @@ -196,7 +196,7 @@ HANDLE __cdecl CAimProto::ChangeInfo(int iInfoType, void* pInfoData) //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CAimProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE __cdecl CAimProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { file_transfer *ft = (file_transfer*)hTransfer; if (ft && ft_list.find_by_ft(ft)) @@ -224,7 +224,7 @@ HANDLE __cdecl CAimProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const P //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CAimProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int __cdecl CAimProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -247,7 +247,7 @@ int __cdecl CAimProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CAimProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) +int __cdecl CAimProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -302,7 +302,7 @@ int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CAimProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR __cdecl CAimProto::GetCaps(int type, MCONTACT hContact) { switch (type) { @@ -345,7 +345,7 @@ DWORD_PTR __cdecl CAimProto::GetCaps(int type, HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // GetInfo - retrieves a contact info -int __cdecl CAimProto::GetInfo(HCONTACT hContact, int infoType) +int __cdecl CAimProto::GetInfo(MCONTACT hContact, int infoType) { return 1; } @@ -421,7 +421,7 @@ HWND __cdecl CAimProto::CreateExtendedSearchUI(HWND owner) //////////////////////////////////////////////////////////////////////////////////////// // RecvContacts -int __cdecl CAimProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CAimProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -429,7 +429,7 @@ int __cdecl CAimProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // RecvFile -int __cdecl CAimProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) +int __cdecl CAimProto::RecvFile(MCONTACT hContact, PROTOFILEEVENT* evt) { return Proto_RecvFile(hContact, evt); } @@ -437,7 +437,7 @@ int __cdecl CAimProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) //////////////////////////////////////////////////////////////////////////////////////// // RecvMsg -int __cdecl CAimProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) +int __cdecl CAimProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { char *omsg = pre->szMessage; char *bbuf = NULL; @@ -458,7 +458,7 @@ int __cdecl CAimProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // RecvUrl -int __cdecl CAimProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) +int __cdecl CAimProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 1; } @@ -466,7 +466,7 @@ int __cdecl CAimProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*) //////////////////////////////////////////////////////////////////////////////////////// // SendContacts -int __cdecl CAimProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int __cdecl CAimProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } @@ -474,7 +474,7 @@ int __cdecl CAimProto::SendContacts(HCONTACT hContact, int flags, int nContacts, //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CAimProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) +HANDLE __cdecl CAimProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { if (state != 1) return 0; @@ -557,7 +557,7 @@ void __cdecl CAimProto::msg_ack_success(void* param) } -int __cdecl CAimProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CAimProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) { if (pszSrc == NULL) return 0; @@ -626,7 +626,7 @@ int __cdecl CAimProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc) //////////////////////////////////////////////////////////////////////////////////////// // SendUrl -int __cdecl CAimProto::SendUrl(HCONTACT hContact, int flags, const char* url) +int __cdecl CAimProto::SendUrl(MCONTACT hContact, int flags, const char* url) { return 1; } @@ -634,7 +634,7 @@ int __cdecl CAimProto::SendUrl(HCONTACT hContact, int flags, const char* url) //////////////////////////////////////////////////////////////////////////////////////// // SetApparentMode - sets the visibility m_iStatus -int __cdecl CAimProto::SetApparentMode(HCONTACT hContact, int mode) +int __cdecl CAimProto::SetApparentMode(MCONTACT hContact, int mode) { return 0; } @@ -715,7 +715,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg) { Sleep(150); - HCONTACT hContact = (HCONTACT)arg; + MCONTACT hContact = (MCONTACT)arg; DBVARIANT dbv; if (!db_get_ts(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); @@ -724,7 +724,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg) else ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -HANDLE __cdecl CAimProto::GetAwayMsg(HCONTACT hContact) +HANDLE __cdecl CAimProto::GetAwayMsg(MCONTACT hContact) { if (state != 1) return 0; @@ -746,7 +746,7 @@ HANDLE __cdecl CAimProto::GetAwayMsg(HCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CAimProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* pre) +int __cdecl CAimProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* pre) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)pre->szMessage); return 0; @@ -800,7 +800,7 @@ int __cdecl CAimProto::SetAwayMsg(int status, const TCHAR* msg) ///////////////////////////////////////////////////////////////////////////////////////// // UserIsTyping - sends a UTN notification -int __cdecl CAimProto::UserIsTyping(HCONTACT hContact, int type) +int __cdecl CAimProto::UserIsTyping(MCONTACT hContact, int type) { if (state != 1) return 0; diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index fa1f999728..9a59176ab0 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -28,23 +28,23 @@ struct CAimProto : public PROTO // PROTO_INTERFACE //==================================================================================== - virtual HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); + virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage ); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer ); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer ); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason ); virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); - virtual DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL ); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType ); + virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL ); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ); @@ -52,24 +52,24 @@ struct CAimProto : public PROTO virtual HWND __cdecl SearchAdvanced( HWND owner ); virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* ); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT* ); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* ); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* ); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); - virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg ); - virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url ); + virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg ); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url ); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode ); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode ); virtual int __cdecl SetStatus( int iNewStatus ); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact ); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt ); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact ); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt ); virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg ); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type ); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type ); virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); @@ -213,9 +213,9 @@ struct CAimProto : public PROTO void __cdecl avatar_request_thread( void* param ); void __cdecl avatar_upload_thread( void* param ); - void avatar_request_handler(HCONTACT hContact, char* hash, unsigned char type); + void avatar_request_handler(MCONTACT hContact, char* hash, unsigned char type); void avatar_retrieval_handler(const char* sn, const char* hash, const char* data, int data_len); - int get_avatar_filename(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); + int get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext); ////////////////////////////////////////////////////////////////////////////////////// // away.cpp @@ -414,37 +414,37 @@ struct CAimProto : public PROTO ////////////////////////////////////////////////////////////////////////////////////// // utilities.cpp - struct msg_ack_param { HCONTACT hContact; const char *msg; int id; bool success; }; + struct msg_ack_param { MCONTACT hContact; const char *msg; int id; bool success; }; void __cdecl msg_ack_success(void*); void __cdecl start_connection(void*); - HCONTACT find_chat_contact(const char * room); - HCONTACT contact_from_sn(const char* sn, bool addIfNeeded = false, bool temporary = false); + MCONTACT find_chat_contact(const char * room); + MCONTACT contact_from_sn(const char* sn, bool addIfNeeded = false, bool temporary = false); void broadcast_status(int status); bool wait_conn(HANDLE& hConn, HANDLE& hEvent, unsigned short service); - bool is_my_contact(HCONTACT hContact); - void add_contact_to_group(HCONTACT hContact, const char* group); - void set_local_nick(HCONTACT hContact, char* nick, char* note); + bool is_my_contact(MCONTACT hContact); + void add_contact_to_group(MCONTACT hContact, const char* group); + void set_local_nick(MCONTACT hContact, char* nick, char* note); void upload_nicks(void); void update_server_group(const char* group, unsigned short group_id); void offline_contacts(void); - void offline_contact(HCONTACT hContact, bool remove_settings); + void offline_contact(MCONTACT hContact, bool remove_settings); unsigned short get_default_port(void); int open_contact_file(const char* sn, const TCHAR* file, const char* mode, TCHAR* &path, bool contact_dir); void write_away_message(const char* sn, const char* msg, bool utf); void write_profile(const char* sn, const char* msg, bool utf); - unsigned short getBuddyId(HCONTACT hContact, int i); - unsigned short getGroupId(HCONTACT hContact, int i); - void setBuddyId(HCONTACT hContact, int i, unsigned short id); - void setGroupId(HCONTACT hContact, int i, unsigned short id); - int deleteBuddyId(HCONTACT hContact, int i); - int deleteGroupId(HCONTACT hContact, int i); + unsigned short getBuddyId(MCONTACT hContact, int i); + unsigned short getGroupId(MCONTACT hContact, int i); + void setBuddyId(MCONTACT hContact, int i, unsigned short id); + void setGroupId(MCONTACT hContact, int i, unsigned short id); + int deleteBuddyId(MCONTACT hContact, int i); + int deleteGroupId(MCONTACT hContact, int i); - unsigned short search_for_free_item_id(HCONTACT hbuddy); + unsigned short search_for_free_item_id(MCONTACT hbuddy); unsigned short* get_members_of_group(unsigned short group_id, unsigned short& size); void ShowPopup( const char* msg, int flags, char* url = 0 ); diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 2702a5af90..4a966254a7 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -238,7 +238,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 unsigned char sn_len = snac.ubyte(); char* sn = snac.part(1, sn_len); - HCONTACT hContact = contact_from_sn(sn, true); + MCONTACT hContact = contact_from_sn(sn, true); int offset = sn_len + 3; int tlv_count = snac.ushort(offset); @@ -618,7 +618,7 @@ void CAimProto::snac_user_offline(SNAC &snac)//family 0x0003 { unsigned char buddy_length=snac.ubyte(); char* buddy=snac.part(1,buddy_length); - HCONTACT hContact=contact_from_sn(buddy, true); + MCONTACT hContact=contact_from_sn(buddy, true); if (hContact) offline_contact(hContact,0); mir_free(buddy); @@ -646,7 +646,7 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset) { case 0x0000: //buddy record { - HCONTACT hContact = contact_from_sn(name, true); + MCONTACT hContact = contact_from_sn(name, true); if (hContact) { int i; @@ -863,7 +863,7 @@ void CAimProto::modify_ssi_list(SNAC &snac, int &offset) { case 0x0000: //buddy record { - HCONTACT hContact = contact_from_sn(name, true); + MCONTACT hContact = contact_from_sn(name, true); if (hContact) { for (int tlv_offset = 0; tlv_offset < tlv_size; ) @@ -982,7 +982,7 @@ void CAimProto::delete_ssi_list(SNAC &snac, int &offset) unsigned short item_id=snac.ushort(offset+4+name_length); unsigned short type=snac.ushort(offset+6+name_length); - HCONTACT hContact = contact_from_sn(name); + MCONTACT hContact = contact_from_sn(name); switch (type) { case 0x0000: //buddy record @@ -1094,7 +1094,7 @@ void CAimProto::snac_message_accepted(SNAC &snac)//family 0x004 unsigned char sn_length=snac.ubyte(10); char* sn = snac.part(11,sn_length); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); if (hContact) { msg_ack_param *msg_ack = (msg_ack_param*)mir_alloc(sizeof(msg_ack_param)); @@ -1117,7 +1117,7 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho unsigned char sn_length = snac.ubyte(10); char* sn = snac.part(11,sn_length); - HCONTACT hContact = contact_from_sn(sn, true, true), hMsgContact = NULL; + MCONTACT hContact = contact_from_sn(sn, true, true), hMsgContact = NULL; int offset=15+sn_length; @@ -1476,7 +1476,7 @@ void CAimProto::snac_file_decline(SNAC &snac)//family 0x0004 int sn_len = snac.ubyte(10); char* sn = snac.part(11, sn_len); int reason = snac.ushort(11 + sn_len); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); msg_ack_param *msg_ack = (msg_ack_param*)mir_alloc(sizeof(msg_ack_param)); msg_ack->hContact = hContact; @@ -1496,7 +1496,7 @@ void CAimProto::snac_file_decline(SNAC &snac)//family 0x0004 if (error == 0x02) { debugLogA("File Transfer declied"); - HCONTACT hContact = contact_from_sn(sn); + MCONTACT hContact = contact_from_sn(sn); file_transfer *ft = ft_list.find_by_cookie(icbm_cookie, hContact); if (ft) { @@ -1527,7 +1527,7 @@ void CAimProto::snac_received_info(SNAC &snac)//family 0x0002 char* sn = snac.part(1, sn_length); unsigned short tlv_count = snac.ushort(3 + sn_length); offset = 5 + sn_length; - HCONTACT hContact = contact_from_sn(sn, true, true); + MCONTACT hContact = contact_from_sn(sn, true, true); while (offset < snac.len()) { @@ -1589,7 +1589,7 @@ void CAimProto::snac_typing_notification(SNAC &snac)//family 0x004 { unsigned char sn_length=snac.ubyte(10); char* sn=snac.part(11,sn_length); - HCONTACT hContact=contact_from_sn(sn); + MCONTACT hContact=contact_from_sn(sn); if (hContact) { unsigned short type=snac.ushort(11+sn_length); @@ -2304,7 +2304,7 @@ void CAimProto::snac_admin_account_confirm(SNAC &snac)//family 0x0007 { char sn[33]; int sn_length=buf[SNAC_SIZE*2]; - HCONTACT hContact; + MCONTACT hContact; ZeroMemory(sn,sizeof(sn)); memcpy(sn,&buf[SNAC_SIZE*2+1],sn_length); hContact=find_contact(sn); diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index f2646551c0..64ac487fe9 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -91,7 +91,7 @@ INT_PTR CAimProto::GetProfile(WPARAM wParam, LPARAM lParam) return 0; DBVARIANT dbv; - if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv)) { + if (!getString((MCONTACT)wParam, AIM_KEY_SN, &dbv)) { request_HTML_profile = 1; aim_query_profile(hServerConn, seqno, dbv.pszVal); db_free(&dbv); @@ -105,7 +105,7 @@ INT_PTR CAimProto::GetHTMLAwayMsg(WPARAM wParam, LPARAM /*lParam*/) return 0; DBVARIANT dbv; - if (!getString((HCONTACT)wParam, AIM_KEY_SN, &dbv)) + if (!getString((MCONTACT)wParam, AIM_KEY_SN, &dbv)) { request_away_message = 1; aim_query_away_message(hServerConn, seqno, dbv.pszVal); @@ -119,7 +119,7 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam) if (strcmp(cws->szModule, MOD_KEY_CL) == 0 && state == 1 && wParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (strcmp(cws->szSetting, AIM_KEY_NL) == 0) { if (cws->value.type == DBVT_DELETED) @@ -169,7 +169,7 @@ int CAimProto::OnContactDeleted(WPARAM wParam,LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0)) return 0; @@ -203,7 +203,7 @@ int CAimProto::OnGroupChange(WPARAM wParam,LPARAM lParam) { if (state != 1 || !getByte(AIM_KEY_MG, 1)) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam; if (hContact == NULL) @@ -254,7 +254,7 @@ INT_PTR CAimProto::AddToServerList(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0]) { @@ -270,7 +270,7 @@ INT_PTR CAimProto::BlockBuddy(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; unsigned short item_id; DBVARIANT dbv; if (getString(hContact, AIM_KEY_SN, &dbv)) return 0; @@ -328,7 +328,7 @@ INT_PTR CAimProto::OnJoinChat(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) @@ -344,7 +344,7 @@ INT_PTR CAimProto::OnLeaveChat(WPARAM wParam, LPARAM /*lParam*/) { if (state != 1) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 711dd27b9d..57fdc2a032 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -120,7 +120,7 @@ static const char* extra_ES_icon_name[2] = "hiptop", }; -static void set_AT_icon(CAimProto* ppro, HCONTACT hContact) +static void set_AT_icon(CAimProto* ppro, MCONTACT hContact) { if (ppro->isChatRoom(hContact)) return; @@ -128,7 +128,7 @@ static void set_AT_icon(CAimProto* ppro, HCONTACT hContact) ExtraIcon_SetIcon(hExtraAT, hContact, (i < 5) ? GetIconHandle(extra_AT_icon_name[i]) : NULL); } -static void set_ES_icon(CAimProto* ppro, HCONTACT hContact) +static void set_ES_icon(CAimProto* ppro, MCONTACT hContact) { if (ppro->isChatRoom(hContact)) return; @@ -136,7 +136,7 @@ static void set_ES_icon(CAimProto* ppro, HCONTACT hContact) ExtraIcon_SetIcon(hExtraAT, hContact, (i < 2) ? GetIconHandle(extra_ES_icon_name[i]) : NULL); } -void set_contact_icon(CAimProto* ppro, HCONTACT hContact) +void set_contact_icon(CAimProto* ppro, MCONTACT hContact) { if (!ppro->getByte(AIM_KEY_AT, 0)) set_AT_icon(ppro, hContact); if (!ppro->getByte(AIM_KEY_ES, 0)) set_ES_icon(ppro, hContact); @@ -144,27 +144,27 @@ void set_contact_icon(CAimProto* ppro, HCONTACT hContact) void remove_AT_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) if (!ppro->isChatRoom(hContact)) ExtraIcon_Clear(hExtraAT, hContact); } void remove_ES_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) if (!ppro->isChatRoom(hContact)) ExtraIcon_Clear(hExtraES, hContact); } void add_AT_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) set_AT_icon(ppro, hContact); } void add_ES_icons(CAimProto* ppro) { - for (HCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) + for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) set_ES_icon(ppro, hContact); } @@ -179,7 +179,7 @@ void InitExtraIcons(void) int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; bool bIsChatRoom = isChatRoom(hContact); //see if we should add the html away message context menu items diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h index c2e8093ce9..e2e6531174 100644 --- a/protocols/AimOscar/src/theme.h +++ b/protocols/AimOscar/src/theme.h @@ -33,6 +33,6 @@ void remove_AT_icons(CAimProto* ppro); void add_ES_icons(CAimProto* ppro); void remove_ES_icons(CAimProto* ppro); -void set_contact_icon(CAimProto* ppro, HCONTACT hContact); +void set_contact_icon(CAimProto* ppro, MCONTACT hContact); #endif diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index fd4dba0bea..fbcf065d70 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -1326,14 +1326,14 @@ INT_PTR CALLBACK join_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ///////////////////////////////////////////////////////////////////////////////////////// // Invite to chat dialog -static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg) +static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, chat_list_item* item, CAimProto* ppro, char *msg) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) clist_chat_invite_send(hItemT, hwndList, item, ppro, msg); } @@ -1359,26 +1359,26 @@ static void clist_chat_invite_send(HCONTACT hItem, HWND hwndList, chat_list_item } } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } -static void clist_validate_contact(HCONTACT hItem, HWND hwndList, CAimProto* ppro) +static void clist_validate_contact(MCONTACT hItem, HWND hwndList, CAimProto* ppro) { if (!ppro->is_my_contact(hItem) || ppro->isChatRoom(hItem) || ppro->getWord(hItem, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE) SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0); } -static void clist_chat_prepare(HCONTACT hItem, HWND hwndList, CAimProto* ppro) +static void clist_chat_prepare(MCONTACT hItem, HWND hwndList, CAimProto* ppro) { if (hItem == NULL) - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) clist_chat_prepare(hItemT, hwndList, ppro); } @@ -1423,7 +1423,7 @@ INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP { case CLN_NEWCONTACT: if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0) - clist_validate_contact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); + clist_validate_contact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro); break; case CLN_LISTREBUILT: diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 7df2eccaaf..119234a93c 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -160,15 +160,15 @@ unsigned short CAimProto::get_default_port(void) return getWord(AIM_KEY_PN, getByte(AIM_KEY_DSSL, 0) ? AIM_DEFAULT_PORT : AIM_DEFAULT_SSL_PORT); } -bool CAimProto::is_my_contact(HCONTACT hContact) +bool CAimProto::is_my_contact(MCONTACT hContact) { const char* szProto = GetContactProto(hContact); return szProto != NULL && strcmp(m_szModuleName, szProto) == 0; } -HCONTACT CAimProto::find_chat_contact(const char* room) +MCONTACT CAimProto::find_chat_contact(const char* room) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (!getString(hContact, "ChatRoomID", &dbv)) { bool found = !strcmp(room, dbv.pszVal); @@ -180,11 +180,11 @@ HCONTACT CAimProto::find_chat_contact(const char* room) return NULL; } -HCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary) +MCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary) { ptrA norm_sn( normalize_name(sn)); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if (!getString(hContact, AIM_KEY_SN, &dbv)) { bool found = !strcmp(norm_sn, dbv.pszVal); @@ -195,7 +195,7 @@ HCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempo } if (addIfNeeded) { - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) m_szModuleName) == 0) { setString(hContact, AIM_KEY_SN, norm_sn); @@ -234,7 +234,7 @@ void CAimProto::update_server_group(const char* group, unsigned short group_id) mir_free(user_id_array); } -void CAimProto::add_contact_to_group(HCONTACT hContact, const char* new_group) +void CAimProto::add_contact_to_group(MCONTACT hContact, const char* new_group) { if (new_group == NULL) return; @@ -300,7 +300,7 @@ void CAimProto::add_contact_to_group(HCONTACT hContact, const char* new_group) db_free(&dbv); } -void CAimProto::offline_contact(HCONTACT hContact, bool remove_settings) +void CAimProto::offline_contact(MCONTACT hContact, bool remove_settings) { if (remove_settings) { @@ -318,7 +318,7 @@ void CAimProto::offline_contact(HCONTACT hContact, bool remove_settings) void CAimProto::offline_contacts(void) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) offline_contact(hContact,true); allow_list.destroy(); @@ -376,14 +376,14 @@ void create_group(const char *group) mir_free(szGroupName); } -unsigned short CAimProto::search_for_free_item_id(HCONTACT hbuddy)//returns a free item id and links the id to the buddy +unsigned short CAimProto::search_for_free_item_id(MCONTACT hbuddy)//returns a free item id and links the id to the buddy { unsigned short id; retry: id = get_random(); - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { for(int i=1; ;++i) { unsigned short item_id = getBuddyId(hContact, i); if (item_id == 0) break; @@ -402,7 +402,7 @@ unsigned short* CAimProto::get_members_of_group(unsigned short group_id, unsigne unsigned short* list = NULL; size = 0; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { for(int i=1; ;++i) { unsigned short user_group_id = getGroupId(hContact, i); if (user_group_id == 0) @@ -422,7 +422,7 @@ unsigned short* CAimProto::get_members_of_group(unsigned short group_id, unsigne void CAimProto::upload_nicks(void) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { DBVARIANT dbv; if ( !db_get_utf(hContact, MOD_KEY_CL, "MyHandle", &dbv)) { set_local_nick(hContact, dbv.pszVal, NULL); @@ -431,7 +431,7 @@ void CAimProto::upload_nicks(void) } } -void CAimProto::set_local_nick(HCONTACT hContact, char* nick, char* note) +void CAimProto::set_local_nick(MCONTACT hContact, char* nick, char* note) { DBVARIANT dbv; if (getString(hContact, AIM_KEY_SN, &dbv)) return; @@ -498,42 +498,42 @@ void BdList::remove_by_id(unsigned short id) ///////////////////////////////////////////////////////////////////////////////////////// -unsigned short CAimProto::getBuddyId(HCONTACT hContact, int i) +unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); return getWord(hContact, item, 0); } -void CAimProto::setBuddyId(HCONTACT hContact, int i, unsigned short id) +void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); setWord(hContact, item, id); } -int CAimProto::deleteBuddyId(HCONTACT hContact, int i) +int CAimProto::deleteBuddyId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_BI)+10]; mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i); return delSetting(hContact, item); } -unsigned short CAimProto::getGroupId(HCONTACT hContact, int i) +unsigned short CAimProto::getGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); return getWord(hContact, item, 0); } -void CAimProto::setGroupId(HCONTACT hContact, int i, unsigned short id) +void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); setWord(hContact, item, id); } -int CAimProto::deleteGroupId(HCONTACT hContact, int i) +int CAimProto::deleteGroupId(MCONTACT hContact, int i) { char item[sizeof(AIM_KEY_GI)+10]; mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i); -- cgit v1.2.3