diff options
| author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 | 
| commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
| tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/MSN | |
| parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) | |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
| -rw-r--r-- | protocols/MSN/src/msn_avatar.cpp | 2 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_chat.cpp | 34 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 35 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_contact.cpp | 13 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_global.h | 148 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_links.cpp | 12 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_lists.cpp | 65 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_mail.cpp | 4 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_menu.cpp | 32 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 22 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_msgqueue.cpp | 4 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_opts.cpp | 2 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_p2ps.cpp | 8 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 56 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_proto.h | 110 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_soapab.cpp | 8 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_srv.cpp | 4 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_std.cpp | 6 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 13 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_switchboard.cpp | 2 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 4 | ||||
| -rw-r--r-- | protocols/MSN/src/msn_ws.cpp | 4 | 
22 files changed, 288 insertions, 300 deletions
| diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp index 45abcf490c..ae8ca277cb 100644 --- a/protocols/MSN/src/msn_avatar.cpp +++ b/protocols/MSN/src/msn_avatar.cpp @@ -34,7 +34,7 @@ void CMsnProto::AvatarQueue_Uninit()  	::CloseHandle(hevAvatarQueue);
  }
 -void CMsnProto::pushAvatarRequest(HANDLE hContact, LPCSTR pszUrl)
 +void CMsnProto::pushAvatarRequest(HCONTACT hContact, LPCSTR pszUrl)
  {
  	ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
 diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 55c9ae5cd3..76688d5235 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -25,13 +25,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  #include "msn_proto.h"
  #include <m_history.h>
 -HANDLE CMsnProto::MSN_GetChatInernalHandle(HANDLE hContact)
 +HCONTACT CMsnProto::MSN_GetChatInernalHandle(HCONTACT hContact)
  {
 -	HANDLE result = hContact;
 +	HCONTACT result = hContact;
  	if ( isChatRoom(hContact)) {
  		DBVARIANT dbv;
  		if (getString(hContact, "ChatRoomID", &dbv) == 0) {
 -			result = (HANDLE)(-atol(dbv.pszVal));
 +			result = (HCONTACT)(-atol(dbv.pszVal));
  			db_free(&dbv);
  		}
  	}
 @@ -98,7 +98,7 @@ void CMsnProto::MSN_ChatStart(ThreadData* info)  	for (int j=0; j < info->mJoinedContactsWLID.getCount(); j++)
  	{
 -		HANDLE hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]);
 +		HCONTACT hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]);
  		TCHAR *wlid = mir_a2t(info->mJoinedContactsWLID[j]);
  		gce.ptszNick = GetContactNameT(hContact);
 @@ -159,7 +159,7 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto  				}
  				else
  				{
 -					MsnContact *msc = ppro->Lists_Get(hItem);
 +					MsnContact *msc = ppro->Lists_Get((LPCSTR)hItem);
  					if (msc) str.insertn(msc->email);
  				}
  			}
 @@ -169,25 +169,25 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto  }
 -static void ChatValidateContact(HANDLE hItem, HWND hwndList, CMsnProto* ppro)
 +static void ChatValidateContact(HCONTACT hItem, HWND hwndList, CMsnProto* ppro)
  {
  	if (!ppro->MSN_IsMyContact(hItem) || ppro->isChatRoom(hItem) || ppro->MSN_IsMeByContact(hItem))
  		SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
  }
 -static void ChatPrepare(HANDLE hItem, HWND hwndList, CMsnProto* ppro)
 +static void ChatPrepare(HCONTACT hItem, HWND hwndList, CMsnProto* ppro)
  {
  	if (hItem == NULL)
 -		hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
 +		hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
  	while (hItem)
  	{
 -		HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
 +		HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
 -		if (IsHContactGroup(hItem))
 -		{
 -			HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 -			if (hItemT) ChatPrepare(hItemT, hwndList, ppro);
 +		if (IsHContactGroup(hItem)) {
 +			HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 +			if (hItemT)
 +				ChatPrepare(hItemT, hwndList, ppro);
  		}
  		else if (IsHContactContact(hItem))
  			ChatValidateContact(hItem, hwndList, ppro);
 @@ -198,7 +198,7 @@ static void ChatPrepare(HANDLE hItem, HWND hwndList, CMsnProto* ppro)  INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  {
 -	InviteChatParam* param = (InviteChatParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 +	InviteChatParam *param = (InviteChatParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
  	switch (msg)
  	{
 @@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l  			{
  			case CLN_NEWCONTACT:
  				if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
 -					ChatValidateContact(nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
 +					ChatValidateContact((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
  				break;
  			case CLN_LISTREBUILT:
 @@ -361,7 +361,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)  		case GC_USER_PRIVMESS:
  		{
  			char *email = mir_t2a(gch->ptszUID);
 -			HANDLE hContact = MSN_HContactFromEmail(email);
 +			HCONTACT hContact = MSN_HContactFromEmail(email);
  			CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
  			mir_free(email);
  			break;
 @@ -384,7 +384,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)  		case GC_USER_NICKLISTMENU:
  		{
  			char *email = mir_t2a(gch->ptszUID);
 -			HANDLE hContact = MSN_HContactFromEmail(email);
 +			HCONTACT hContact = MSN_HContactFromEmail(email);
  			mir_free(email);
  			switch(gch->dwData)
 diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 9701adc096..9cdce62c55 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -46,7 +46,7 @@ void MSN_ConnectionProc(HANDLE hNewConnection, DWORD /* dwRemoteIP */, void* ext  	}
  }
 -void CMsnProto::sttSetMirVer(HANDLE hContact, DWORD dwValue, bool always)
 +void CMsnProto::sttSetMirVer(HCONTACT hContact, DWORD dwValue, bool always)
  {
  	static const char* MirVerStr[] =
  	{
 @@ -117,8 +117,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c  	if (AppGUID != NULL) {
  		if (!strcmp(AppGUID, "{02D3C01F-BF30-4825-A83A-DE7AF41648AA}")) {
  			MSN_ShowPopup(info->getContactHandle(),
 -				TranslateT("Contact tried to open an audio conference (not currently supported)"),
 -				MSN_ALLOW_MSGBOX);
 +				TranslateT("Contact tried to open an audio conference (not currently supported)"), MSN_ALLOW_MSGBOX);
  			return;
  		}
  	}
 @@ -254,7 +253,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c  void CMsnProto::sttCustomSmiley(const char* msgBody, char* email, char* nick, int iSmileyType)
  {
 -	HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
 +	HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
  	char smileyList[500] = "";
 @@ -390,7 +389,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para  		tFileInfo.readFromBuffer(msgBody);
  		info->firstMsgRecv = true;
 -		HANDLE hContact = MSN_HContactFromEmail(email);
 +		HCONTACT hContact = MSN_HContactFromEmail(email);
  		const char* mirver = tFileInfo["Client-Name"];
  		if (hContact != NULL && mirver != NULL) {
  			setString(hContact, "MirVer", mirver);
 @@ -405,7 +404,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para  	}
  	if (!_strnicmp(tContentType, "text/plain", 10)) {
 -		HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
 +		HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
  		const char* p = tHeader["X-MMS-IM-Format"];
  		bool isRtl = p != NULL && strstr(p, "RL=1") != NULL;
 @@ -491,7 +490,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para  		const char* tTypingUser = tHeader["TypingUser"];
  		if (tTypingUser != NULL && info->mChatID[0] == 0 && _stricmp(email, MyOptions.szEmail)) {
 -			HANDLE hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
 +			HCONTACT hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
  			CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, 7);
  		}
  	}
 @@ -501,7 +500,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para  			if (info->mChatID[0]) {
  				GC_INFO gci = { 0 };
 -				gci.Flags = HCONTACT;
 +				gci.Flags = GCF_HCONTACT;
  				gci.pszModule = m_szModuleName;
  				gci.pszID = info->mChatID;
  				CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci);
 @@ -603,7 +602,7 @@ void CMsnProto::sttProcessYFind(char* buf, size_t len)  	else {
  		if (szNetId != NULL) {
  			int netId = atol(szNetId);
 -			HANDLE hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
 +			HCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
  			if (MSN_AddUser(hContact, szEmail, netId, LIST_FL)) {
  				MSN_AddUser(hContact, szEmail, netId, LIST_PL + LIST_REMOVE);
  				MSN_AddUser(hContact, szEmail, netId, LIST_BL + LIST_REMOVE);
 @@ -641,7 +640,7 @@ void CMsnProto::sttProcessAdd(char* buf, size_t len)  			UrlDecode((char*)szNick);
  			if (listId == LIST_FL) {
 -				HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick, true, false);
 +				HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick, true, false);
  				MSN_SetContactDb(hContact, szEmail);
  			}
 @@ -707,7 +706,7 @@ void CMsnProto::sttProcessRemove(char* buf, size_t len)  void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wlid)
  {
 -	HANDLE hContact = MSN_HContactFromEmail(wlid);
 +	HCONTACT hContact = MSN_HContactFromEmail(wlid);
  	if (hContact == NULL) return;
  	ezxml_t xmli = ezxml_parse_str(buf, len);
 @@ -1049,12 +1048,12 @@ LBL_InvalidCommand:  			if (strchr(data.userEmail, ';')) {
  				if (info->mJoinedContactsWLID.getCount() == 1)
 -					p2p_clearThreadSessions(info->mJoinedContactsWLID[0], info->mType);
 +					p2p_clearThreadSessions((HCONTACT)info->mJoinedContactsWLID[0], info->mType);
  				info->contactLeft(data.userEmail);
  				break;
  			}
 -			HANDLE hContact = MSN_HContactFromEmail(data.userEmail);
 +			HCONTACT hContact = MSN_HContactFromEmail(data.userEmail);
  			if (getByte("EnableSessionPopup", 0))
  				MSN_ShowPopup(hContact, TranslateT("Contact left channel"), 0);
 @@ -1099,7 +1098,7 @@ LBL_InvalidCommand:  						MSN_KillChatSession(info->mChatID);
  						// open up srmm dialog when quit while 1 person left
 -						HANDLE hContact = info->getContactHandle();
 +						HCONTACT hContact = info->getContactHandle();
  						if (hContact) CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
  					}
  				}
 @@ -1163,7 +1162,7 @@ LBL_InvalidCommand:  			if (tArgs < 2)
  				goto LBL_InvalidCommand;
 -			HANDLE hContact = MSN_HContactFromEmail(data.userEmail);
 +			HCONTACT hContact = MSN_HContactFromEmail(data.userEmail);
  			if (hContact != NULL) {
  				setWord(hContact, "Status", MSN_GetThreadByContact(data.userEmail) ? ID_STATUS_INVISIBLE : ID_STATUS_OFFLINE);
  				setDword(hContact, "IdleTS", 0);
 @@ -1204,7 +1203,7 @@ LBL_InvalidCommand:  			MsnContact *cont = Lists_Get(szEmail);
 -			HANDLE hContact = NULL;
 +			HCONTACT hContact = NULL;
  			if (!cont && !isMe) {
  				hContact = MSN_HContactFromEmail(data.wlid, data.userNick, true, true);
  				cont = Lists_Get(szEmail);
 @@ -1294,7 +1293,7 @@ remove:  			if (!strchr(data.userEmail, ';')) {
  				UrlDecode(data.userNick);
 -				HANDLE hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
 +				HCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
  				if (tNumTokens == 5 && strcmp(data.flags, "0:0")) {
  					MsnContact *cont = Lists_Get(data.userEmail);
 @@ -1386,7 +1385,7 @@ remove:  			stripBBCode(data.userNick);
  			stripColorCode(data.userNick);
 -			HANDLE hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
 +			HCONTACT hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true);
  			if (tNumTokens == 3) {
  				MsnContact *cont = Lists_Get(data.userEmail);
  				if (cont) {
 diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index 3412165ef1..1fdef99e6b 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -23,9 +23,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  #include "msn_global.h"
  #include "msn_proto.h"
 -HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
 +HCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
  {
 -	HANDLE hContact = NULL;
 +	HCONTACT hContact = NULL;
  	char* szEmail;
  	parseWLID(NEWSTR_ALLOCA(wlid), NULL, &szEmail, NULL);
 @@ -33,9 +33,8 @@ HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, b  	MsnContact *msc = Lists_Get(szEmail);
  	if (msc && msc->hContact) hContact = msc->hContact;
 -	if (hContact == NULL && addIfNeeded)
 -	{
 -		hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
 +	if (hContact == NULL && addIfNeeded) {
 +		hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
  		CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
  		setString(hContact, "e-mail", szEmail);
  		setStringUtf(hContact, "Nick", msnNick ? msnNick : wlid);
 @@ -49,7 +48,7 @@ HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, b  }
 -void CMsnProto::MSN_SetContactDb(HANDLE hContact, const char *szEmail)
 +void CMsnProto::MSN_SetContactDb(HCONTACT hContact, const char *szEmail)
  {
  	MsnContact *cont = Lists_Get(szEmail);
  	const int listId = cont->list;
 @@ -120,7 +119,7 @@ void CMsnProto::AddDelUserContList(const char* email, const int list, const int  /////////////////////////////////////////////////////////////////////////////////////////
  // MSN_AddUser - adds a e-mail address to one of the MSN server lists
 -bool CMsnProto::MSN_AddUser(HANDLE hContact, const char* email, int netId, int flags, const char *msg)
 +bool CMsnProto::MSN_AddUser(HCONTACT hContact, const char* email, int netId, int flags, const char *msg)
  {
  	bool needRemove     = (flags & LIST_REMOVE) != 0;
  	bool leaveHotmail   = (flags & LIST_REMOVENH) == LIST_REMOVENH;
 diff --git a/protocols/MSN/src/msn_global.h b/protocols/MSN/src/msn_global.h index 9c97843e95..fac52f59d7 100644 --- a/protocols/MSN/src/msn_global.h +++ b/protocols/MSN/src/msn_global.h @@ -167,7 +167,7 @@ template <class chartype> void UrlDecode(chartype* str);  void		__cdecl MSN_ConnectionProc(HANDLE hNewConnection, DWORD dwRemoteIP, void*);
  char*		MSN_GetAvatarHash(char* szContext, char** pszUrl = NULL);
 -bool		MSN_MsgWndExist(HANDLE hContact);
 +bool		MSN_MsgWndExist(HCONTACT hContact);
  #define		MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a))
 @@ -478,71 +478,71 @@ typedef void (__cdecl CMsnProto::*MsnThreadFunc)(void*);  struct ThreadData
  {
 -	ThreadData();
 -	~ThreadData();
 -
 -	STRLIST			mJoinedContactsWLID;
 -	STRLIST			mJoinedIdentContactsWLID;
 -	char*			mInitialContactWLID;
 -
 -	TInfoType		mType;            // thread type
 -	MsnThreadFunc	mFunc;            // thread entry point
 -	char			mServer[80];      // server name
 -
 -	HANDLE			s;					// NetLib connection for the thread
 -	HANDLE			mIncomingBoundPort; // Netlib listen for the thread
 -	HANDLE			hWaitEvent;
 -	WORD			mIncomingPort;
 -	TCHAR			mChatID[10];
 -	bool			mIsMainThread;
 -	clock_t			mWaitPeriod;
 -
 -	CMsnProto*		proto;
 -
 -	//----| for gateways |----------------------------------------------------------------
 -	char			mSessionID[50]; // Gateway session ID
 -	char			mGatewayIP[80]; // Gateway IP address
 -	int				mGatewayTimeout;
 -	bool			sessionClosed;
 -	bool			termPending;
 -	bool			gatewayType;
 -
 -	//----| for switchboard servers only |------------------------------------------------
 -	bool			firstMsgRecv;
 -	int				mCaller;
 -	char			mCookie[130];     // for switchboard servers only
 -	LONG			mTrid;            // current message ID
 -	UINT			mTimerId;         // typing notifications timer id
 -
 -	//----| for file transfers only |-----------------------------------------------------
 -	filetransfer*	mMsnFtp;          // file transfer block
 -	bool            mBridgeInit;
 -
 -	//----| internal data buffer |--------------------------------------------------------
 -	int				mBytesInData;     // bytes available in data buffer
 -	char			mData[8192];      // data buffer for connection
 -
 -	//----| methods |---------------------------------------------------------------------
 -	void           applyGatewayData(HANDLE hConn, bool isPoll);
 -	void           getGatewayUrl(char* dest, int destlen, bool isPoll);
 -	void           processSessionData(const char* xMsgr, const char* xHost);
 -	void           startThread(MsnThreadFunc , CMsnProto *prt);
 -
 -	int            send(const char data[], size_t datalen);
 -	int            recv(char* data, size_t datalen);
 -
 -	void           resetTimeout(bool term = false);
 -	bool           isTimeout(void);
 -
 -	void           sendTerminate(void);
 -	void           sendCaps(void);
 -	int            sendMessage(int msgType, const char* email, int netId, const char* msg, int parFlags);
 -	int            sendRawMessage(int msgType, const char* data, int datLen);
 -	int            sendPacket(const char* cmd, const char* fmt, ...);
 -
 -	int            contactJoined(const char* email);
 -	int            contactLeft(const char* email);
 -	HANDLE         getContactHandle(void);
 +   ThreadData();
 +   ~ThreadData();
 +
 +   STRLIST       mJoinedContactsWLID;
 +   STRLIST       mJoinedIdentContactsWLID;
 +   char*         mInitialContactWLID;
 +
 +   TInfoType     mType;            // thread type
 +   MsnThreadFunc mFunc;            // thread entry point
 +   char          mServer[80];      // server name
 +
 +   HANDLE        s;               // NetLib connection for the thread
 +   HANDLE        mIncomingBoundPort; // Netlib listen for the thread
 +   HANDLE        hWaitEvent;
 +   WORD          mIncomingPort;
 +   TCHAR         mChatID[10];
 +   bool          mIsMainThread;
 +   clock_t       mWaitPeriod;
 +
 +   CMsnProto*    proto;
 +
 +   //----| for gateways |----------------------------------------------------------------
 +   char          mSessionID[50]; // Gateway session ID
 +   char          mGatewayIP[80]; // Gateway IP address
 +   int           mGatewayTimeout;
 +   bool          sessionClosed;
 +   bool          termPending;
 +   bool          gatewayType;
 +
 +   //----| for switchboard servers only |------------------------------------------------
 +   bool          firstMsgRecv;
 +   int           mCaller;
 +   char          mCookie[130];     // for switchboard servers only
 +   LONG          mTrid;            // current message ID
 +   UINT          mTimerId;         // typing notifications timer id
 +
 +   //----| for file transfers only |-----------------------------------------------------
 +   filetransfer* mMsnFtp;          // file transfer block
 +   bool          mBridgeInit;
 +
 +   //----| internal data buffer |--------------------------------------------------------
 +   int           mBytesInData;     // bytes available in data buffer
 +   char          mData[8192];      // data buffer for connection
 +
 +   //----| methods |---------------------------------------------------------------------
 +   void          applyGatewayData(HANDLE hConn, bool isPoll);
 +   void          getGatewayUrl(char* dest, int destlen, bool isPoll);
 +   void          processSessionData(const char* xMsgr, const char* xHost);
 +   void          startThread(MsnThreadFunc , CMsnProto *prt);
 +
 +   int           send(const char data[], size_t datalen);
 +   int           recv(char* data, size_t datalen);
 +
 +   void          resetTimeout(bool term = false);
 +   bool          isTimeout(void);
 +
 +   void          sendTerminate(void);
 +   void          sendCaps(void);
 +   int           sendMessage(int msgType, const char* email, int netId, const char* msg, int parFlags);
 +   int           sendRawMessage(int msgType, const char* data, int datLen);
 +   int           sendPacket(const char* cmd, const char* fmt, ...);
 +
 +   int           contactJoined(const char* email);
 +   int           contactLeft(const char* email);
 +   HCONTACT      getContactHandle(void);
  };
 @@ -569,7 +569,7 @@ struct ThreadData -inline bool IsChatHandle(HANDLE hContact) { return (INT_PTR)hContact < 0; }
 +inline bool IsChatHandle(HCONTACT hContact) { return (INT_PTR)hContact < 0; }
  /////////////////////////////////////////////////////////////////////////////////////////
 @@ -596,10 +596,10 @@ struct MsgQueueEntry  struct AvatarQueueEntry
  {
 -	HANDLE  hContact;
 -	char*   pszUrl;
 +	HCONTACT hContact;
 +	char *pszUrl;
 -	__forceinline AvatarQueueEntry(HANDLE _contact, LPCSTR _url) :
 +	__forceinline AvatarQueueEntry(HCONTACT _contact, LPCSTR _url) :
  		hContact(_contact),
  		pszUrl( mir_strdup(_url))
  	{}
 @@ -639,7 +639,7 @@ struct MsnContact  	char *email;
  	char *invite;
  	char *nick;
 -	HANDLE hContact;
 +	HCONTACT hContact;
  	int list;
  	int netId;
  	int p2pMsgId;
 @@ -863,7 +863,7 @@ struct chunkedmsg  struct DeleteParam
  {
  	CMsnProto *proto;
 -	HANDLE hContact;
 +	HCONTACT hContact;
  };
  INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
 @@ -871,10 +871,10 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA  struct InviteChatParam
  {
  	TCHAR* id;
 -	HANDLE hContact;
 +	HCONTACT hContact;
  	CMsnProto* ppro;
 -	InviteChatParam(const TCHAR* id, HANDLE hContact, CMsnProto* ppro)
 +	InviteChatParam(const TCHAR* id, HCONTACT hContact, CMsnProto* ppro)
  		: id(mir_tstrdup(id)), hContact(hContact), ppro(ppro) {}
  	~InviteChatParam()
 diff --git a/protocols/MSN/src/msn_links.cpp b/protocols/MSN/src/msn_links.cpp index f6bc3e5f85..e41bf5becb 100644 --- a/protocols/MSN/src/msn_links.cpp +++ b/protocols/MSN/src/msn_links.cpp @@ -27,7 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  static HANDLE hServiceParseLink;
 -static HANDLE GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
 +static HCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
  {
  	TCHAR* email = NULL;
  	do
 @@ -51,7 +51,7 @@ static HANDLE GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)  		return NULL;
  	}
  	if (pemail) *pemail = email;
 -	HANDLE hContact = proto->MSN_HContactFromEmail(UTF8(email), NULL, true, true);
 +	HCONTACT hContact = proto->MSN_HContactFromEmail(UTF8(email), NULL, true, true);
  	return hContact;
  }
 @@ -96,7 +96,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)  		arg += 4;
  		TCHAR *email;
 -		HANDLE hContact = GetContact(arg, &email, proto);
 +		HCONTACT hContact = GetContact(arg, &email, proto);
  		if (email == NULL) return 1;
  		/* does not yet check if email is current user */
 @@ -121,7 +121,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)  	{
  		arg += 5;
 -		HANDLE hContact = GetContact(arg, NULL, proto);
 +		HCONTACT hContact = GetContact(arg, NULL, proto);
  		if (hContact != NULL)
  		{
 @@ -133,7 +133,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)  	{
  		arg += 6;
 -		HANDLE hContact = GetContact(arg, NULL, proto);
 +		HCONTACT hContact = GetContact(arg, NULL, proto);
  		if (hContact != NULL)
  		{
 @@ -145,7 +145,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)  	{
  		arg += 6;
 -		HANDLE hContact = GetContact(arg, NULL, proto);
 +		HCONTACT hContact = GetContact(arg, NULL, proto);
  		if (hContact != NULL)
  		{
 diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 1a5d372fce..bd3ab46208 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -65,7 +65,7 @@ MsnContact* CMsnProto::Lists_Get(const char* email)  	return p;
  }
 -MsnContact* CMsnProto::Lists_Get(HANDLE hContact)
 +MsnContact* CMsnProto::Lists_Get(HCONTACT hContact)
  {
  	EnterCriticalSection(&csLists);
 @@ -188,7 +188,7 @@ unsigned CMsnProto::p2p_getPktNum(const char* wlid)  	return res;
  }
 -int CMsnProto::Lists_Add(int list, int netId, const char* email, HANDLE hContact, const char* nick, const char* invite)
 +int CMsnProto::Lists_Add(int list, int netId, const char* email, HCONTACT hContact, const char* nick, const char* invite)
  {
  	EnterCriticalSection(&csLists);
 @@ -238,9 +238,9 @@ void CMsnProto::Lists_Remove(int list, const char* email)  void CMsnProto::Lists_Populate(void)
  {
 -	HANDLE hContact = db_find_first(m_szModuleName);
 +	HCONTACT hContact = db_find_first(m_szModuleName);
  	while (hContact) {
 -		HANDLE hNext = db_find_next(hContact, m_szModuleName);
 +		HCONTACT hNext = db_find_next(hContact, m_szModuleName);
  		char szEmail[MSN_MAX_EMAIL_LEN] = "";
  		if (db_get_static(hContact, m_szModuleName, "wlid", szEmail, sizeof(szEmail)))
  			db_get_static(hContact, m_szModuleName, "e-mail", szEmail, sizeof(szEmail));
 @@ -439,7 +439,7 @@ static void ResetListOptions(HWND hwndList)  		SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
  }
 -static void SetContactIcons(HANDLE hItem, HWND hwndList, CMsnProto* proto)
 +static void SetContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
  {
  	if (!proto->MSN_IsMyContact(hItem)) {
  		SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
 @@ -460,38 +460,34 @@ static void SetContactIcons(HANDLE hItem, HWND hwndList, CMsnProto* proto)  	SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(4,(dwMask & LIST_RL)?5:0));
  }
 -static void SetAllContactIcons(HANDLE hItem, HWND hwndList, CMsnProto* proto)
 +static void SetAllContactIcons(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
  {
  	if (hItem == NULL)
 -		hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
 +		hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
  	while (hItem)
  	{
 -		HANDLE hItemN = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
 +		HCONTACT hItemN = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
 -		if (IsHContactGroup(hItem))
 -		{
 -			HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 -			if (hItemT) SetAllContactIcons(hItemT, hwndList, proto);
 +		if (IsHContactGroup(hItem)) {
 +			HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 +			if (hItemT)
 +				SetAllContactIcons(hItemT, hwndList, proto);
  		}
  		else if (IsHContactContact(hItem))
 -		{
  			SetContactIcons(hItem, hwndList, proto);
 -		}
  		hItem = hItemN;
  	}
  }
 -static void SaveListItem(HANDLE hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto)
 +static void SaveListItem(HCONTACT hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto)
  {
  	if (iPrevValue == iNewValue)
  		return;
 -	if (iNewValue == 0)
 -	{
 -		if (list & LIST_FL)
 -		{
 +	if (iNewValue == 0) {
 +		if (list & LIST_FL) {
  			DeleteParam param = { proto, hContact };
  			DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DELETECONTACT), NULL, DlgDeleteContactUI, (LPARAM)¶m);
  			return;
 @@ -503,29 +499,26 @@ static void SaveListItem(HANDLE hContact, const char* szEmail, int list, int iPr  	proto->MSN_AddUser(hContact, szEmail, proto->Lists_GetNetId(szEmail), list);
  }
 -static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)
 +static void SaveSettings(HCONTACT hItem, HWND hwndList, CMsnProto* proto)
  {
  	if (hItem == NULL)
 -		hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
 +		hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
  	while (hItem)
  	{
 -		if (IsHContactGroup(hItem))
 -		{
 -			HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 -			if (hItemT) SaveSettings(hItemT, hwndList, proto);
 +		if (IsHContactGroup(hItem)) {
 +			HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
 +			if (hItemT)
 +				SaveSettings(hItemT, hwndList, proto);
  		}
 -		else
 -		{
 +		else {
  			char szEmail[MSN_MAX_EMAIL_LEN];
 -			if (IsHContactContact(hItem))
 -			{
 -				if (db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail))) continue;
 +			if (IsHContactContact(hItem)) {
 +				if (db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail)))
 +					continue;
  			}
 -			else if (IsHContactInfo(hItem))
 -			{
 -
 +			else if (IsHContactInfo(hItem)) {
  				TCHAR buf[MSN_MAX_EMAIL_LEN];
  				SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
  				WideCharToMultiByte(CP_ACP, 0, buf, -1, szEmail, sizeof(szEmail), 0, 0);
 @@ -543,7 +536,7 @@ static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)  			if (xorMask && newMask & (LIST_FL | LIST_LL))
  			{
 -				HANDLE hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem;
 +				HCONTACT hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem;
  				proto->MSN_SetContactDb(hContact, szEmail);
  			}
 @@ -557,7 +550,7 @@ static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)  				}
  			}
  		}
 -		hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
 +		hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
  	}
  }
 @@ -639,7 +632,7 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR  			{
  			case CLN_NEWCONTACT:
  				if ((nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
 -					SetContactIcons(nmc->hItem, nmc->hdr.hwndFrom, proto);
 +					SetContactIcons((HCONTACT)nmc->hItem, nmc->hdr.hwndFrom, proto);
  				break;
  			case CLN_LISTREBUILT:
 diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 180d3e77a3..d74d62ff33 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -293,7 +293,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)  	ShowPopup &= mUnreadMessages != 0 || (mUnreadJunkEmails != 0 && !getByte("DisableHotmailJunk", 0));
 -	HANDLE hContact = MSN_HContactFromEmail(MyOptions.szEmail);
 +	HCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
  	if (hContact)
  	{
  		CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1);
 @@ -398,7 +398,7 @@ static void TruncUtf8(char *str, size_t sz)  	str[cntl] = 0;
  }
 -void CMsnProto::displayEmailCount(HANDLE hContact)
 +void CMsnProto::displayEmailCount(HCONTACT hContact)
  {
  	if (!emailEnabled || getByte("DisableHotmailCL", 0)) return;
 diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 76e2e9f784..e9e6cf3b1a 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -32,9 +32,8 @@ HANDLE hNetMeeting, hBlockCom, hSendHotMail, hInviteChat, hViewProfile;  INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM)
  {
 -	if (msnLoggedIn)
 -	{
 -		const HANDLE hContact = (HANDLE)wParam;
 +	if (msnLoggedIn) {
 +		HCONTACT hContact = (HCONTACT)wParam;
  		char tEmail[MSN_MAX_EMAIL_LEN];
  		db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail));
 @@ -52,7 +51,7 @@ INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM)  INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)
  {
 -	HANDLE hContact = MSN_HContactFromEmail(MyOptions.szEmail);
 +	HCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
  	if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1);
  	MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox");
 @@ -61,7 +60,7 @@ INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)  INT_PTR CMsnProto::MsnSendHotmail(WPARAM wParam, LPARAM)
  {
 -	const HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	char szEmail[MSN_MAX_EMAIL_LEN];
  	if (MSN_IsMeByContact(hContact, szEmail))
 @@ -86,7 +85,7 @@ INT_PTR CMsnProto::MsnSetupAlerts(WPARAM, LPARAM)  INT_PTR CMsnProto::MsnViewProfile(WPARAM wParam, LPARAM)
  {
 -	const HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	char buf[64], *cid;
  	if (hContact == NULL)
 @@ -128,7 +127,7 @@ INT_PTR CMsnProto::MsnInviteCommand(WPARAM, LPARAM)  int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
  {
 -	const HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	char szEmail[MSN_MAX_EMAIL_LEN];
  	if ( !MSN_IsMyContact(hContact))
 @@ -158,10 +157,9 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)  int CMsnProto::OnContactDoubleClicked(WPARAM wParam, LPARAM)
  {
 -	const HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
 -	if (emailEnabled && MSN_IsMeByContact(hContact))
 -	{
 +	if (emailEnabled && MSN_IsMeByContact(hContact)) {
  		MsnSendHotmail(wParam, 0);
  		return 1;
  	}
 @@ -175,7 +173,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM)  {
  	if (!msnLoggedIn) return 0;
 -	HANDLE hContact = HANDLE(wParam);
 +	HCONTACT hContact = HCONTACT(wParam);
  	char szEmail[MSN_MAX_EMAIL_LEN];
  	if (MSN_IsMeByContact(hContact, szEmail)) return 0;
 @@ -361,7 +359,7 @@ void CMsnProto::MSN_EnableMenuItems(bool bEnable)  //////////////////////////////////////////////////////////////////////////////////////
 -static CMsnProto* GetProtoInstanceByHContact(HANDLE hContact)
 +static CMsnProto* GetProtoInstanceByHContact(HCONTACT hContact)
  {
  	char* szProto = GetContactProto(hContact);
  	if (szProto == NULL)
 @@ -376,31 +374,31 @@ static CMsnProto* GetProtoInstanceByHContact(HANDLE hContact)  static INT_PTR MsnMenuBlockCommand(WPARAM wParam, LPARAM lParam)
  {
 -	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
 +	CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
  	return (ppro) ? ppro->MsnBlockCommand(wParam, lParam) : 0;
  }
  static INT_PTR MsnMenuViewProfile(WPARAM wParam, LPARAM lParam)
  {
 -	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
 +	CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
  	return (ppro) ? ppro->MsnViewProfile(wParam, lParam) : 0;
  }
  static INT_PTR MsnMenuSendNetMeeting(WPARAM wParam, LPARAM lParam)
  {
 -	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
 +	CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
  	return (ppro) ? ppro->MsnSendNetMeeting(wParam, lParam) : 0;
  }
  static INT_PTR MsnMenuSendHotmail(WPARAM wParam, LPARAM lParam)
  {
 -	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
 +	CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
  	return (ppro) ? ppro->MsnSendHotmail(wParam, lParam) : 0;
  }
  static int MSN_OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
  {
 -	CMsnProto* ppro = GetProtoInstanceByHContact((HANDLE)wParam);
 +	CMsnProto* ppro = GetProtoInstanceByHContact((HCONTACT)wParam);
  	if (ppro)
  		ppro->OnPrebuildContactMenu(wParam, lParam);
  	else {
 diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index f774da7cde..4e2a8bfb0e 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -88,7 +88,7 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const ch  {
  	//blob is: UIN=0(DWORD), hContact(DWORD), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
 -	HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
 +	HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
  	int emaillen = (int)strlen(email);
 @@ -176,7 +176,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl)  /////////////////////////////////////////////////////////////////////////////////////////
  // MSN_GetAvatarFileName - gets a file name for an contact's avatar
 -void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
 +void CMsnProto::MSN_GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
  {
  	size_t tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
 @@ -321,7 +321,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)  /////////////////////////////////////////////////////////////////////////////////////////
  // MSN_GetCustomSmileyFileName - gets a file name for an contact's custom smiley
 -void CMsnProto::MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
 +void CMsnProto::MSN_GetCustomSmileyFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
  {
  	size_t tPathLen;
 @@ -834,7 +834,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara  	case WM_COMMAND:
  		if (tData != NULL) {
  			if (tData->flags & MSN_HOTMAIL_POPUP) {
 -				HANDLE hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
 +				HCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
  				if (hContact) CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1);
  				if (tData->flags & MSN_ALLOW_ENTER)
  					tData->proto->MsnInvokeMyURL(true, tData->url);
 @@ -847,7 +847,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara  	case WM_CONTEXTMENU:
  		if (tData != NULL && tData->flags & MSN_HOTMAIL_POPUP) {
 -			HANDLE hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
 +			HCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
  			if (hContact)
  				CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM) 1);
  		}
 @@ -946,7 +946,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)  	CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
  }
 -void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HANDLE hContact)
 +void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HCONTACT hContact)
  {
  	if (Miranda_Terminated()) return;
 @@ -961,7 +961,7 @@ void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags  }
 -void CMsnProto::MSN_ShowPopup(const HANDLE hContact, const TCHAR* msg, int flags)
 +void CMsnProto::MSN_ShowPopup(const HCONTACT hContact, const TCHAR* msg, int flags)
  {
  	const TCHAR* nickname = hContact ? GetContactNameT(hContact) : _T("Me");
  	MSN_ShowPopup(nickname, msg, flags, NULL, hContact);
 @@ -1194,13 +1194,13 @@ char* TWinErrorCode::getText()  	return mErrorText;
  }
 -bool CMsnProto::MSN_IsMyContact(HANDLE hContact)
 +bool CMsnProto::MSN_IsMyContact(HCONTACT hContact)
  {
  	const char* szProto = GetContactProto(hContact);
  	return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
  }
 -bool CMsnProto::MSN_IsMeByContact(HANDLE hContact, char* szEmail)
 +bool CMsnProto::MSN_IsMeByContact(HCONTACT hContact, char* szEmail)
  {
  	char tEmail[MSN_MAX_EMAIL_LEN];
  	char *emailPtr = szEmail ? szEmail : tEmail;
 @@ -1212,7 +1212,7 @@ bool CMsnProto::MSN_IsMeByContact(HANDLE hContact, char* szEmail)  	return _stricmp(emailPtr, MyOptions.szEmail) == 0;
  }
 -bool MSN_MsgWndExist(HANDLE hContact)
 +bool MSN_MsgWndExist(HCONTACT hContact)
  {
  	MessageWindowInputData msgWinInData =
  	{ sizeof(MessageWindowInputData), hContact, MSG_WINDOW_UFLAG_MSG_BOTH };
 @@ -1222,7 +1222,7 @@ bool MSN_MsgWndExist(HANDLE hContact)  	bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
  	res = res || msgWinData.hwndWindow;
  	if (res) {
 -		msgWinInData.hContact = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
 +		msgWinInData.hContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
  		if (msgWinInData.hContact != NULL) {
  			res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
  			res |= (msgWinData.hwndWindow == NULL);
 diff --git a/protocols/MSN/src/msn_msgqueue.cpp b/protocols/MSN/src/msn_msgqueue.cpp index 894e4dee30..0bbd87c01b 100644 --- a/protocols/MSN/src/msn_msgqueue.cpp +++ b/protocols/MSN/src/msn_msgqueue.cpp @@ -156,7 +156,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg)  			const MsgQueueEntry& E = lsMessageQueue[i];
  			if (E.msgSize == 0)
  			{
 -				HANDLE hContact = MSN_HContactFromEmail(E.wlid);
 +				HCONTACT hContact = MSN_HContactFromEmail(E.wlid);
  				ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
  					(HANDLE)E.seq, (LPARAM)Translate("Message delivery failed"));
  			}
 @@ -187,7 +187,7 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg)  				if (msgfnd)
  				{
  					LeaveCriticalSection(&csMsgQueue);
 -					HANDLE hContact = MSN_HContactFromEmail(wlid);
 +					HCONTACT hContact = MSN_HContactFromEmail(wlid);
  					ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq,
  						(LPARAM)Translate("Message delivery failed"));
  					i = 0;
 diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 26aa551c2d..b4c00ca167 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -490,7 +490,7 @@ static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM w  				proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG));
  				proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION));
 -				HANDLE hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
 +				HCONTACT hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
  				if (hContact)
  					proto->displayEmailCount(hContact);
  				return TRUE;
 diff --git a/protocols/MSN/src/msn_p2ps.cpp b/protocols/MSN/src/msn_p2ps.cpp index 8c631aca5a..697bb49c0b 100644 --- a/protocols/MSN/src/msn_p2ps.cpp +++ b/protocols/MSN/src/msn_p2ps.cpp @@ -110,7 +110,7 @@ bool CMsnProto::p2p_sessionRegistered(filetransfer* ft)  	return idx > -1;
  }
 -filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
 +filetransfer* CMsnProto::p2p_getThreadSession(HCONTACT hContact, TInfoType mType)
  {
  	EnterCriticalSection(&sessionLock);
 @@ -129,7 +129,7 @@ filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)  	return result;
  }
 -void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
 +void CMsnProto::p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType)
  {
  	EnterCriticalSection(&sessionLock);
 @@ -147,7 +147,7 @@ void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)  	LeaveCriticalSection(&sessionLock);
  }
 -filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
 +filetransfer* CMsnProto::p2p_getAvatarSession(HCONTACT hContact)
  {
  	EnterCriticalSection(&sessionLock);
 @@ -165,7 +165,7 @@ filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)  	return result;
  }
 -bool CMsnProto::p2p_isAvatarOnly(HANDLE hContact)
 +bool CMsnProto::p2p_isAvatarOnly(HCONTACT hContact)
  {
  	EnterCriticalSection(&sessionLock);
 diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index d6f7fbef5c..950d8575ef 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -80,7 +80,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :  	LoadOptions();
 -	for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
 +	for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
  		delSetting(hContact, "Status");
  		delSetting(hContact, "IdleTS");
  		delSetting(hContact, "p2pMsgId");
 @@ -216,9 +216,9 @@ int CMsnProto::OnPreShutdown(WPARAM, LPARAM)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnAddToList - adds contact to the server list
 -HANDLE CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
 +HCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
  {
 -	HANDLE hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);
 +	HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);
  	if (flags & PALF_TEMPORARY)
  	{
 @@ -277,7 +277,7 @@ HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv  	return AddToListByEmail(email, nick, flags);
  }
 -int CMsnProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
 +int CMsnProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
  {
  	Proto_AuthRecv(m_szModuleName, pre);
  	return 0;
 @@ -286,7 +286,7 @@ int CMsnProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)  ////////////////////////////////////////////////////////////////////////////////////////
  // PSS_AUTHREQUEST
 -int __cdecl CMsnProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
 +int __cdecl CMsnProto::AuthRequest(HCONTACT hContact, const TCHAR* szMessage)
  {
  	if (msnLoggedIn)
  	{
 @@ -349,7 +349,7 @@ int CMsnProto::Authorize(HANDLE hDbEvent)  	char* lastName = firstName + strlen(firstName) + 1;
  	char* email = lastName + strlen(lastName) + 1;
 -	HANDLE hContact = MSN_HContactFromEmail(email, nick, true, 0);
 +	HCONTACT hContact = MSN_HContactFromEmail(email, nick, true, 0);
  	int netId = Lists_GetNetId(email);
  	MSN_AddUser(hContact, email, netId, LIST_AL);
 @@ -398,7 +398,7 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)  	{
  		if (msc->hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0);
  		msc->hContact = NULL;
 -		HANDLE hContact = MSN_HContactFromEmail(email);
 +		HCONTACT hContact = MSN_HContactFromEmail(email);
  		if (hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
  	}
 @@ -518,7 +518,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg)  	ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft, 0);
  }
 -HANDLE __cdecl CMsnProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
 +HANDLE __cdecl CMsnProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
  {
  	filetransfer* ft = (filetransfer*)hTransfer;
 @@ -546,7 +546,7 @@ HANDLE __cdecl CMsnProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const PRO  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnFileCancel - cancels the active file transfer
 -int __cdecl CMsnProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
 +int __cdecl CMsnProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
  {
  	filetransfer* ft = (filetransfer*)hTransfer;
 @@ -579,7 +579,7 @@ int __cdecl CMsnProto::FileCancel(HANDLE hContact, HANDLE hTransfer)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnFileDeny - rejects the file transfer request
 -int __cdecl CMsnProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/)
 +int __cdecl CMsnProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/)
  {
  	filetransfer* ft = (filetransfer*)hTransfer;
 @@ -650,7 +650,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR  typedef struct AwayMsgInfo_tag
  {
  	INT_PTR id;
 -	HANDLE hContact;
 +	HCONTACT hContact;
  } AwayMsgInfo;
  void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg)
 @@ -668,7 +668,7 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg)  	mir_free(inf);
  }
 -HANDLE __cdecl CMsnProto::GetAwayMsg(HANDLE hContact)
 +HANDLE __cdecl CMsnProto::GetAwayMsg(HCONTACT hContact)
  {
  	AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo));
  	inf->hContact = hContact;
 @@ -681,7 +681,7 @@ HANDLE __cdecl CMsnProto::GetAwayMsg(HANDLE hContact)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnGetCaps - obtain the protocol capabilities
 -DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HANDLE hContact)
 +DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HCONTACT hContact)
  {
  	switch(type) {
  	case PFLAGNUM_1:
 @@ -718,7 +718,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, HANDLE hContact)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnGetInfo - nothing to do, cause we cannot obtain information from the server
 -int __cdecl CMsnProto::GetInfo(HANDLE hContact, int infoType)
 +int __cdecl CMsnProto::GetInfo(HCONTACT hContact, int infoType)
  {
  	return 1;
  }
 @@ -726,7 +726,7 @@ int __cdecl CMsnProto::GetInfo(HANDLE hContact, int infoType)  ////////////////////////////////////////////////////////////////////////////////////////
  // RecvContacts
 -int __cdecl CMsnProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
 +int __cdecl CMsnProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT*)
  {
  	return 1;
  }
 @@ -735,7 +735,7 @@ int __cdecl CMsnProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnRecvFile - creates a database event from the file request been received
 -int __cdecl CMsnProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
 +int __cdecl CMsnProto::RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
  {
  	return Proto_RecvFile(hContact, evt);
  }
 @@ -743,7 +743,7 @@ int __cdecl CMsnProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnRecvMessage - creates a database event from the message been received
 -int __cdecl CMsnProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
 +int __cdecl CMsnProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT* pre)
  {
  	char tEmail[MSN_MAX_EMAIL_LEN];
  	db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail));
 @@ -757,7 +757,7 @@ int __cdecl CMsnProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)  ////////////////////////////////////////////////////////////////////////////////////////
  // RecvUrl
 -int __cdecl CMsnProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)
 +int __cdecl CMsnProto::RecvUrl(HCONTACT hContact, PROTORECVEVENT*)
  {
  	return 1;
  }
 @@ -765,7 +765,7 @@ int __cdecl CMsnProto::RecvUrl(HANDLE hContact, PROTORECVEVENT*)  ////////////////////////////////////////////////////////////////////////////////////////
  // SendContacts
 -int __cdecl CMsnProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
 +int __cdecl CMsnProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
  {
  	return 1;
  }
 @@ -773,7 +773,7 @@ int __cdecl CMsnProto::SendContacts(HANDLE hContact, int flags, int nContacts, H  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnSendFile - initiates a file transfer
 -HANDLE __cdecl CMsnProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
 +HANDLE __cdecl CMsnProto::SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
  {
  	if (!msnLoggedIn)
  		return 0;
 @@ -826,14 +826,14 @@ HANDLE __cdecl CMsnProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescripti  struct TFakeAckParams
  {
 -	inline TFakeAckParams(HANDLE p2, long p3, const char* p4, CMsnProto *p5) :
 +	inline TFakeAckParams(HCONTACT p2, long p3, const char* p4, CMsnProto *p5) :
  		hContact(p2),
  		id(p3),
  		msg(p4),
  		proto(p5)
  		{}
 -	HANDLE	hContact;
 +	HCONTACT hContact;
  	long	id;
  	const char*	msg;
  	CMsnProto *proto;
 @@ -846,12 +846,12 @@ void CMsnProto::MsnFakeAck(void* arg)  	Sleep(150);
  	tParam->proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE,
  		tParam->msg ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
 -		(HANDLE)tParam->id, LPARAM(tParam->msg));
 +		(HCONTACT)tParam->id, LPARAM(tParam->msg));
  	delete tParam;
  }
 -int __cdecl CMsnProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
 +int __cdecl CMsnProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
  {
  	const char *errMsg = NULL;
 @@ -1002,7 +1002,7 @@ int __cdecl CMsnProto::SetAwayMsg(int status, const TCHAR* msg)  ////////////////////////////////////////////////////////////////////////////////////////
  // PSR_AWAYMSG
 -int __cdecl CMsnProto::RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
 +int __cdecl CMsnProto::RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt)
  {
  	return 1;
  }
 @@ -1065,7 +1065,7 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus)  /////////////////////////////////////////////////////////////////////////////////////////
  // MsnUserIsTyping - notify another contact that we're typing a message
 -int __cdecl CMsnProto::UserIsTyping(HANDLE hContact, int type)
 +int __cdecl CMsnProto::UserIsTyping(HCONTACT hContact, int type)
  {
  	if (!msnLoggedIn) return 0;
 @@ -1108,7 +1108,7 @@ int __cdecl CMsnProto::UserIsTyping(HANDLE hContact, int type)  ////////////////////////////////////////////////////////////////////////////////////////
  // SendUrl
 -int __cdecl CMsnProto::SendUrl(HANDLE hContact, int flags, const char* url)
 +int __cdecl CMsnProto::SendUrl(HCONTACT hContact, int flags, const char* url)
  {
  	return 1;
  }
 @@ -1116,7 +1116,7 @@ int __cdecl CMsnProto::SendUrl(HANDLE hContact, int flags, const char* url)  /////////////////////////////////////////////////////////////////////////////////////////
  //	MsnSetApparentMode - controls contact visibility
 -int __cdecl CMsnProto::SetApparentMode(HANDLE hContact, int mode)
 +int __cdecl CMsnProto::SetApparentMode(HCONTACT hContact, int mode)
  {
  	if (mode && mode != ID_STATUS_OFFLINE)
  	  return 1;
 diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 8d95a7e76d..1e351b900b 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -37,18 +37,18 @@ struct CMsnProto : public PROTO<CMsnProto>  	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
  	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
 -	virtual	int       __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
 -	virtual	int       __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage);
  	virtual	HANDLE    __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 -	virtual	HANDLE    __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
 -	virtual	int       __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
 -	virtual	int       __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason);
  	virtual	int       __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename);
 -	virtual	DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
 -	virtual	int       __cdecl GetInfo(HANDLE hContact, int infoType);
 +	virtual	DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
  	virtual	HANDLE    __cdecl SearchBasic(const PROTOCHAR* id);
  	virtual	HANDLE    __cdecl SearchByEmail(const PROTOCHAR* email);
 @@ -56,24 +56,24 @@ struct CMsnProto : public PROTO<CMsnProto>  	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
  	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int       __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
 -	virtual	int       __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*);
 -	virtual	int       __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
 -	virtual	int       __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int       __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
 -	virtual	HANDLE    __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
 -	virtual	int       __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
 -	virtual	int       __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 -	virtual	int       __cdecl SetApparentMode(HANDLE hContact, int mode);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
  	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE    __cdecl GetAwayMsg(HANDLE hContact);
 -	virtual	int       __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
  	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
 -	virtual	int       __cdecl UserIsTyping(HANDLE hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
  	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 @@ -195,7 +195,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	bool        getMyAvatarFile(char *url, TCHAR *fname);
  	void        MSN_GoOffline(void);
 -	void        MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type);
 +	void        MSN_GetCustomSmileyFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type);
  	const char*	MirandaStatusToMSN(int status);
  	WORD        MSNStatusToMiranda(const char *status);
 @@ -218,13 +218,13 @@ struct CMsnProto : public PROTO<CMsnProto>  	void        sttProcessYFind(char* buf, size_t len);
  	void        sttCustomSmiley(const char* msgBody, char* email, char* nick, int iSmileyType);
  	void        sttInviteMessage(ThreadData* info, char* msgBody, char* email, char* nick);
 -	void        sttSetMirVer(HANDLE hContact, DWORD dwValue, bool always);
 +	void        sttSetMirVer(HCONTACT hContact, DWORD dwValue, bool always);
  	void        LoadOptions(void);
  	void        InitPopups(void);
 -	void        MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HANDLE hContact = NULL);
 -	void        MSN_ShowPopup(const HANDLE hContact, const TCHAR* msg, int flags);
 +	void        MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HCONTACT hContact = NULL);
 +	void        MSN_ShowPopup(const HCONTACT hContact, const TCHAR* msg, int flags);
  	void        MSN_ShowError(const char* msgtext, ...);
  	void        MSN_SetNicknameUtf(const char* nickname);
 @@ -337,7 +337,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	void  p2p_cancelAllSessions(void);
  	void  p2p_redirectSessions(const char* wlid);
  	void  p2p_startSessions(const char* wlid);
 -	void  p2p_clearThreadSessions(HANDLE hContact, TInfoType mType);
 +	void  p2p_clearThreadSessions(HCONTACT hContact, TInfoType mType);
  	void  p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid);
  	void  p2p_inviteDc(filetransfer* ft, const char *wlid);
 @@ -380,14 +380,14 @@ struct CMsnProto : public PROTO<CMsnProto>  	void P2pSessions_Init(void);
  	void P2pSessions_Uninit(void);
 -	filetransfer*  p2p_getAvatarSession(HANDLE hContact);
 -	filetransfer*  p2p_getThreadSession(HANDLE hContact, TInfoType mType);
 +	filetransfer*  p2p_getAvatarSession(HCONTACT hContact);
 +	filetransfer*  p2p_getThreadSession(HCONTACT hContact, TInfoType mType);
  	filetransfer*  p2p_getSessionByID(unsigned id);
  	filetransfer*  p2p_getSessionByUniqueID(unsigned id);
  	filetransfer*  p2p_getSessionByCallID(const char* CallID, const char* wlid);
  	bool     p2p_sessionRegistered(filetransfer* ft);
 -	bool     p2p_isAvatarOnly(HANDLE hContact);
 +	bool     p2p_isAvatarOnly(HCONTACT hContact);
  	unsigned p2p_getMsgId(const char* wlid, int inc);
  	unsigned p2p_getPktNum(const char* wlid);
 @@ -413,7 +413,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	void MSN_ChatStart(ThreadData* info);
  	void MSN_KillChatSession(const TCHAR* id);
 -	HANDLE MSN_GetChatInernalHandle(HANDLE hContact);
 +	HCONTACT MSN_GetChatInernalHandle(HCONTACT hContact);
  	int __cdecl MSN_GCEventHook(WPARAM wParam, LPARAM lParam);
  	int __cdecl MSN_GCMenuHook(WPARAM wParam, LPARAM lParam);
 @@ -421,7 +421,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	/////////////////////////////////////////////////////////////////////////////////////////
  	//	MSN contact list
 -	int      Lists_Add(int list, int netId, const char* email, HANDLE hContact = NULL, const char* nick = NULL, const char* invite = NULL);
 +	int      Lists_Add(int list, int netId, const char* email, HCONTACT hContact = NULL, const char* nick = NULL, const char* invite = NULL);
  	bool     Lists_IsInList(int list, const char* email);
  	int      Lists_GetMask(const char* email);
  	int      Lists_GetNetId(const char* email);
 @@ -430,7 +430,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	void     Lists_Wipe(void);
  	MsnContact* Lists_Get(const char* email);
 -	MsnContact* Lists_Get(HANDLE hContact);
 +	MsnContact* Lists_Get(HCONTACT hContact);
  	MsnContact* Lists_GetNext(int& i);
  	MsnPlace* Lists_GetPlace(const char* wlid);
 @@ -446,30 +446,30 @@ struct CMsnProto : public PROTO<CMsnProto>  	void     MSN_FindYahooUser(const char* email);
  	bool     MSN_RefreshContactList(void);
 -	bool     MSN_IsMyContact(HANDLE hContact);
 -	bool     MSN_IsMeByContact(HANDLE hContact, char* szEmail  = NULL);
 -	bool     MSN_AddUser(HANDLE hContact, const char* email, int netId, int flags, const char *msg = NULL);
 +	bool     MSN_IsMyContact(HCONTACT hContact);
 +	bool     MSN_IsMeByContact(HCONTACT hContact, char* szEmail  = NULL);
 +	bool     MSN_AddUser(HCONTACT hContact, const char* email, int netId, int flags, const char *msg = NULL);
  	void     MSN_AddAuthRequest(const char *email, const char *nick, const char *reason);
 -	void     MSN_SetContactDb(HANDLE hContact, const char *szEmail);
 -	HANDLE   MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false);
 -	HANDLE   AddToListByEmail(const char *email, const char *nick, DWORD flags);
 +	void     MSN_SetContactDb(HCONTACT hContact, const char *szEmail);
 +	HCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false);
 +	HCONTACT AddToListByEmail(const char *email, const char *nick, DWORD flags);
  	/////////////////////////////////////////////////////////////////////////////////////////
  	//	MSN server groups
 -	void   MSN_AddGroup(const char* pName, const char* pId, bool init);
 -	void   MSN_DeleteGroup(const char* pId);
 -	void   MSN_FreeGroups(void);
 -	LPCSTR MSN_GetGroupById(const char* pId);
 -	LPCSTR MSN_GetGroupByName(const char* pName);
 -	void   MSN_SetGroupName(const char* pId, const char* pName);
 +	void     MSN_AddGroup(const char* pName, const char* pId, bool init);
 +	void     MSN_DeleteGroup(const char* pId);
 +	void     MSN_FreeGroups(void);
 +	LPCSTR   MSN_GetGroupById(const char* pId);
 +	LPCSTR   MSN_GetGroupByName(const char* pName);
 +	void     MSN_SetGroupName(const char* pId, const char* pName);
 -	void   MSN_MoveContactToGroup(HANDLE hContact, const char* grpName);
 -	void   MSN_RenameServerGroup(LPCSTR szId, const char* newName);
 -	void   MSN_DeleteServerGroup(LPCSTR szId);
 -	void   MSN_RemoveEmptyGroups(void);
 -	void   MSN_SyncContactToServerGroup(HANDLE hContact, const char* szContId, ezxml_t cgrp);
 -	void   MSN_UploadServerGroups(char* group);
 +	void     MSN_MoveContactToGroup(HCONTACT hContact, const char* grpName);
 +	void     MSN_RenameServerGroup(LPCSTR szId, const char* newName);
 +	void     MSN_DeleteServerGroup(LPCSTR szId);
 +	void     MSN_RemoveEmptyGroups(void);
 +	void     MSN_SyncContactToServerGroup(HCONTACT hContact, const char* szContId, ezxml_t cgrp);
 +	void     MSN_UploadServerGroups(char* group);
  	/////////////////////////////////////////////////////////////////////////////////////////
  	//	MSN Authentication
 @@ -485,12 +485,12 @@ struct CMsnProto : public PROTO<CMsnProto>  	void   AvatarQueue_Init(void);
  	void   AvatarQueue_Uninit(void);
 -	void   MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
 +	void   MSN_GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
  	int    MSN_SetMyAvatar(const TCHAR* szFname, void* pData, size_t cbLen);
  	void   __cdecl MSN_AvatarsThread(void*);
 -	void   pushAvatarRequest(HANDLE hContact, LPCSTR pszUrl);
 +	void   pushAvatarRequest(HCONTACT hContact, LPCSTR pszUrl);
  	bool   loadHttpAvatar(AvatarQueueEntry *p);
  	/////////////////////////////////////////////////////////////////////////////////////////
 @@ -504,7 +504,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	void processMailData(char* mailData);
  	void sttNotificationMessage(char* msgBody, bool isInitial);
 -	void displayEmailCount(HANDLE hContact);
 +	void displayEmailCount(HCONTACT hContact);
  	/////////////////////////////////////////////////////////////////////////////////////////
  	//	MSN SOAP Address Book
 @@ -526,7 +526,7 @@ struct CMsnProto : public PROTO<CMsnProto>  	ezxml_t abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr);
  	char* GetABHost(const char* service, bool isSharing);
 -	void SetAbParam(HANDLE hContact, const char *name, const char *par);
 +	void SetAbParam(HCONTACT hContact, const char *name, const char *par);
  	void UpdateABHost(const char* service, const char* url);
  	void UpdateABCacheKey(ezxml_t bdy,  bool isSharing);
 @@ -560,11 +560,11 @@ struct CMsnProto : public PROTO<CMsnProto>  	//////////////////////////////////////////////////////////////////////////////////////
 -	TCHAR* GetContactNameT(HANDLE hContact);
 +	TCHAR* GetContactNameT(HCONTACT hContact);
 -	int    getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result);
 +	int    getStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result);
  	int    getStringUtf(const char* name, DBVARIANT* result);
 -	void   setStringUtf(HANDLE hContact, const char* name, const char* value);
 +	void   setStringUtf(HCONTACT hContact, const char* name, const char* value);
  };
  extern OBJLIST<CMsnProto> g_Instances;
 diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index 10f22e1df1..5f528760f0 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -609,7 +609,7 @@ bool CMsnProto::MSN_SharingMyProfile(bool allowRecurse)  }
 -void CMsnProto::SetAbParam(HANDLE hContact, const char *name, const char *par)
 +void CMsnProto::SetAbParam(HCONTACT hContact, const char *name, const char *par)
  {
  	if (*par) setStringUtf(hContact, name, (char*)par);
  //	else delSetting(hContact, "FirstName");
 @@ -814,7 +814,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas  	//				Depricated in WLM 8.1
  	//				const char* szNick  = ezxml_txt(ezxml_child(contInf, "displayName"));
  	//				if (*szNick == '\0') szNick = szEmail;
 -					HANDLE hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
 +					HCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
  	//				setStringUtf(hContact, "Nick", (char*)szNick);
  					if (MyOptions.ManageServer)
 @@ -1555,7 +1555,7 @@ unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, in  			else
  			{
  				MSN_ABAddRemoveContact(szContId, NETID_MSN, true);
 -				HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
 +				HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
  				setString(hContact, "ID", szContId);
  			}
  			status = 0;
 @@ -1590,7 +1590,7 @@ unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, in  				}
  				else
  				{
 -					HANDLE hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
 +					HCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
  					setString(hContact, "ID", szContId);
  				}
  			}
 diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp index bf86fc1706..472e7fafd8 100644 --- a/protocols/MSN/src/msn_srv.cpp +++ b/protocols/MSN/src/msn_srv.cpp @@ -133,7 +133,7 @@ void CMsnProto::MSN_SetGroupName(const char* pId, const char* pNewName)  /////////////////////////////////////////////////////////////////////////////////////////
  // MSN_MoveContactToGroup - sends a contact to the specified group
 -void CMsnProto::MSN_MoveContactToGroup(HANDLE hContact, const char* grpName)
 +void CMsnProto::MSN_MoveContactToGroup(HCONTACT hContact, const char* grpName)
  {
  	if (!MyOptions.ManageServer) return;
 @@ -251,7 +251,7 @@ void CMsnProto::MSN_UploadServerGroups(char* group)  // if contact in multiple server groups it get removed from all of them other them it's
  // in or the last one
 -void CMsnProto::MSN_SyncContactToServerGroup(HANDLE hContact, const char* szContId, ezxml_t cgrp)
 +void CMsnProto::MSN_SyncContactToServerGroup(HCONTACT hContact, const char* szContId, ezxml_t cgrp)
  {
  	if (!MyOptions.ManageServer) return;
 diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp index 3816e2035e..78655c0035 100644 --- a/protocols/MSN/src/msn_std.cpp +++ b/protocols/MSN/src/msn_std.cpp @@ -26,7 +26,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  /////////////////////////////////////////////////////////////////////////////////////////
  // Standard functions
 -int CMsnProto::getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result)
 +int CMsnProto::getStringUtf(HCONTACT hContact, const char* name, DBVARIANT* result)
  {	return db_get_utf(hContact, m_szModuleName, name, result);
  }
 @@ -34,13 +34,13 @@ int CMsnProto::getStringUtf(const char* name, DBVARIANT* result)  {	return db_get_utf(NULL, m_szModuleName, name, result);
  }
 -void CMsnProto::setStringUtf(HANDLE hContact, const char* name, const char* value)
 +void CMsnProto::setStringUtf(HCONTACT hContact, const char* name, const char* value)
  {	db_set_utf(hContact, m_szModuleName, name, value);
  }
  /////////////////////////////////////////////////////////////////////////////////////////
 -TCHAR* CMsnProto::GetContactNameT(HANDLE hContact)
 +TCHAR* CMsnProto::GetContactNameT(HCONTACT hContact)
  {
  	if (hContact)
  		return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR);
 diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 5ed7d2f7b3..73a74e0670 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -246,7 +246,7 @@ INT_PTR CMsnProto::SendNudge(WPARAM wParam, LPARAM lParam)  {
  	if (!msnLoggedIn) return 0;
 -	HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	char tEmail[MSN_MAX_EMAIL_LEN];
  	if (MSN_IsMeByContact(hContact, tEmail)) return 0;
 @@ -257,8 +257,7 @@ INT_PTR CMsnProto::SendNudge(WPARAM wParam, LPARAM lParam)  	int netId = Lists_GetNetId(tEmail);
 -	switch (netId)
 -	{
 +	switch (netId) {
  	case NETID_UNKNOWN:
  		hContact = MSN_GetChatInernalHandle(hContact);
 @@ -381,7 +380,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM wParam, LPARAM lParam)  int CMsnProto::OnContactDeleted(WPARAM wParam, LPARAM lParam)
  {
 -	const HANDLE hContact = (HANDLE)wParam;
 +	const HCONTACT hContact = (HCONTACT)wParam;
  	if (!msnLoggedIn)  //should never happen for MSN contacts
  		return 0;
 @@ -425,7 +424,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam)  {
  	if (!msnLoggedIn || !MyOptions.ManageServer) return 0;
 -	const HANDLE hContact = (HANDLE)wParam;
 +	const HCONTACT hContact = (HCONTACT)wParam;
  	const CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam;
  	if (hContact == NULL)
 @@ -459,7 +458,7 @@ int CMsnProto::OnGroupChange(WPARAM wParam,LPARAM lParam)  int CMsnProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
  {
 -	HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
  	if (!msnLoggedIn)
 @@ -620,7 +619,7 @@ INT_PTR CMsnProto::GetUnreadEmailCount(WPARAM wParam, LPARAM lParam)  INT_PTR CMsnProto::OnLeaveChat(WPARAM wParam,LPARAM lParam)
  {
 -	HANDLE hContact = (HANDLE)wParam;
 +	HCONTACT hContact = (HCONTACT)wParam;
  	if (isChatRoom(hContact) != 0) {
  		DBVARIANT dbv;
  		if (getTString(hContact, "ChatRoomID", &dbv) == 0) {
 diff --git a/protocols/MSN/src/msn_switchboard.cpp b/protocols/MSN/src/msn_switchboard.cpp index 95f07482ec..582ea94452 100644 --- a/protocols/MSN/src/msn_switchboard.cpp +++ b/protocols/MSN/src/msn_switchboard.cpp @@ -47,7 +47,7 @@ int ThreadData::contactLeft(const char* email)  	return mJoinedContactsWLID.getCount();
  }
 -HANDLE ThreadData::getContactHandle(void)
 +HCONTACT ThreadData::getContactHandle(void)
  {
  	return mJoinedContactsWLID.getCount() ? proto->MSN_HContactFromEmail(mJoinedContactsWLID[0]) : NULL;
  }
 diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index a7f3027cbe..5abc87ed2a 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -552,7 +552,7 @@ ThreadData* CMsnProto::MSN_StartSB(const char* wlid, bool& isOffline)  	ThreadData* thread = MSN_GetThreadByContact(wlid);
  	if (thread == NULL)
  	{
 -		HANDLE hContact = MSN_HContactFromEmail(wlid);
 +		HCONTACT hContact = MSN_HContactFromEmail(wlid);
  		WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
  		if (wStatus != ID_STATUS_OFFLINE)
  		{
 @@ -664,7 +664,7 @@ ThreadData::~ThreadData()  		for (i=0; i<mJoinedContactsWLID.getCount(); ++i)
  		{
  			const char* wlid = mJoinedContactsWLID[i];
 -			HANDLE hContact = proto->MSN_HContactFromEmail(wlid);
 +			HCONTACT hContact = proto->MSN_HContactFromEmail(wlid);
  			int temp_status = proto->getWord(hContact, "Status", ID_STATUS_OFFLINE);
  			if (temp_status == ID_STATUS_INVISIBLE && proto->MSN_GetThreadByContact(wlid) == NULL)
  				proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
 diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp index 1cd3e04c2b..95f0ba5cea 100644 --- a/protocols/MSN/src/msn_ws.cpp +++ b/protocols/MSN/src/msn_ws.cpp @@ -67,7 +67,7 @@ bool ThreadData::isTimeout(void)  	}
  	else if (mJoinedContactsWLID.getCount() <= 1 || mChatID[0] == 0)
  	{
 -		HANDLE hContact = getContactHandle();
 +		HCONTACT hContact = getContactHandle();
  		if (mJoinedContactsWLID.getCount() == 0 || termPending)
  			res = true;
 @@ -96,7 +96,7 @@ bool ThreadData::isTimeout(void)  		if (proto->getByte("EnableSessionPopup", 0))
  		{
 -			HANDLE hContact = NULL;
 +			HCONTACT hContact = NULL;
  			if (mJoinedContactsWLID.getCount())
  				hContact = proto->MSN_HContactFromEmail(mJoinedContactsWLID[0]);
  			else if (mInitialContactWLID)
 | 
