summaryrefslogtreecommitdiff
path: root/protocols/MRA
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/MRA
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (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/MRA')
-rw-r--r--protocols/MRA/src/Mra.h20
-rw-r--r--protocols/MRA/src/MraAvatars.cpp16
-rw-r--r--protocols/MRA/src/MraChat.cpp24
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp6
-rw-r--r--protocols/MRA/src/MraPopUp.cpp4
-rw-r--r--protocols/MRA/src/MraProto.cpp44
-rw-r--r--protocols/MRA/src/MraProto.h158
-rw-r--r--protocols/MRA/src/MraSelectEMail.cpp6
-rw-r--r--protocols/MRA/src/MraSendCommand.cpp14
-rw-r--r--protocols/MRA/src/MraSendQueue.cpp8
-rw-r--r--protocols/MRA/src/MraSendQueue.h6
-rw-r--r--protocols/MRA/src/Mra_functions.cpp66
-rw-r--r--protocols/MRA/src/Mra_menus.cpp52
-rw-r--r--protocols/MRA/src/Mra_proto.cpp28
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp14
15 files changed, 233 insertions, 233 deletions
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h
index ae925a8471..59063cbba3 100644
--- a/protocols/MRA/src/Mra.h
+++ b/protocols/MRA/src/Mra.h
@@ -146,16 +146,16 @@ __forceinline BinBuffer& operator >>(BinBuffer& buf, CMStringW &sVar) { buf.get
/////////////////////////////////////////////////////////////////////////////
-bool DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
-bool DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
-bool DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret);
-bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret);
+bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret);
+bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret);
-bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value);
-bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value);
+bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value);
+bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value);
-bool DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
#include "MraConstans.h"
#include "MraProto.h"
@@ -227,16 +227,16 @@ CMStringW DecodeXML(const CMStringW &lptszMessage);
CMStringW EncodeXML(const CMStringW &lptszMessage);
bool IsHTTPSProxyUsed(HANDLE m_hNetlibUser);
-bool IsContactMraProto(HANDLE hContact);
+bool IsContactMraProto(HCONTACT hContact);
bool IsEMailMR(const CMStringA& szEmail);
bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail);
bool IsPhone(LPSTR lpszString, size_t dwStringSize);
-bool IsContactPhone(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize);
+bool IsContactPhone(HCONTACT hContact, LPSTR lpszPhone, size_t dwPhoneSize);
HANDLE MraHContactFromPhone(LPSTR lpszPhone, size_t dwPhoneSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled);
bool MraRequestXStatusDetails(DWORD dwXStatus);
-bool MraSendReplyBlogStatus(HANDLE hContact);
+bool MraSendReplyBlogStatus(HCONTACT hContact);
DWORD GetYears(CONST PSYSTEMTIME pcstSystemTime);
DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwFileNameLen, LPWSTR lpszRetFilePathName, DWORD dwRetFilePathLen, DWORD *pdwRetFilePathLen);
DWORD MemFillRandom(LPVOID lpBuff, size_t dwBuffSize);
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index 3439efd420..9ae3ee41dc 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -30,7 +30,7 @@ struct MRA_AVATARS_QUEUE_ITEM : public FIFO_MT_ITEM
{
DWORD dwAvatarsQueueID;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
};
#define FILETIME_SECOND ((DWORDLONG)10000000)
@@ -137,7 +137,7 @@ void CMraProto::MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle)
mir_free(pmraaqAvatarsQueue);
}
-DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID)
+DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID)
{
if (!hAvatarsQueueHandle)
return ERROR_INVALID_HANDLE;
@@ -453,7 +453,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE m_hConnection, DWORD dwRequestType, LPCST
return 0;
}
-bool CMraProto::MraAvatarsGetContactTime(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
+bool CMraProto::MraAvatarsGetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
if (lpszValueName && pstTime) {
INTERNET_TIME itAvatarLastModifiedTimeLocal;
@@ -468,7 +468,7 @@ bool CMraProto::MraAvatarsGetContactTime(HANDLE hContact, LPSTR lpszValueName, S
}
-void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
+void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
if (!lpszValueName)
return;
@@ -486,7 +486,7 @@ void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, S
delSetting(hContact, lpszValueName);
}
-DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, CMStringW &res)
+DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res)
{
res.Empty();
if (hAvatarsQueueHandle == NULL)
@@ -523,7 +523,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hConta
return ERROR_INSUFFICIENT_BUFFER;
}
-DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath)
+DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath)
{
DWORD dwRetCode = GAIR_NOAVATAR;
@@ -570,7 +570,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFl
return dwRetCode;
}
-DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID)
+DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwSourceID)
{
DWORD dwRetCode = GAIR_NOAVATAR;
@@ -662,7 +662,7 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara
}
-DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact)
+DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HCONTACT hContact)
{
if (hAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index c6363029ad..7cf8571652 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -27,7 +27,7 @@ bool CMraProto::MraChatRegister()
return TRUE;
}
-INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
+INT_PTR CMraProto::MraChatSessionNew(HCONTACT hContact)
{
if (bChatExists)
if (hContact) {
@@ -63,7 +63,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
return 1;
}
-void CMraProto::MraChatSessionDestroy(HANDLE hContact)
+void CMraProto::MraChatSessionDestroy(HCONTACT hContact)
{
if (!bChatExists || hContact == NULL)
return;
@@ -79,7 +79,7 @@ void CMraProto::MraChatSessionDestroy(HANDLE hContact)
CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
}
-INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
{
if (!bChatExists)
return 1;
@@ -122,7 +122,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, D
return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
-INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (!hContactChatSession)
return 1;
@@ -132,7 +132,7 @@ INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, const CMStri
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
-INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (!hContactChatSession)
return 1;
@@ -142,7 +142,7 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, const CM
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
-INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionJoinUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (hContactChatSession)
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], _T(""), 0, dwTime);
@@ -150,7 +150,7 @@ INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, const CMSt
return 1;
}
-INT_PTR CMraProto::MraChatSessionLeftUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionLeftUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (hContactChatSession)
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, NULL, 0, dwTime);
@@ -158,7 +158,7 @@ INT_PTR CMraProto::MraChatSessionLeftUser(HANDLE hContactChatSession, const CMSt
return 1;
}
-INT_PTR CMraProto::MraChatSessionSetIviter(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat)
+INT_PTR CMraProto::MraChatSessionSetIviter(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat)
{
if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty())
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0);
@@ -166,7 +166,7 @@ INT_PTR CMraProto::MraChatSessionSetIviter(HANDLE hContactChatSession, const CMS
return 1;
}
-INT_PTR CMraProto::MraChatSessionSetOwner(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat)
+INT_PTR CMraProto::MraChatSessionSetOwner(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat)
{
if (hContactChatSession && !lpszEMailInMultiChat.IsEmpty())
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0);
@@ -175,7 +175,7 @@ INT_PTR CMraProto::MraChatSessionSetOwner(HANDLE hContactChatSession, const CMSt
}
-INT_PTR CMraProto::MraChatSessionMessageAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMessageAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime)
{
if (hContactChatSession)
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, lpwszMessage, 0, dwTime);
@@ -195,7 +195,7 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
if (gch->ptszText && lstrlen(gch->ptszText)) {
size_t dwMessageSize = lstrlenW(gch->ptszText);
CMStringA szEmail = gch->pDest->ptszID;
- HANDLE hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
+ HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND);
DWORD dwFlags = 0;
@@ -236,7 +236,7 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
void CMraProto::MraChatSendPrivateMessage(LPSTR lpszEMail)
{
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded);
if (bAdded)
db_set_b(hContact, "CList", "Hidden", 1);
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index f4cb2918ee..3f4ec7213f 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -27,7 +27,7 @@ struct MRA_FILES_QUEUE_ITEM : public LIST_MT_ITEM
CMraProto *ppro;
DWORD dwIDRequest;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
DWORDLONG dwFilesCount;
DWORDLONG dwFilesTotalSize;
MRA_FILES_QUEUE_FILE *pmfqfFiles;
@@ -622,7 +622,7 @@ void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, vo
/////////////////////////////////////////////////////////////////////////////////////////
// Receive files
-DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses)
+DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses)
{
if (!hFilesQueueHandle || !dwIDRequest)
return ERROR_INVALID_HANDLE;
@@ -919,7 +919,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter)
/////////////////////////////////////////////////////////////////////////////////////////
// Send files
-DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest)
+DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest)
{
if (!hFilesQueueHandle)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp
index d0f219200d..29da89b58f 100644
--- a/protocols/MRA/src/MraPopUp.cpp
+++ b/protocols/MRA/src/MraPopUp.cpp
@@ -198,7 +198,7 @@ LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM l
return DefWindowProc(hWndDlg, msg, wParam, lParam);
}
-void CMraProto::MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage)
+void CMraProto::MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage)
{
WCHAR szTitle[MAX_CONTACTNAME];
CMStringW szNick, szEmail;
@@ -212,7 +212,7 @@ void CMraProto::MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dw
MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage);
}
-void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage)
+void CMraProto::MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage)
{
if (getByte("PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
if (GetBit(getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType))
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index 2c9deba976..a8686a95ee 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -93,7 +93,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMraProto::OnGroupChanged);
// всех в offline // тк unsaved values сохраняются их нужно инициализировать
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName))
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
// unsaved values
@@ -132,7 +132,7 @@ HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR
return NULL;
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded);
if (hContact == NULL)
return NULL;
@@ -186,9 +186,9 @@ HANDLE CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
HANDLE CMraProto::ChangeInfo(int, void*) { return NULL; }
int CMraProto::FileResume(HANDLE, int*, const TCHAR**) { return 1; }
-int CMraProto::RecvAwayMsg(HANDLE, int, PROTORECVEVENT*) { return 1; }
-int CMraProto::RecvUrl(HANDLE, PROTORECVEVENT*) { return 1; }
-int CMraProto::SendUrl(HANDLE, int, const char*) { return 1; }
+int CMraProto::RecvAwayMsg(HCONTACT, int, PROTORECVEVENT*) { return 1; }
+int CMraProto::RecvUrl(HCONTACT, PROTORECVEVENT*) { return 1; }
+int CMraProto::SendUrl(HCONTACT, int, const char*) { return 1; }
/////////////////////////////////////////////////////////////////////////////////////////
@@ -234,20 +234,20 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason)
return 0;
}
-int CMraProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+int CMraProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre)
{
Proto_AuthRecv(m_szModuleName, pre);
return 0;
}
-int CMraProto::AuthRequest(HANDLE hContact, const TCHAR *lptszMessage)
+int CMraProto::AuthRequest(HCONTACT hContact, const TCHAR *lptszMessage)
{
return 1;
}
/////////////////////////////////////////////////////////////////////////////////////////
-HANDLE CMraProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CMraProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
{
if (szPath != NULL)
if ( MraFilesQueueAccept(hFilesQueueHandle, (DWORD)hTransfer, szPath, lstrlen(szPath)) == NO_ERROR)
@@ -256,7 +256,7 @@ HANDLE CMraProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPa
return NULL;
}
-int CMraProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer)
{
if (hContact && hTransfer) {
MraFilesQueueCancel(hFilesQueueHandle, (DWORD)hTransfer, TRUE);
@@ -266,14 +266,14 @@ int CMraProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
return 1;
}
-int CMraProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR*)
+int CMraProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR*)
{
return FileCancel(hContact, hTransfer);
}
/////////////////////////////////////////////////////////////////////////////////////////
-DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact)
+DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact)
{
switch ( type ) {
case PFLAGNUM_1:
@@ -310,7 +310,7 @@ DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact)
}
}
-int CMraProto::GetInfo(HANDLE hContact, int infoType)
+int CMraProto::GetInfo(HCONTACT hContact, int infoType)
{
return MraUpdateContactInfo(hContact) != 0;
}
@@ -347,7 +347,7 @@ HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName,
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
+int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
@@ -360,19 +360,19 @@ int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
return 0;
}
-int CMraProto::RecvFile(HANDLE hContact, PROTORECVFILET *pre)
+int CMraProto::RecvFile(HCONTACT hContact, PROTORECVFILET *pre)
{
return Proto_RecvFile(hContact, pre);
}
-int CMraProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+int CMraProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{
return Proto_RecvMessage(hContact, pre);
}
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
INT_PTR iRet = 0;
@@ -398,7 +398,7 @@ int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* h
return iRet;
}
-HANDLE CMraProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
{
INT_PTR iRet = 0;
@@ -410,7 +410,7 @@ HANDLE CMraProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR**
return (HANDLE)iRet;
}
-int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage)
+int CMraProto::SendMsg(HCONTACT hContact, int flags, const char *lpszMessage)
{
if (!m_bLoggedIn) {
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.");
@@ -450,7 +450,7 @@ int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage)
/////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::SetApparentMode(HANDLE hContact, int mode)
+int CMraProto::SetApparentMode(HCONTACT hContact, int mode)
{
if (!m_bLoggedIn || !hContact)
return 1;
@@ -509,7 +509,7 @@ int CMraProto::SetStatus(int iNewStatus)
// всех в offline, только если мы бывали подключены
if (dwOldStatusMode > ID_STATUS_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))
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
Netlib_CloseHandle(m_hConnection);
@@ -547,7 +547,7 @@ int CMraProto::SetStatus(int iNewStatus)
return 0;
}
-HANDLE CMraProto::GetAwayMsg(HANDLE hContact)
+HANDLE CMraProto::GetAwayMsg(HCONTACT hContact)
{
if (!m_bLoggedIn || ! hContact)
return 0;
@@ -589,7 +589,7 @@ int CMraProto::SetAwayMsg(int m_iStatus, const TCHAR* msg)
return 0;
}
-int CMraProto::UserIsTyping(HANDLE hContact, int type)
+int CMraProto::UserIsTyping(HCONTACT hContact, int type)
{
if (!m_bLoggedIn || !hContact || type == PROTOTYPE_SELFTYPING_OFF)
return 1;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index c7082bd23f..d0a73ab7af 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -42,19 +42,19 @@ struct CMraProto : public PROTO<CMraProto>
virtual HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
virtual int __cdecl Authorize(HANDLE hDBEvent);
- virtual int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** 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 TCHAR* id);
virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
@@ -62,56 +62,56 @@ struct CMraProto : public PROTO<CMraProto>
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, PROTORECVFILET*);
- 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, PROTORECVFILET*);
+ 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 TCHAR* szDescription, TCHAR** 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 TCHAR *szDescription, TCHAR **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);
void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode);
- void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
- void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage);
+ void MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
+ void MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage);
__forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) {
MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); }
- __forceinline bool mraGetStaticStringA(HANDLE Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ __forceinline bool mraGetStaticStringA(HCONTACT Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
return DB_GetStaticStringA(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); }
- __forceinline bool mraGetStaticStringW(HANDLE Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ __forceinline bool mraGetStaticStringW(HCONTACT Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
return DB_GetStaticStringW(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); }
- __forceinline bool mraGetStringA(HANDLE Contact, const char *ValueName, CMStringA &Ret) {
+ __forceinline bool mraGetStringA(HCONTACT Contact, const char *ValueName, CMStringA &Ret) {
return DB_GetStringA(Contact, m_szModuleName, ValueName, Ret); }
- __forceinline bool mraGetStringW(HANDLE Contact, const char *ValueName, CMStringW &Ret) {
+ __forceinline bool mraGetStringW(HCONTACT Contact, const char *ValueName, CMStringW &Ret) {
return DB_GetStringW(Contact, m_szModuleName, ValueName, Ret); }
- __forceinline bool mraSetStringA(HANDLE Contact, const char *valueName, const CMStringA &parValue) {
+ __forceinline bool mraSetStringA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringW(HANDLE Contact, const char *valueName, const CMStringW &parValue) {
+ __forceinline bool mraSetStringW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) {
return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringExA(HANDLE Contact, const char *valueName, const CMStringA &parValue) {
+ __forceinline bool mraSetStringExA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) {
return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraSetStringExW(HANDLE Contact, const char *valueName, const CMStringW &parValue) {
+ __forceinline bool mraSetStringExW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) {
return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
- __forceinline bool mraWriteContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
+ __forceinline bool mraWriteContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize) != 0; }
- __forceinline bool mraGetContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) {
+ __forceinline bool mraGetContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) {
return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); }
// ====| Services |====================================================================
@@ -198,54 +198,54 @@ struct CMraProto : public PROTO<CMraProto>
HANDLE AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
- DWORD MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
+ DWORD MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
DWORD MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF);
DWORD MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID);
- DWORD MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0);
- DWORD MraModifyContact(HANDLE hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0);
+ DWORD MraAddContact(HCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0);
+ DWORD MraModifyContact(HCONTACT hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0);
DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL);
- DWORD MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszGroup);
+ DWORD MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszGroup);
DWORD MraAuthorize(const CMStringA &szEmail);
DWORD MraChangeStatus(DWORD dwStatus, const CMStringA &szStatusUri, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc, DWORD dwFutureFlags);
DWORD MraFileTransfer(const CMStringA &szEmail, DWORD dwIdRequest, DWORD dwFilesTotalSize, const CMStringW &lpwszFiles, const CMStringA &szAddresses);
DWORD MraFileTransferAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIdRequest, LPBYTE lpbDescription, size_t dwDescriptionSize);
- HANDLE MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
- HANDLE MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, CMStringA &szEmail);
+ HANDLE MraWPRequestW(HCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
+ HANDLE MraWPRequestByEMail(HCONTACT hContact, DWORD dwAckType, CMStringA &szEmail);
DWORD MraGame(const CMStringA &szEmail, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, const CMStringA &lpszData);
DWORD MraLogin2W(CMStringA &szLogin, CMStringA &szPassword, DWORD dwStatus, CMStringA &szStatusUri, CMStringW &wszStatusTitle, CMStringW &wszStatusDesc, DWORD dwFutureFlags, CMStringA &szUserAgentFormatted, CMStringA &szUserAgent);
- DWORD MraSMSW(HANDLE hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage);
+ DWORD MraSMSW(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage);
DWORD MraProxy(const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID);
DWORD MraProxyAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID);
DWORD MraChangeUserBlogStatus(DWORD dwFlags, const CMStringW &wszText, DWORDLONG dwBlogStatusID);
DWORD MraSendPacket(HANDLE m_hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize);
DWORD MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize);
- DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize);
+ DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize);
DWORD MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc);
- void MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList);
+ void MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList);
- DWORD GetContactFlags(HANDLE hContact);
- DWORD SetContactFlags(HANDLE hContact, DWORD dwContactFlag);
- DWORD GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones);
- DWORD SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones);
+ DWORD GetContactFlags(HCONTACT hContact);
+ DWORD SetContactFlags(HCONTACT hContact, DWORD dwContactFlag);
+ DWORD GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones);
+ DWORD SetContactBasicInfoW(HCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones);
- DWORD GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly);
- bool GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA &szRetBuff);
+ DWORD GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly);
+ bool GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff);
- bool IsContactMra(HANDLE hContact);
+ bool IsContactMra(HCONTACT hContact);
bool IsEMailMy(const CMStringA &szEmail);
bool IsEMailChatAgent(const CMStringA &szEmail);
- bool IsContactChatAgent(HANDLE hContact);
+ bool IsContactChatAgent(HCONTACT hContact);
- HANDLE MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
- bool MraUpdateContactInfo(HANDLE hContact);
+ HCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
+ bool MraUpdateContactInfo(HCONTACT hContact);
DWORD MraSetXStatusInternal(DWORD dwXStatus);
- DWORD MraGetContactStatus(HANDLE hContact);
- DWORD MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus);
- DWORD MraContactCapabilitiesGet(HANDLE hContact);
- void MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags);
+ DWORD MraGetContactStatus(HCONTACT hContact);
+ DWORD MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus);
+ DWORD MraContactCapabilitiesGet(HCONTACT hContact);
+ void MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags);
void MraUpdateEmailStatus(const CMStringA &szFrom, const CMStringA &szSubject, DWORD dwDate, DWORD dwUIDL);
DWORD MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMessageRTF);
@@ -278,19 +278,19 @@ struct CMraProto : public PROTO<CMraProto>
DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &plpsFrom, CMStringA &plpsText, CMStringA &plpsRFTText, CMStringA &plpsMultiChatData);
- void SetExtraIcons(HANDLE hContact);
+ void SetExtraIcons(HCONTACT hContact);
void InitMenus(void);
HGENMENU CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult);
- DWORD ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
- CMStringA CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason);
+ DWORD ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
+ CMStringA CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason);
bool GetPassDB(CMStringA& pass);
bool MraRequestXStatusDetails(DWORD dwXStatus);
- bool MraSendReplyBlogStatus(HANDLE hContact);
- DWORD MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType);
+ bool MraSendReplyBlogStatus(HCONTACT hContact);
+ DWORD MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType);
DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection);
@@ -300,8 +300,8 @@ struct CMraProto : public PROTO<CMraProto>
void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue);
size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort);
- DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses);
- DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest);
+ DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses);
+ DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest);
DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline);
DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, const CMStringA &szAddresses);
@@ -316,30 +316,30 @@ struct CMraProto : public PROTO<CMraProto>
bool bChatExists;
void MraChatDllError();
bool MraChatRegister();
- INT_PTR MraChatSessionNew(HANDLE hContactChatSession);
- void MraChatSessionDestroy(HANDLE hContactChatSession);
+ INT_PTR MraChatSessionNew(HCONTACT hContactChatSession);
+ void MraChatSessionDestroy(HCONTACT hContactChatSession);
void MraChatSendPrivateMessage(LPSTR lpwszEMail);
- INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime);
- INT_PTR MraChatSessionInvite(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
- INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat);
- INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat);
- INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &wszMessage, DWORD dwTime);
+ INT_PTR MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime);
+ INT_PTR MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
+ INT_PTR MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
+ INT_PTR MraChatSessionJoinUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
+ INT_PTR MraChatSessionLeftUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime);
+ INT_PTR MraChatSessionSetIviter(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat);
+ INT_PTR MraChatSessionSetOwner(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat);
+ INT_PTR MraChatSessionMessageAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &wszMessage, DWORD dwTime);
DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle);
void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle);
void MraAvatarsQueueSuspend(HANDLE hAvatarsQueueHandle);
void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle);
- DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID);
- bool MraAvatarsGetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
- void MraAvatarsSetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
- DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, CMStringW &res);
- DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath);
- DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID);
- DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact);
+ DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID);
+ bool MraAvatarsGetContactTime (HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
+ void MraAvatarsSetContactTime (HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
+ DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res);
+ DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath);
+ DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwSourceID);
+ DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HCONTACT hContact);
void __cdecl MraAvatarsThreadProc(LPVOID lpParameter);
};
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp
index 6081d902c0..fc889d5058 100644
--- a/protocols/MRA/src/MraSelectEMail.cpp
+++ b/protocols/MRA/src/MraSelectEMail.cpp
@@ -4,11 +4,11 @@
struct MraSelectEMailDlgData
{
CMraProto *ppro;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwType;
};
-void AddContactEMailToListParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
+void AddContactEMailToListParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
{
CMStringA szEmail;
if (DB_GetStringA(hContact, lpszModule, lpszValueName, szEmail)) {
@@ -139,7 +139,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam
return FALSE;
}
-DWORD CMraProto::MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType)
+DWORD CMraProto::MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType)
{
MraSelectEMailDlgData *dat = (MraSelectEMailDlgData*)mir_calloc(sizeof(MraSelectEMailDlgData));
if (dat) {
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp
index 74ab849a29..e673e2e4b8 100644
--- a/protocols/MRA/src/MraSendCommand.cpp
+++ b/protocols/MRA/src/MraSendCommand.cpp
@@ -71,7 +71,7 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
-DWORD CMraProto::MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
+DWORD CMraProto::MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
{
debugLogA("Sending message: flags %08x, to '%S', message '%S'\n", dwFlags, szEmail, lpwszMessage);
@@ -184,7 +184,7 @@ DWORD CMraProto::MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID)
}
// Adds new contact
-DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage)
+DWORD CMraProto::MraAddContact(HCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage)
{
if (szEmail.GetLength() <= 4 && !(dwContactFlag & CONTACT_FLAG_GROUP))
return 0;
@@ -213,7 +213,7 @@ DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGro
}
// change contact
-DWORD CMraProto::MraModifyContact(HANDLE hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones)
+DWORD CMraProto::MraModifyContact(HCONTACT hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones)
{
CMStringA szEmail, szPhones;
CMStringW wszNick, wszCustomName;
@@ -312,7 +312,7 @@ DWORD CMraProto::MraFileTransferAck(DWORD dwStatus, const CMStringA &szEmail, DW
}
// Поиск контакта
-HANDLE CMraProto::MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline)
+HANDLE CMraProto::MraWPRequestW(HCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline)
{
OutBuffer buf;
CMStringA tmp;
@@ -381,7 +381,7 @@ HANDLE CMraProto::MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwReques
}
// Поиск контакта по EMail
-HANDLE CMraProto::MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, CMStringA &szEmail)
+HANDLE CMraProto::MraWPRequestByEMail(HCONTACT hContact, DWORD dwAckType, CMStringA &szEmail)
{
if (szEmail.GetLength() <= 4)
return 0;
@@ -439,7 +439,7 @@ DWORD CMraProto::MraLogin2W(CMStringA &szLogin, CMStringA &szPassword, DWORD dwS
}
// Отправка SMS
-DWORD CMraProto::MraSMSW(HANDLE hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage)
+DWORD CMraProto::MraSMSW(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage)
{
CMStringA szPhoneLocal = "+" + CopyNumber(lpszPhone);
@@ -523,7 +523,7 @@ DWORD CMraProto::MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize)
}
-DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize)
+DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize)
{
DWORD dwRet = InterlockedIncrement((LONG volatile*)&dwCMDNum);
if ( !MraSendQueueAdd(hSendQueueHandle, dwRet, dwFlags, hContact, dwAckType, lpbDataQueue, dwDataQueueSize)) {
diff --git a/protocols/MRA/src/MraSendQueue.cpp b/protocols/MRA/src/MraSendQueue.cpp
index 496468c646..08146fe8b2 100644
--- a/protocols/MRA/src/MraSendQueue.cpp
+++ b/protocols/MRA/src/MraSendQueue.cpp
@@ -14,7 +14,7 @@ struct MRA_SEND_QUEUE_ITEM : public LIST_MT_ITEM
// external
DWORD dwCMDNum;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwAckType;
LPBYTE lpbData;
size_t dwDataSize;
@@ -59,7 +59,7 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle)
}
-DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize)
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize)
{
if (!hSendQueueHandle || !dwCMDNum)
return ERROR_INVALID_HANDLE;
@@ -108,7 +108,7 @@ DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum)
return ERROR_NOT_FOUND;
}
-DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
{
if (!hSendQueueHandle)
return ERROR_INVALID_HANDLE;
@@ -135,7 +135,7 @@ DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags,
return ERROR_NOT_FOUND;
}
-DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
{
if (!hSendQueueHandle)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraSendQueue.h b/protocols/MRA/src/MraSendQueue.h
index 1115c4f815..e75038cfd9 100644
--- a/protocols/MRA/src/MraSendQueue.h
+++ b/protocols/MRA/src/MraSendQueue.h
@@ -7,10 +7,10 @@
DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phSendQueueHandle);
void MraSendQueueDestroy(HANDLE hSendQueueHandle);
-DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize);
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize);
DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum);
-DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
-DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
#endif // !defined(AFX_MRA_SENDQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 2ba7335d8a..5864886814 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -13,7 +13,7 @@ struct SetXStatusData
struct SetBlogStatusData
{
CMraProto *ppro;
- HANDLE hContact;
+ HCONTACT hContact;
};
#define RECURSION_DATA_STACK_ITEMS_MIN 128
@@ -157,7 +157,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList)
return res;
}
-void CMraProto::MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList)
+void CMraProto::MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList)
{
if (!hContact || !pmalAddrList)
return;
@@ -181,7 +181,7 @@ void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList)
}
}
-bool DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
bool bRet = false;
size_t dwReadedStringLen, dwRetBuffSizeLocal;
@@ -209,7 +209,7 @@ bool DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
}
// sizes in wchars
-bool DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
bool bRet = false;
size_t dwReadedStringLen;
@@ -235,7 +235,7 @@ bool DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueNam
return bRet;
}
-bool DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res)
+bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res)
{
char *szRes = db_get_sa(hContact, lpszModule, lpszValueName);
if (szRes) {
@@ -249,7 +249,7 @@ bool DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMS
}
-bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res)
+bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res)
{
WCHAR *szRes = db_get_wsa(hContact, lpszModule, lpszValueName);
if (szRes) {
@@ -262,7 +262,7 @@ bool DB_GetStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMS
return false;
}
-bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue)
+bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue)
{
if (szValue.IsEmpty()) {
db_unset(hContact, lpszModule, lpszValueName);
@@ -272,7 +272,7 @@ bool DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, c
return db_set_s(hContact, lpszModule, lpszValueName, szValue) != 0;
}
-bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue)
+bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue)
{
if (szValue.IsEmpty()) {
db_unset(hContact, lpszModule, lpszValueName);
@@ -282,7 +282,7 @@ bool DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, c
return db_set_ws(hContact, lpszModule, lpszValueName, szValue) != 0;
}
-bool DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
bool bRet = false;
DBVARIANT dbv;
@@ -303,7 +303,7 @@ bool DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszVal
return bRet;
}
-DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszName)
+DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName)
{
MraGroupItem *p = NULL;
@@ -335,7 +335,7 @@ DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR
return p->m_id;
}
-DWORD CMraProto::GetContactFlags(HANDLE hContact)
+DWORD CMraProto::GetContactFlags(HCONTACT hContact)
{
DWORD dwRet = 0;
@@ -366,7 +366,7 @@ DWORD CMraProto::GetContactFlags(HANDLE hContact)
return(dwRet);
}
-DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
+DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag)
{
if (!IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
@@ -398,7 +398,7 @@ DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
return 0;
}
-DWORD CMraProto::GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones)
+DWORD CMraProto::GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones)
{
if (!IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
@@ -434,7 +434,7 @@ DWORD CMraProto::GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwG
return 0;
}
-DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones)
+DWORD CMraProto::SetContactBasicInfoW(HCONTACT hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, const CMStringA *szEmail, const CMStringW *wszNick, const CMStringA *szPhones)
{
if (!IsContactMra(hContact))
return ERROR_INVALID_HANDLE;
@@ -496,12 +496,12 @@ DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWO
return 0;
}
-HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded)
+HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded)
{
if (szEmail.IsEmpty())
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
bool bFound = false;
//check not already on list
@@ -541,7 +541,7 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed
}
}
else {
- 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)m_szModuleName);
}
@@ -563,7 +563,7 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed
return hContact;
}
-bool CMraProto::MraUpdateContactInfo(HANDLE hContact)
+bool CMraProto::MraUpdateContactInfo(HCONTACT hContact)
{
if (m_bLoggedIn && hContact)
if (IsContactMra(hContact)) {
@@ -577,22 +577,22 @@ bool CMraProto::MraUpdateContactInfo(HANDLE hContact)
return false;
}
-DWORD CMraProto::MraContactCapabilitiesGet(HANDLE hContact)
+DWORD CMraProto::MraContactCapabilitiesGet(HCONTACT hContact)
{
return getDword(hContact, DBSETTING_CAPABILITIES, 0);
}
-void CMraProto::MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags)
+void CMraProto::MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags)
{
setDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags);
}
-DWORD CMraProto::MraGetContactStatus(HANDLE hContact)
+DWORD CMraProto::MraGetContactStatus(HCONTACT hContact)
{
return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
-DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus)
+DWORD CMraProto::MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus)
{
DWORD dwOldStatus = MraGetContactStatus(hContact);
@@ -641,7 +641,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
if (m_dwEmailMessagesUnread) {
CMStringA szEmail;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
TCHAR szMailBoxStatus[MAX_SECONDLINE];
mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
@@ -709,13 +709,13 @@ bool IsHTTPSProxyUsed(HANDLE m_hNetlibUser)
}
// определяет принадлежность контакта данной копии плагина
-bool CMraProto::IsContactMra(HANDLE hContact)
+bool CMraProto::IsContactMra(HCONTACT hContact)
{
return CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0;
}
// определяется является ли контакт контактом MRA протокола, не зависимо от того какому плагину он принадлежит
-bool IsContactMraProto(HANDLE hContact)
+bool IsContactMraProto(HCONTACT hContact)
{
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
@@ -751,7 +751,7 @@ bool CMraProto::IsEMailChatAgent(const CMStringA &szEmail)
return false;
}
-bool CMraProto::IsContactChatAgent(HANDLE hContact)
+bool CMraProto::IsContactChatAgent(HCONTACT hContact)
{
if (hContact == NULL)
return false;
@@ -791,7 +791,7 @@ bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail)
return false;
}
-DWORD GetContactEMailCountParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName)
+DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName)
{
DWORD dwRet = 0;
CMStringA szEmail;
@@ -815,7 +815,7 @@ DWORD GetContactEMailCountParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule
return dwRet;
}
-DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly)
+DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly)
{
LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName;
@@ -828,7 +828,7 @@ DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly)
return dwRet;
}
-bool GetContactFirstEMailParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res)
+bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res)
{
CMStringA szEmail;
@@ -853,7 +853,7 @@ bool GetContactFirstEMailParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule,
return false;
}
-bool CMraProto::GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA &res)
+bool CMraProto::GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &res)
{
LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName;
@@ -891,7 +891,7 @@ static void FakeThread(void* param)
mir_free(param);
}
-DWORD CMraProto::ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam)
+DWORD CMraProto::ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)::mir_calloc(sizeof(ACKDATA));
ack->cbSize = sizeof(ACKDATA);
@@ -905,7 +905,7 @@ DWORD CMraProto::ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult,
return 0;
}
-CMStringA CMraProto::CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason)
+CMStringA CMraProto::CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason)
{
CMStringA res('\0', 8), tmp;
DWORD *p = (DWORD*)res.c_str();
@@ -1206,7 +1206,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w
return iRet;
}
-bool CMraProto::MraSendReplyBlogStatus(HANDLE hContact)
+bool CMraProto::MraSendReplyBlogStatus(HCONTACT hContact)
{
SetBlogStatusData* dat = (SetBlogStatusData*)mir_calloc(sizeof(SetBlogStatusData));
dat->ppro = this;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp
index 2e92363a74..ba91e2e660 100644
--- a/protocols/MRA/src/Mra_menus.cpp
+++ b/protocols/MRA/src/Mra_menus.cpp
@@ -43,7 +43,7 @@ INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
{
if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- 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)) {
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
MraWPRequestByEMail(hContact, ACKTYPE_GETINFO, szEmail);
@@ -55,7 +55,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
{
if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- 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)) {
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
if (!IsEMailChatAgent(szEmail))
@@ -68,7 +68,7 @@ INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam)
{
if (MessageBox(NULL, TranslateT("Are you sure?"), TranslateT(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- 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)) {
DWORD dwContactSeverFlags;
if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL) == NO_ERROR)
if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1)
@@ -80,7 +80,7 @@ INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
@@ -110,7 +110,7 @@ INT_PTR CMraProto::MraGrantAuthorization(WPARAM wParam, LPARAM lParam)
// send without reason, do we need any ?
CMStringA szEmail;
- if (mraGetStringA((HANDLE)wParam, "e-mail", szEmail))
+ if (mraGetStringA((HCONTACT)wParam, "e-mail", szEmail))
MraAuthorize(szEmail);
return 0;
@@ -121,17 +121,17 @@ INT_PTR CMraProto::MraSendPostcard(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailCount = GetContactEMailCount((HANDLE)wParam, FALSE);
+ DWORD dwContactEMailCount = GetContactEMailCount((HCONTACT)wParam, FALSE);
if (dwContactEMailCount) {
if (dwContactEMailCount == 1) {
CMStringA szUrl, szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, FALSE, szEmail)) {
+ if (GetContactFirstEMail((HCONTACT)wParam, FALSE, szEmail)) {
szEmail.MakeLower();
szUrl.Format("http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s", GetContactNameA((HANDLE)wParam), szEmail);
MraMPopSessionQueueAddUrl(hMPopSessionQueue, szUrl);
}
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
}
return 0;
}
@@ -141,14 +141,14 @@ INT_PTR CMraProto::MraViewAlbum(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_FOTO_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
}
return 0;
}
@@ -158,14 +158,14 @@ INT_PTR CMraProto::MraReadBlog(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount)
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG);
return 0;
}
@@ -176,9 +176,9 @@ INT_PTR CMraProto::MraReplyBlogStatus(WPARAM wParam, LPARAM lParam)
return 0;
CMStringW blogStatusMsg;
- mraGetStringW((HANDLE)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg);
+ mraGetStringW((HCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg);
if (!blogStatusMsg.IsEmpty() || wParam == 0)
- MraSendReplyBlogStatus((HANDLE)wParam);
+ MraSendReplyBlogStatus((HCONTACT)wParam);
return 0;
}
@@ -188,14 +188,14 @@ INT_PTR CMraProto::MraViewVideo(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_VIDEO_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
}
return 0;
}
@@ -205,14 +205,14 @@ INT_PTR CMraProto::MraAnswers(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_ANSWERS_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS);
}
return 0;
}
@@ -222,14 +222,14 @@ INT_PTR CMraProto::MraWorld(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn)
return 0;
- DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE);
if (dwContactEMailMRCount) {
if (dwContactEMailMRCount == 1) {
CMStringA szEmail;
- if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEmail))
+ if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail))
MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_WORLD_URL, szEmail);
}
- else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_WORLD);
+ else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_WORLD);
}
return 0;
}
@@ -241,7 +241,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM wParam, LPARAM lParam)
BOOL bIsContactMRA, bHasEMail, bHasEMailMR, bChatAgent;
DWORD dwContactSeverFlags = 0;
CMStringW blogStatusMsgSize;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// proto own contact
bIsContactMRA = IsContactMra(hContact);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 91f9578d44..73270f7d9e 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -233,7 +233,7 @@ DWORD CMraProto::MraNetworkDispatcher()
}
{
DWORD dwCMDNum, dwFlags, dwAckType;
- HANDLE hContact;
+ HCONTACT hContact;
LPBYTE lpbData;
size_t dwDataSize;
while (!MraSendQueueFindOlderThan(hSendQueueHandle, SEND_QUEUE_TIMEOUT, &dwCMDNum, &dwFlags, &hContact, &dwAckType, &lpbData, &dwDataSize)) {
@@ -430,7 +430,7 @@ bool CMraProto::CmdMessageAck(BinBuffer &buf)
bool CMraProto::CmdMessageStatus(ULONG seq, BinBuffer &buf)
{
DWORD dwAckType, dwTemp = buf.getDword();
- HANDLE hContact;
+ HCONTACT hContact;
if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, NULL, NULL)) {
switch (dwTemp) {
case MESSAGE_DELIVERED:// Message delivered directly to user
@@ -554,7 +554,7 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf)
buf >> szEmail;
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
if (bAdded)
MraUpdateContactInfo(hContact);
@@ -613,7 +613,7 @@ bool CMraProto::CmdFileTransfer(BinBuffer &buf)
}
BOOL bAdded = FALSE;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded);
if (bAdded)
MraUpdateContactInfo(hContact);
@@ -667,7 +667,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf)
buf >> dwStatus >> szSpecStatusUri >> szStatusTitle >> szStatusDesc >> szEmail >> dwFutureFlags >> szUserAgentFormatted;
BOOL bAdded;
- if (HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) {
+ if (HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) {
if (bAdded)
MraUpdateContactInfo(hContact);
@@ -705,7 +705,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf)
bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
{
- DWORD dwAckType; HANDLE hContact; LPBYTE pData; size_t dataLen;
+ DWORD dwAckType; HCONTACT hContact; LPBYTE pData; size_t dataLen;
if (!MraSendQueueFind(hSendQueueHandle, seq, NULL, &hContact, &dwAckType, &pData, &dataLen)) {
DWORD dwTemp = buf.getDword();
switch (dwTemp) {
@@ -753,7 +753,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
{
- DWORD dwAckType, dwFlags; HANDLE hContact; LPBYTE pData; size_t dataLen;
+ DWORD dwAckType, dwFlags; HCONTACT hContact; LPBYTE pData; size_t dataLen;
if (MraSendQueueFind(hSendQueueHandle, seq, &dwFlags, &hContact, &dwAckType, &pData, &dataLen)) {
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_ANKETA_INFO: not found in queue"));
return true;
@@ -1002,7 +1002,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
bool CMraProto::CmdGame(BinBuffer &buf)
{
- HANDLE hContact;
+ HCONTACT hContact;
CMStringA szEmail, szData;
DWORD dwGameSessionID, dwGameMsg, dwGameMsgID, dwTemp;
buf >> szEmail >> dwGameSessionID >> dwGameMsg >> dwGameMsgID >> dwTemp >> szData;
@@ -1241,7 +1241,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
if (dwControlParam > 5)// все параметры правильно инициализированны!
if ((dwContactFlag & (CONTACT_FLAG_GROUP | CONTACT_FLAG_REMOVED)) == 0) {
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded);
if (hContact) {
// already in list, remove the duplicate
if (GetContactBasicInfoW(hContact, &dwTemp, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == NO_ERROR && dwTemp != -1) {
@@ -1309,7 +1309,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
if (mraGetStringW(NULL, "AuthMessage", wszAuthMessage) == FALSE) // def auth message
wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
- 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 (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, &szEmail, NULL, NULL) == NO_ERROR)
if (dwID == -1) {
if (IsEMailChatAgent(szEmail)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
@@ -1338,7 +1338,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
}
else { // контакт лист почемуто не получили
// всех в offline и id в нестандарт
- 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)) {
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS),
-1, -2, 0, 0, ID_STATUS_OFFLINE, 0, 0, 0);
// request user info from server
@@ -1442,7 +1442,7 @@ bool CMraProto::CmdBlogStatus(BinBuffer &buf)
buf >> dwFlags >> szEmail >> dwBlogStatusID >> dwTime >> wszText >> szString;
- if (HANDLE hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) {
+ if (HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) {
if (dwFlags & MRIM_BLOG_STATUS_MUSIC)
mraSetStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, wszText);
else {
@@ -1459,7 +1459,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader)
WCHAR szBuff[4096] = { 0 };
DWORD dwTemp, dwAckType;
size_t dwSize;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
LPBYTE pByte;
debugLogA("Received packet %x\n", pmaHeader->msg);
@@ -1674,7 +1674,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &
}
else {
BOOL bAdded;
- HANDLE hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded);
+ HCONTACT hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded);
if (bAdded)
MraUpdateContactInfo(hContact);
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index 50f8923fbd..16efbc3467 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -119,7 +119,7 @@ const LPWSTR lpcszXStatusNameDef[] =
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-void CMraProto::SetExtraIcons(HANDLE hContact)
+void CMraProto::SetExtraIcons(HCONTACT hContact)
{
DWORD dwID, dwGroupID, dwContactSeverFlags;
if (GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL))
@@ -168,7 +168,7 @@ INT_PTR CMraProto::MraXStatusMenu(WPARAM wParam, LPARAM lParam, LPARAM param)
int CMraProto::MraContactDeleted(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!m_bLoggedIn || !hContact)
return 0;
@@ -191,7 +191,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam)
if (!m_bLoggedIn || !lParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -298,7 +298,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam)
int CMraProto::MraExtraIconsApply(WPARAM wParam, LPARAM lParam)
{
- SetExtraIcons((HANDLE)wParam);
+ SetExtraIcons((HCONTACT)wParam);
return 0;
}
@@ -449,7 +449,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam;
if (pData->cbSize < sizeof(CUSTOM_STATUS))
@@ -552,7 +552,7 @@ INT_PTR CMraProto::MraSendNudge(WPARAM wParam, LPARAM lParam)
{
if (m_bLoggedIn && wParam) {
LPWSTR lpwszAlarmMessage = TranslateW(MRA_ALARM_MESSAGE);
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
@@ -619,7 +619,7 @@ INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam)
int CMraProto::OnGroupChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL) {
CLISTGROUPCHANGE *cgc = (CLISTGROUPCHANGE*)lParam;
if (cgc->pszOldName == NULL)