summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/AimOscar/src')
-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
13 files changed, 149 insertions, 161 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);