summaryrefslogtreecommitdiff
path: root/protocols/Tlen
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tlen')
-rw-r--r--protocols/Tlen/src/tlen.cpp10
-rw-r--r--protocols/Tlen/src/tlen.h50
-rw-r--r--protocols/Tlen/src/tlen_avatar.cpp14
-rw-r--r--protocols/Tlen/src/tlen_avatar.h2
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp16
-rw-r--r--protocols/Tlen/src/tlen_misc.cpp18
-rw-r--r--protocols/Tlen/src/tlen_muc.cpp12
-rw-r--r--protocols/Tlen/src/tlen_picture.cpp2
-rw-r--r--protocols/Tlen/src/tlen_picture.h2
-rw-r--r--protocols/Tlen/src/tlen_presence.cpp4
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp66
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp10
-rw-r--r--protocols/Tlen/src/tlen_userinfo.cpp8
-rw-r--r--protocols/Tlen/src/tlen_util.cpp2
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp6
15 files changed, 111 insertions, 111 deletions
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 0bf2926e3e..377d52f43c 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -114,7 +114,7 @@ static void TlenRegisterIcons()
int TlenProtocol::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && isOnline) {
DBVARIANT dbv;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
@@ -140,7 +140,7 @@ int TlenProtocol::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
INT_PTR TlenProtocol::ContactMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && isOnline) {
DBVARIANT dbv;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
@@ -153,7 +153,7 @@ INT_PTR TlenProtocol::ContactMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
INT_PTR TlenProtocol::ContactMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && isOnline) {
DBVARIANT dbv;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
@@ -166,7 +166,7 @@ INT_PTR TlenProtocol::ContactMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
INT_PTR TlenProtocol::ContactMenuHandleSendPicture(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && isOnline)
SendPicture(this, hContact);
@@ -241,7 +241,7 @@ int TlenProtocol::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
char str[128];
/* Set all contacts to offline */
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
if (db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE);
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h
index 9748f47742..e9ad52b64a 100644
--- a/protocols/Tlen/src/tlen.h
+++ b/protocols/Tlen/src/tlen.h
@@ -223,18 +223,18 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
@@ -242,24 +242,24 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
@@ -381,7 +381,7 @@ typedef struct ThreadDataStruct{
typedef enum { FT_CONNECTING, FT_INITIALIZING, FT_RECEIVING, FT_DONE, FT_ERROR, FT_DENIED, FT_SWITCH } TLEN_FILE_STATE;
typedef enum { FT_RECV, FT_SEND} TLEN_FILE_MODE;
typedef struct TLEN_FILE_TRANSFER_STRUCT{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE s;
NETLIBNEWCONNECTIONPROC_V2 pfnNewConnectionV2;
TLEN_FILE_STATE state;
@@ -466,8 +466,8 @@ void TlenSerialInit(TlenProtocol *proto);
void TlenSerialUninit(TlenProtocol *proto);
unsigned int TlenSerialNext(TlenProtocol *proto);
int TlenSend(TlenProtocol *proto, const char *fmt, ...);
-HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid);
-char *TlenJIDFromHContact(TlenProtocol *proto, HANDLE hContact);
+HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid);
+char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact);
char *TlenLoginFromJID(const char *jid);
char *TlenResourceFromJID(const char *jid);
char *TlenNickFromJID(const char *jid);
@@ -481,7 +481,7 @@ void TlenUrlDecode(char *str);
char *TlenUrlEncode(const char *str);
char *TlenTextEncode(const char *str);
char *TlenTextDecode(const char *str);
-void TlenLogMessage(TlenProtocol *proto, HANDLE hContact, DWORD flags, const char *message);
+void TlenLogMessage(TlenProtocol *proto, HCONTACT hContact, DWORD flags, const char *message);
BOOL IsAuthorized(TlenProtocol *proto, const char *jid);
//char *TlenGetVersionText();
time_t TlenIsoToUnixTime(char *stamp);
@@ -490,9 +490,9 @@ void TlenSendPresence(TlenProtocol *proto,int status);
void TlenStringAppend(char **str, int *sizeAlloced, const char *fmt, ...);
//char *TlenGetClientJID(char *jid);
// tlen_misc.cpp
-void TlenDBAddEvent(TlenProtocol *proto, HANDLE hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob);
+void TlenDBAddEvent(TlenProtocol *proto, HCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob);
void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick);
-HANDLE TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary);
+HCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary);
// tlen_svc.cpp
int TlenRunSearch(TlenProtocol *proto);
// tlen_opt.cpp
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp
index aea83f9804..f413b277ec 100644
--- a/protocols/Tlen/src/tlen_avatar.cpp
+++ b/protocols/Tlen/src/tlen_avatar.cpp
@@ -64,7 +64,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts
mir_sntprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S_avatar%s"), proto->m_szModuleName, tszFileType);
}
-static void RemoveAvatar(TlenProtocol *proto, HANDLE hContact) {
+static void RemoveAvatar(TlenProtocol *proto, HCONTACT hContact) {
TCHAR tFileName[ MAX_PATH ];
if (hContact == NULL) {
proto->threadData->avatarHash[0] = '\0';
@@ -77,7 +77,7 @@ static void RemoveAvatar(TlenProtocol *proto, HANDLE hContact) {
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
-static void SetAvatar(TlenProtocol *proto, HANDLE hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format) {
+static void SetAvatar(TlenProtocol *proto, HCONTACT hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format) {
TCHAR filename[MAX_PATH];
char md5[33];
mir_md5_state_t ctx;
@@ -123,7 +123,7 @@ int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_IT
XmlNode *aNode;
char *oldHash = NULL;
char *md5 = NULL, *type = NULL;
- HANDLE hContact;
+ HCONTACT hContact;
hContact = NULL;
if (item != NULL) {
if ((hContact=TlenHContactFromJID(proto, item->jid)) == NULL) return 0;
@@ -165,7 +165,7 @@ int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_IT
}
void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITEM *item) {
- HANDLE hContact;
+ HCONTACT hContact;
if ((hContact=TlenHContactFromJID(proto, item->jid)) == NULL) return;
TlenProcessAvatarNode(proto, TlenXmlGetChild(node, "avatar"), item);
}
@@ -225,7 +225,7 @@ static int getAvatarMutex = 0;
typedef struct {
TlenProtocol *proto;
- HANDLE hContact;
+ HCONTACT hContact;
} TLENGETAVATARTHREADDATA;
static void TlenGetAvatarThread(void *ptr) {
@@ -234,7 +234,7 @@ static void TlenGetAvatarThread(void *ptr) {
NETLIBHTTPREQUEST req;
NETLIBHTTPREQUEST *resp;
TLENGETAVATARTHREADDATA *data = (TLENGETAVATARTHREADDATA *)ptr;
- HANDLE hContact = data->hContact;
+ HCONTACT hContact = data->hContact;
char *request;
char *login = NULL;
if (hContact != NULL) {
@@ -301,7 +301,7 @@ static void TlenGetAvatarThread(void *ptr) {
mir_free(data);
}
-void TlenGetAvatar(TlenProtocol *proto, HANDLE hContact) {
+void TlenGetAvatar(TlenProtocol *proto, HCONTACT hContact) {
if (hContact == NULL) {
if (getAvatarMutex != 0) {
return;
diff --git a/protocols/Tlen/src/tlen_avatar.h b/protocols/Tlen/src/tlen_avatar.h
index 1db81cd3a7..c0bbfaa086 100644
--- a/protocols/Tlen/src/tlen_avatar.h
+++ b/protocols/Tlen/src/tlen_avatar.h
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITEM *item);
int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_ITEM *item);
void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* psztDest, int cbLen);
-void TlenGetAvatar(TlenProtocol *proto, HANDLE hContact);
+void TlenGetAvatar(TlenProtocol *proto, HCONTACT hContact);
void TlenUploadAvatar(TlenProtocol *proto, unsigned char *data, int dataLen, int access);
void TlenRemoveAvatar(TlenProtocol *proto);
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index c74cfdde1a..74181bd9c3 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -65,7 +65,7 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) {
DBVARIANT dbv;
XmlNode *itemNode, *groupNode;
TLEN_LIST_ITEM *item;
- HANDLE hContact;
+ HCONTACT hContact;
char *jid, *name, *nick;
int i;
char *str;
@@ -76,7 +76,7 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
str = TlenXmlGetAttrValue(itemNode, "subscription");
if (!strcmp(str, "remove")) {
- if ((hContact=TlenHContactFromJID(proto, jid)) != NULL) {
+ if ((hContact = TlenHContactFromJID(proto, jid)) != NULL) {
if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
}
@@ -165,7 +165,7 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode)
nick = TlenLocalNickFromJID(jid);
if (nick != NULL) {
- HANDLE hContact;
+ HCONTACT hContact;
item = TlenListAdd(proto, LIST_ROSTER, jid);
if (item->nick) mir_free(item->nick);
item->nick = nick;
@@ -206,8 +206,8 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode)
// Delete orphaned contacts (if roster sync is enabled)
if (db_get_b(NULL, proto->m_szModuleName, "RosterSync", FALSE) == TRUE) {
- for (HANDLE hContact = db_find_first(proto->m_szModuleName); hContact; ) {
- HANDLE hNext = hContact = db_find_next(hContact, proto->m_szModuleName);
+ for (HCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; ) {
+ HCONTACT hNext = hContact = db_find_next(hContact, proto->m_szModuleName);
ptrA jid( db_get_sa(hContact, proto->m_szModuleName, "jid"));
if (jid != NULL) {
if (!TlenListExist(proto, LIST_ROSTER, jid)) {
@@ -241,7 +241,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode)
XmlNode *queryNode, *itemNode, *n;
char *type, *jid;
char text[128];
- HANDLE hContact;
+ HCONTACT hContact;
char *nText;
// TlenLog("<iq/> iqIdGetVcard (tlen)");
@@ -561,7 +561,7 @@ void TlenIqResultVersion(TlenProtocol *proto, XmlNode *iqNode)
if (( from=TlenXmlGetAttrValue( iqNode, "from" )) != NULL ) {
TLEN_LIST_ITEM *item;
if (( item=TlenListGetItemPtr( proto, LIST_ROSTER, from )) != NULL) {
- HANDLE hContact;
+ HCONTACT hContact;
XmlNode *n;
if ( item->software ) mir_free( item->software );
if ( item->version ) mir_free( item->version );
@@ -598,7 +598,7 @@ void TlenIqResultInfo(TlenProtocol *proto, XmlNode *iqNode)
if (( from=TlenXmlGetAttrValue( queryNode, "from" )) != NULL ) {
TLEN_LIST_ITEM *item;
if (( item=TlenListGetItemPtr( proto, LIST_ROSTER, from )) != NULL) {
- HANDLE hContact;
+ HCONTACT hContact;
XmlNode *version = TlenXmlGetChild(queryNode, "version");
item->protocolVersion = TlenTextDecode(version->text);
if (( hContact=TlenHContactFromJID(proto, item->jid )) != NULL ) {
diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp
index ad62fbf4c3..670d014fc6 100644
--- a/protocols/Tlen/src/tlen_misc.cpp
+++ b/protocols/Tlen/src/tlen_misc.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "tlen.h"
#include "tlen_list.h"
-void TlenDBAddEvent(TlenProtocol *proto, HANDLE hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob)
+void TlenDBAddEvent(TlenProtocol *proto, HCONTACT hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = proto->m_szModuleName;
@@ -42,10 +42,10 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick)
PBYTE pCurBlob;
PBYTE pBlob;
DWORD cbBlob;
- HANDLE hContact;
+ HCONTACT hContact;
if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName);
// strip resource if present
s = TlenLoginFromJID(jid);
@@ -72,7 +72,7 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick)
TlenDBAddEvent(proto, NULL, EVENTTYPE_AUTHREQUEST, 0, pBlob, cbBlob);
}
-char *TlenJIDFromHContact(TlenProtocol *proto, HANDLE hContact)
+char *TlenJIDFromHContact(TlenProtocol *proto, HCONTACT hContact)
{
char *p = NULL;
DBVARIANT dbv;
@@ -83,14 +83,14 @@ char *TlenJIDFromHContact(TlenProtocol *proto, HANDLE hContact)
return p;
}
-HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid)
+HCONTACT TlenHContactFromJID(TlenProtocol *proto, const char *jid)
{
DBVARIANT dbv;
char *p;
if (jid == NULL)
return NULL;
- for (HANDLE hContact = db_find_first(proto->m_szModuleName); hContact; hContact = db_find_next(hContact, proto->m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(proto->m_szModuleName); hContact; hContact = db_find_next(hContact, proto->m_szModuleName)) {
if ( db_get_s(hContact, proto->m_szModuleName, "jid", &dbv))
continue;
@@ -106,14 +106,14 @@ HANDLE TlenHContactFromJID(TlenProtocol *proto, const char *jid)
return NULL;
}
-HANDLE TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary)
+HCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temporary)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (jid == NULL || jid[0] == '\0')
return NULL;
if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
if (nick != NULL && nick[0] != '\0')
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp
index 843d4f4c98..05d609947c 100644
--- a/protocols/Tlen/src/tlen_muc.cpp
+++ b/protocols/Tlen/src/tlen_muc.cpp
@@ -69,7 +69,7 @@ static int stringToHex(const char *str)
static char *getDisplayName(TlenProtocol *proto, const char *id)
{
char jid[256];
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal);
@@ -101,7 +101,7 @@ BOOL TlenMUCInit(TlenProtocol *proto)
int TlenProtocol::MUCHandleEvent(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
int id;
MUCCEVENT *mucce=(MUCCEVENT *) lParam;
if (!strcmp(mucce->pszModule, m_szModuleName)) {
@@ -954,7 +954,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr)
queryResult.iItemsNum = 0;
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
if ( db_get_b(hContact, szProto, "bChat", FALSE))
continue;
@@ -970,7 +970,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr)
memset(queryResult.pItems, 0, sizeof(MUCCQUERYITEM) * queryResult.iItemsNum);
queryResult.iItemsNum = 0;
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
if ( db_get_b(hContact, szProto, "bChat", FALSE))
continue;
@@ -1025,13 +1025,13 @@ INT_PTR TlenProtocol::MUCMenuHandleChats(WPARAM wParam, LPARAM lParam)
INT_PTR TlenProtocol::MUCContactMenuHandleMUC(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
if (!isOnline)
return 1;
- if ((hContact=(HANDLE) wParam) != NULL && isOnline) {
+ if ((hContact=(HCONTACT)wParam) != NULL && isOnline) {
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
mir_snprintf(serialId, SIZEOF(serialId), TLEN_IQID"%d", TlenSerialNext(this));
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp
index 3f0156f3f8..7f3f769ef2 100644
--- a/protocols/Tlen/src/tlen_picture.cpp
+++ b/protocols/Tlen/src/tlen_picture.cpp
@@ -254,7 +254,7 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) {
mir_free(fromRaw);
}
-BOOL SendPicture(TlenProtocol *proto, HANDLE hContact) {
+BOOL SendPicture(TlenProtocol *proto, HCONTACT hContact) {
DBVARIANT dbv;
if (!db_get(hContact, proto->m_szModuleName, "jid", &dbv)) {
char *jid = dbv.pszVal;
diff --git a/protocols/Tlen/src/tlen_picture.h b/protocols/Tlen/src/tlen_picture.h
index 178134007d..a15922a5a4 100644
--- a/protocols/Tlen/src/tlen_picture.h
+++ b/protocols/Tlen/src/tlen_picture.h
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "tlen.h"
void TlenProcessPic(XmlNode *node, TlenProtocol *proto);
-BOOL SendPicture(TlenProtocol *, HANDLE hContact);
+BOOL SendPicture(TlenProtocol *, HCONTACT hContact);
#endif /* _TLEN_PICTURE_H */
diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp
index 617ec7e2ca..d37c9bcdc6 100644
--- a/protocols/Tlen/src/tlen_presence.cpp
+++ b/protocols/Tlen/src/tlen_presence.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void TlenProcessPresence(XmlNode *node, TlenProtocol *proto)
{
- HANDLE hContact;
+ HCONTACT hContact;
XmlNode *showNode, *statusNode;
TLEN_LIST_ITEM *item;
char *from, *type, *nick, *show;
@@ -178,7 +178,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto)
void setOwnStatusOnCList(TlenProtocol *proto, int status, char *statusMsg)
{
ptrA ownJid(db_get_sa(NULL, proto->m_szModuleName, "jid"));
- HANDLE hContact = TlenHContactFromJID(proto, ownJid);
+ HCONTACT hContact = TlenHContactFromJID(proto, ownJid);
if(hContact){
if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != status)
db_set_w(hContact, proto->m_szModuleName, "Status", (WORD)status);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 52ab263c8c..3eff4c7b86 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "tlen_avatar.h"
#include "tlen_file.h"
-DWORD_PTR TlenProtocol::GetCaps(int type, HANDLE hContact)
+DWORD_PTR TlenProtocol::GetCaps(int type, HCONTACT hContact)
{
if (type == PFLAGNUM_1)
return PF1_IM|PF1_AUTHREQ|PF1_SERVERCLIST|PF1_MODEMSG|PF1_BASICSEARCH|PF1_SEARCHBYEMAIL|PF1_EXTSEARCH|PF1_EXTSEARCHUI|PF1_SEARCHBYNAME|PF1_FILE;//|PF1_VISLIST|PF1_INVISLIST;
@@ -175,15 +175,15 @@ HWND TlenProtocol::SearchAdvanced(HWND owner)
}
-static HANDLE AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags)
+static HCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flags)
{
- HANDLE hContact;
+ HCONTACT hContact;
char *jid, *nick;
if ((hContact=TlenHContactFromJID(proto, newJid)) == NULL) {
// not already there: add
jid = mir_strdup(newJid); _strlwr(jid);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
if ((nick=TlenNickFromJID(newJid)) == NULL)
@@ -216,7 +216,7 @@ static HANDLE AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD flag
HANDLE TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)
{
- HANDLE hContact;
+ HCONTACT hContact;
TLEN_SEARCH_RESULT *jsr = (TLEN_SEARCH_RESULT*)psr;
if (jsr->hdr.cbSize != sizeof(TLEN_SEARCH_RESULT))
return (int) NULL;
@@ -257,7 +257,7 @@ HANDLE TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent
char *lastName = firstName + strlen(firstName) + 1;
char *jid = lastName + strlen(lastName) + 1;
- HANDLE hContact = (HANDLE) AddToListByJID(this, jid, flags);
+ HCONTACT hContact = (HCONTACT) AddToListByJID(this, jid, flags);
mir_free(dbei.pBlob);
return hContact;
}
@@ -294,7 +294,7 @@ int TlenProtocol::Authorize(HANDLE hDbEvent)
// Automatically add this user to my roster if option is enabled
if (db_get_b(NULL, m_szModuleName, "AutoAdd", TRUE) == TRUE) {
- HANDLE hContact;
+ HCONTACT hContact;
TLEN_LIST_ITEM *item;
if ((item=TlenListGetItemPtr(this, LIST_ROSTER, jid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
@@ -473,7 +473,7 @@ int TlenProtocol::SetAwayMsg(int iStatus, const PROTOCHAR* msg)
return 0;
}
-int TlenProtocol::GetInfo(HANDLE hContact, int infoType)
+int TlenProtocol::GetInfo(HCONTACT hContact, int infoType)
{
DBVARIANT dbv;
int iqId;
@@ -500,7 +500,7 @@ int TlenProtocol::GetInfo(HANDLE hContact, int infoType)
return 0;
}
-int TlenProtocol::SetApparentMode(HANDLE hContact, int mode)
+int TlenProtocol::SetApparentMode(HCONTACT hContact, int mode)
{
DBVARIANT dbv;
int oldMode;
@@ -539,12 +539,12 @@ int TlenProtocol::SetApparentMode(HANDLE hContact, int mode)
struct SENDACKTHREADDATA
{
- __inline SENDACKTHREADDATA(TlenProtocol *_ppro, HANDLE _hContact, int _msgid=0) :
+ __inline SENDACKTHREADDATA(TlenProtocol *_ppro, HCONTACT _hContact, int _msgid=0) :
proto(_ppro), hContact(_hContact), msgid(_msgid)
{}
TlenProtocol *proto;
- HANDLE hContact;
+ HCONTACT hContact;
int msgid;
};
@@ -599,7 +599,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr)
INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ( HANDLE )wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBVARIANT dbv;
if (isOnline && !db_get(hContact, m_szModuleName, "jid", &dbv)) {
TlenSend(this, "<m tp='a' to='%s'/>", dbv.pszVal);
@@ -609,7 +609,7 @@ INT_PTR TlenProtocol::SendAlert(WPARAM wParam, LPARAM lParam)
return 0;
}
-int TlenProtocol::SendMsg(HANDLE hContact, int flags, const char* msgRAW)
+int TlenProtocol::SendMsg(HCONTACT hContact, int flags, const char* msgRAW)
{
DBVARIANT dbv;
char *msgEnc;
@@ -717,19 +717,19 @@ INT_PTR TlenProtocol::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
return GAIR_NOAVATAR;
}
-HANDLE TlenProtocol::GetAwayMsg(HANDLE hContact)
+HANDLE TlenProtocol::GetAwayMsg(HCONTACT hContact)
{
SENDACKTHREADDATA *tdata = new SENDACKTHREADDATA(this, hContact, 0);
forkthread((void (__cdecl *)(void*))TlenGetAwayMsgThread, 0, (void*)tdata);
return (HANDLE)1;
}
-int TlenProtocol::RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt)
+int TlenProtocol::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt)
{
return 0;
}
-HANDLE TlenProtocol::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+HANDLE TlenProtocol::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
TLEN_FILE_TRANSFER *ft;
TLEN_LIST_ITEM *item;
@@ -752,7 +752,7 @@ HANDLE TlenProtocol::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHA
return (HANDLE)hTransfer;
}
-int TlenProtocol::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+int TlenProtocol::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
{
TLEN_FILE_TRANSFER *ft;
char *nick;
@@ -775,7 +775,7 @@ int TlenProtocol::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** sz
return 0;
}
-int TlenProtocol::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int TlenProtocol::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *) hTransfer;
debugLogA("Invoking FileCancel()");
@@ -794,7 +794,7 @@ int TlenProtocol::FileCancel(HANDLE hContact, HANDLE hTransfer)
return 0;
}
-HANDLE TlenProtocol::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+HANDLE TlenProtocol::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
TLEN_FILE_TRANSFER *ft;
int i, j;
@@ -862,25 +862,25 @@ HANDLE TlenProtocol::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, P
return (HANDLE) ft;
}
-int TlenProtocol::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList){
+int TlenProtocol::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList){
return 0;
}
-int TlenProtocol::SendUrl(HANDLE hContact, int flags, const char* urlt){
+int TlenProtocol::SendUrl(HCONTACT hContact, int flags, const char* urlt){
return 0;
}
-int TlenProtocol::RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt)
{
return Proto_RecvMessage(hContact, evt);
}
-int TlenProtocol::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
+int TlenProtocol::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
{
return Proto_RecvFile(hContact, evt);
}
-int TlenProtocol::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
+int TlenProtocol::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
{
return 0;
}
@@ -904,12 +904,12 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam)
if (!isConnected) return 0;
if (!strcmp(cws->szModule, "CList")) {
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
char *szProto, *nick, *jid, *group;
- hContact = (HANDLE) wParam;
+ hContact = (HCONTACT) wParam;
szProto = GetContactProto(hContact);
if (szProto == NULL || strcmp(szProto, m_szModuleName)) return 0;
// A contact's group is changed
@@ -956,7 +956,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam)
else if (!strcmp(cws->szSetting, "MyHandle")) {
char *newNick;
-// hContact = (HANDLE) wParam;
+// hContact = (HCONTACT) wParam;
// szProto = GetContactProto(hContact);
// if (szProto == NULL || strcmp(szProto, proto->m_szModuleName)) return 0;
@@ -1035,12 +1035,12 @@ int TlenProtocol::TlenContactDeleted(WPARAM wParam, LPARAM lParam)
if (!isOnline) // should never happen
return 0;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto == NULL || strcmp(szProto, m_szModuleName))
return 0;
DBVARIANT dbv;
- if (!db_get((HANDLE) wParam, m_szModuleName, "jid", &dbv)) {
+ if (!db_get((HCONTACT)wParam, m_szModuleName, "jid", &dbv)) {
char *jid, *p, *q;
jid = dbv.pszVal;
@@ -1058,7 +1058,7 @@ int TlenProtocol::TlenContactDeleted(WPARAM wParam, LPARAM lParam)
return 0;
}
-int TlenProtocol::UserIsTyping(HANDLE hContact, int type)
+int TlenProtocol::UserIsTyping(HCONTACT hContact, int type)
{
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
@@ -1200,13 +1200,13 @@ int TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lPara
}
// PSS_ADDED
-int TlenProtocol::AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt)
{
return 1;
}
// PSS_AUTHREQUEST
-int TlenProtocol::AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage)
+int TlenProtocol::AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage)
{
return 1;
}
@@ -1217,7 +1217,7 @@ HANDLE TlenProtocol::ChangeInfo(int iInfoType, void* pInfoData)
}
-int TlenProtocol::RecvContacts(HANDLE hContact, PROTORECVEVENT* evt)
+int TlenProtocol::RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt)
{
return 1;
}
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 00ec568e86..40ae861fcf 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -352,7 +352,7 @@ void __cdecl TlenServerThread(ThreadData *info)
ProtoBroadcastAck(szProto, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, info->proto->m_iStatus);
// Set all contacts to offline
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -595,7 +595,7 @@ static void TlenProcessAvatar(XmlNode* node, ThreadData *info)
static void TlenProcessMessage(XmlNode *node, ThreadData *info)
{
- HANDLE hContact;
+ HCONTACT hContact;
XmlNode *bodyNode, *subjectNode, *xNode, *n;
char *from, *type, *nick, *p, *localMessage, *idStr;
DWORD msgTime;
@@ -728,7 +728,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info)
static void TlenProcessIq(XmlNode *node, ThreadData *info)
{
- HANDLE hContact;
+ HCONTACT hContact;
XmlNode *queryNode = NULL;
char *type, *jid, *nick;
char *xmlns = NULL;
@@ -960,7 +960,7 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info)
*/
static void TlenProcessW(XmlNode *node, ThreadData *info)
{
- HANDLE hContact;
+ HCONTACT hContact;
char *f, *e, *s, *body;
char *str, *localMessage;
int strSize;
@@ -1007,7 +1007,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info)
*/
static void TlenProcessM(XmlNode *node, ThreadData *info)
{
- HANDLE hContact;
+ HCONTACT hContact;
char *f;//, *from;//username
char *tp;//typing start/stop
char *p, *n, *r, *s, *str, *localMessage;
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp
index 825bbfe3c4..22ed3651e7 100644
--- a/protocols/Tlen/src/tlen_userinfo.cpp
+++ b/protocols/Tlen/src/tlen_userinfo.cpp
@@ -132,7 +132,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam)
if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName))
return 0;
- HANDLE hContact = (HANDLE) lParam;
+ HCONTACT hContact = (HCONTACT) lParam;
char *szProto = GetContactProto(hContact);
if ((szProto != NULL && !strcmp(szProto, m_szModuleName)) || !lParam) {
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
@@ -155,7 +155,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam)
typedef struct {
TlenProtocol *proto;
- HANDLE hContact;
+ HCONTACT hContact;
}TLENUSERINFODLGDATA;
@@ -166,7 +166,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
case WM_INITDIALOG:
data = (TLENUSERINFODLGDATA*)mir_alloc(sizeof(TLENUSERINFODLGDATA));
- data->hContact = (HANDLE) lParam;
+ data->hContact = (HCONTACT) lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data);
// lParam is hContact
TranslateDialogDefault(hwndDlg);
@@ -286,7 +286,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- HANDLE hContact = (HANDLE) ((LPPSHNOTIFY) lParam)->lParam;
+ HCONTACT hContact = (HCONTACT) ((LPPSHNOTIFY) lParam)->lParam;
SendMessage(hwndDlg, WM_TLEN_REFRESH, 0, (LPARAM) hContact);
}
break;
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp
index 5ac920336e..8f8837454b 100644
--- a/protocols/Tlen/src/tlen_util.cpp
+++ b/protocols/Tlen/src/tlen_util.cpp
@@ -440,7 +440,7 @@ BOOL IsAuthorized(TlenProtocol *proto, const char *jid)
}
-void TlenLogMessage(TlenProtocol *proto, HANDLE hContact, DWORD flags, const char *message)
+void TlenLogMessage(TlenProtocol *proto, HCONTACT hContact, DWORD flags, const char *message)
{
int size = (int)strlen(message) + 2;
char *localMessage = (char *)mir_alloc(size);
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index 9739aa53a7..57cab89d2a 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -693,14 +693,14 @@ int TlenVoiceCancelAll(TlenProtocol *proto)
INT_PTR TlenProtocol::VoiceContactMenuHandleVoice(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
TLEN_FILE_TRANSFER *ft;
if (!isOnline)
return 1;
- if ((hContact=(HANDLE) wParam) != NULL) {
+ if ((hContact=(HCONTACT)wParam) != NULL) {
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
mir_snprintf(serialId, SIZEOF(serialId), "%d", TlenSerialNext(this));
@@ -942,7 +942,7 @@ int TlenVoiceStart(TLEN_FILE_TRANSFER *ft, int mode)
static char *getDisplayName(TlenProtocol *proto, const char *id)
{
char jid[256];
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal);