From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra.h | 20 ++--- protocols/MRA/src/MraAvatars.cpp | 16 ++-- protocols/MRA/src/MraChat.cpp | 26 +++--- protocols/MRA/src/MraFilesQueue.cpp | 6 +- protocols/MRA/src/MraPopUp.cpp | 4 +- protocols/MRA/src/MraProto.cpp | 50 +++++------ protocols/MRA/src/MraProto.h | 162 +++++++++++++++++------------------ protocols/MRA/src/MraSelectEMail.cpp | 6 +- protocols/MRA/src/MraSendCommand.cpp | 14 +-- protocols/MRA/src/MraSendQueue.cpp | 8 +- protocols/MRA/src/MraSendQueue.h | 6 +- protocols/MRA/src/Mra_functions.cpp | 66 +++++++------- protocols/MRA/src/Mra_menus.cpp | 52 +++++------ protocols/MRA/src/Mra_proto.cpp | 28 +++--- protocols/MRA/src/Mra_svcs.cpp | 14 +-- 15 files changed, 239 insertions(+), 239 deletions(-) (limited to 'protocols/MRA/src') diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 59063cbba3..c76e9cc70c 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(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_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize); -bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); -bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); +bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret); +bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW &Ret); -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_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &value); +bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &value); -bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize); +bool DB_GetContactSettingBlob(MCONTACT 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(HCONTACT hContact); +bool IsContactMraProto(MCONTACT hContact); bool IsEMailMR(const CMStringA& szEmail); bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail); bool IsPhone(LPSTR lpszString, size_t dwStringSize); -bool IsContactPhone(HCONTACT hContact, LPSTR lpszPhone, size_t dwPhoneSize); +bool IsContactPhone(MCONTACT 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(HCONTACT hContact); +bool MraSendReplyBlogStatus(MCONTACT 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 9ae3ee41dc..da45ef5852 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; - HCONTACT hContact; + MCONTACT 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, HCONTACT hContact, DWORD *pdwAvatarsQueueID) +DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT 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(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) +bool CMraProto::MraAvatarsGetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) { if (lpszValueName && pstTime) { INTERNET_TIME itAvatarLastModifiedTimeLocal; @@ -468,7 +468,7 @@ bool CMraProto::MraAvatarsGetContactTime(HCONTACT hContact, LPSTR lpszValueName, } -void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) +void CMraProto::MraAvatarsSetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime) { if (!lpszValueName) return; @@ -486,7 +486,7 @@ void CMraProto::MraAvatarsSetContactTime(HCONTACT hContact, LPSTR lpszValueName, delSetting(hContact, lpszValueName); } -DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hContact, DWORD dwFormat, CMStringW &res) +DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, MCONTACT hContact, DWORD dwFormat, CMStringW &res) { res.Empty(); if (hAvatarsQueueHandle == NULL) @@ -523,7 +523,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HCONTACT hCon return ERROR_INSUFFICIENT_BUFFER; } -DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath) +DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT 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, HCONTACT hContact, DWORD dwSourceID) +DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT 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, HCONTACT hContact) +DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, MCONTACT hContact) { if (hAvatarsQueueHandle == NULL) return ERROR_INVALID_HANDLE; diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 4c95f5ec38..209d14c71c 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(HCONTACT hContact) +INT_PTR CMraProto::MraChatSessionNew(MCONTACT hContact) { if (bChatExists) if (hContact) { @@ -63,7 +63,7 @@ INT_PTR CMraProto::MraChatSessionNew(HCONTACT hContact) return 1; } -void CMraProto::MraChatSessionDestroy(HCONTACT hContact) +void CMraProto::MraChatSessionDestroy(MCONTACT hContact) { if (!bChatExists || hContact == NULL) return; @@ -79,7 +79,7 @@ void CMraProto::MraChatSessionDestroy(HCONTACT hContact) CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce); } -INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime) { if (!bChatExists) return 1; @@ -111,7 +111,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, gce.ptszNick = wszNick; } else { - HCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL); + MCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL); wszUID = lpszUID; if (hContactSender) gce.ptszNick = GetContactNameW(hContactSender); @@ -122,7 +122,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession, return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce); } -INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionInvite(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (!hContactChatSession) return 1; @@ -132,7 +132,7 @@ INT_PTR CMraProto::MraChatSessionInvite(HCONTACT hContactChatSession, const CMSt return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime); } -INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) { if (!hContactChatSession) return 1; @@ -142,7 +142,7 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(HCONTACT hContactChatSession, const return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime); } -INT_PTR CMraProto::MraChatSessionJoinUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionJoinUser(MCONTACT 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(HCONTACT hContactChatSession, const CM return 1; } -INT_PTR CMraProto::MraChatSessionLeftUser(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionLeftUser(MCONTACT 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(HCONTACT hContactChatSession, const CM return 1; } -INT_PTR CMraProto::MraChatSessionSetIviter(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) +INT_PTR CMraProto::MraChatSessionSetIviter(MCONTACT 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(HCONTACT hContactChatSession, const C return 1; } -INT_PTR CMraProto::MraChatSessionSetOwner(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat) +INT_PTR CMraProto::MraChatSessionSetOwner(MCONTACT 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(HCONTACT hContactChatSession, const CM } -INT_PTR CMraProto::MraChatSessionMessageAdd(HCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, const CMStringW &lpwszMessage, DWORD dwTime) +INT_PTR CMraProto::MraChatSessionMessageAdd(MCONTACT 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; - HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); + MCONTACT 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; - HCONTACT hContact = MraHContactFromEmail(lpszEMail, TRUE, TRUE, &bAdded); + MCONTACT 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 3f4ec7213f..418f5cf060 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; - HCONTACT hContact; + MCONTACT 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, HCONTACT hContact, DWORD dwIDRequest, const CMStringW &lpwszFiles, const CMStringA &szAddresses) +DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT 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, HCONTACT hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest) +DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT 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 29da89b58f..94fe71dc8e 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(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) +void CMraProto::MraPopupShowFromContactW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) { WCHAR szTitle[MAX_CONTACTNAME]; CMStringW szNick, szEmail; @@ -212,7 +212,7 @@ void CMraProto::MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage); } -void CMraProto::MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage) +void CMraProto::MraPopupShowW(MCONTACT 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 f6ea74dbff..0bb77b16bd 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT 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 @@ -126,13 +126,13 @@ int CMraProto::OnPreShutdown(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -HCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags) +MCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags) { if (!plpsEMail) return NULL; BOOL bAdded; - HCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(plpsEMail, TRUE, TRUE, &bAdded); if (hContact == NULL) return NULL; @@ -153,7 +153,7 @@ HCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTST return hContact; } -HCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) +MCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) { if (psr->cbSize != sizeof(PROTOSEARCHRESULT)) return 0; @@ -161,7 +161,7 @@ HCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return AddToListByEmail(psr->email, psr->nick, psr->firstName, psr->lastName, flags); } -HCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); @@ -186,9 +186,9 @@ HCONTACT 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(HCONTACT, int, PROTORECVEVENT*) { return 1; } -int CMraProto::RecvUrl(HCONTACT, PROTORECVEVENT*) { return 1; } -int CMraProto::SendUrl(HCONTACT, int, const char*) { return 1; } +int CMraProto::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*) { return 1; } +int CMraProto::RecvUrl(MCONTACT, PROTORECVEVENT*) { return 1; } +int CMraProto::SendUrl(MCONTACT, int, const char*) { return 1; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -234,20 +234,20 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason) return 0; } -int CMraProto::AuthRecv(HCONTACT hContact, PROTORECVEVENT* pre) +int CMraProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) { Proto_AuthRecv(m_szModuleName, pre); return 0; } -int CMraProto::AuthRequest(HCONTACT hContact, const TCHAR *lptszMessage) +int CMraProto::AuthRequest(MCONTACT hContact, const TCHAR *lptszMessage) { return 1; } ///////////////////////////////////////////////////////////////////////////////////////// -HANDLE CMraProto::FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath) +HANDLE CMraProto::FileAllow(MCONTACT 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(HCONTACT hContact, HANDLE hTransfer, const TCHAR *sz return NULL; } -int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) +int CMraProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) { if (hContact && hTransfer) { MraFilesQueueCancel(hFilesQueueHandle, (DWORD)hTransfer, TRUE); @@ -266,14 +266,14 @@ int CMraProto::FileCancel(HCONTACT hContact, HANDLE hTransfer) return 1; } -int CMraProto::FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR*) +int CMraProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*) { return FileCancel(hContact, hTransfer); } ///////////////////////////////////////////////////////////////////////////////////////// -DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR CMraProto::GetCaps(int type, MCONTACT hContact) { switch ( type ) { case PFLAGNUM_1: @@ -310,7 +310,7 @@ DWORD_PTR CMraProto::GetCaps(int type, HCONTACT hContact) } } -int CMraProto::GetInfo(HCONTACT hContact, int infoType) +int CMraProto::GetInfo(MCONTACT hContact, int infoType) { return MraUpdateContactInfo(hContact) != 0; } @@ -347,7 +347,7 @@ HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) +int CMraProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = m_szModuleName; @@ -360,19 +360,19 @@ int CMraProto::RecvContacts(HCONTACT hContact, PROTORECVEVENT* pre) return 0; } -int CMraProto::RecvFile(HCONTACT hContact, PROTORECVFILET *pre) +int CMraProto::RecvFile(MCONTACT hContact, PROTORECVFILET *pre) { return Proto_RecvFile(hContact, pre); } -int CMraProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int CMraProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { return Proto_RecvMessage(hContact, pre); } ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int CMraProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { INT_PTR iRet = 0; @@ -398,7 +398,7 @@ int CMraProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTAC return iRet; } -HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) +HANDLE CMraProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) { INT_PTR iRet = 0; @@ -410,7 +410,7 @@ HANDLE CMraProto::SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR* return (HANDLE)iRet; } -int CMraProto::SendMsg(HCONTACT hContact, int flags, const char *lpszMessage) +int CMraProto::SendMsg(MCONTACT 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(HCONTACT hContact, int flags, const char *lpszMessage) ///////////////////////////////////////////////////////////////////////////////////////// -int CMraProto::SetApparentMode(HCONTACT hContact, int mode) +int CMraProto::SetApparentMode(MCONTACT 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) 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(HCONTACT hContact) +HANDLE CMraProto::GetAwayMsg(MCONTACT 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(HCONTACT hContact, int type) +int CMraProto::UserIsTyping(MCONTACT 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 3ac3f5cfc9..9377aafc9b 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -38,23 +38,23 @@ struct CMraProto : public PROTO // PROTO_INTERFACE // ==================================================================================== - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDBEvent); virtual int __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const TCHAR* id); virtual HANDLE __cdecl SearchByEmail(const TCHAR* email); @@ -62,56 +62,56 @@ struct CMraProto : public PROTO virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const 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 SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode); - void MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage); - void MraPopupShowFromContactW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage); + void MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage); + void MraPopupShowFromContactW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage); __forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPCWSTR lpszMessage) { MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); } - __forceinline bool mraGetStaticStringA(HCONTACT Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { + __forceinline bool mraGetStaticStringA(MCONTACT 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(HCONTACT Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) { + __forceinline bool mraGetStaticStringW(MCONTACT 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(HCONTACT Contact, const char *ValueName, CMStringA &Ret) { + __forceinline bool mraGetStringA(MCONTACT Contact, const char *ValueName, CMStringA &Ret) { return DB_GetStringA(Contact, m_szModuleName, ValueName, Ret); } - __forceinline bool mraGetStringW(HCONTACT Contact, const char *ValueName, CMStringW &Ret) { + __forceinline bool mraGetStringW(MCONTACT Contact, const char *ValueName, CMStringW &Ret) { return DB_GetStringW(Contact, m_szModuleName, ValueName, Ret); } - __forceinline bool mraSetStringA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) { + __forceinline bool mraSetStringA(MCONTACT Contact, const char *valueName, const CMStringA &parValue) { return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) { + __forceinline bool mraSetStringW(MCONTACT Contact, const char *valueName, const CMStringW &parValue) { return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringExA(HCONTACT Contact, const char *valueName, const CMStringA &parValue) { + __forceinline bool mraSetStringExA(MCONTACT Contact, const char *valueName, const CMStringA &parValue) { return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraSetStringExW(HCONTACT Contact, const char *valueName, const CMStringW &parValue) { + __forceinline bool mraSetStringExW(MCONTACT Contact, const char *valueName, const CMStringW &parValue) { return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); } - __forceinline bool mraWriteContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) { + __forceinline bool mraWriteContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) { return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize) != 0; } - __forceinline bool mraGetContactSettingBlob(HCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { + __forceinline bool mraGetContactSettingBlob(MCONTACT hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) { return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); } // ====| Services |==================================================================== @@ -196,56 +196,56 @@ struct CMraProto : public PROTO CRITICAL_SECTION csCriticalSectionSend; - HCONTACT AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags); + MCONTACT AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags); - DWORD MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize); + DWORD MraMessage(BOOL bAddToQueue, MCONTACT 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(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 MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0); + DWORD MraModifyContact(MCONTACT 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(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszGroup); + DWORD MraMoveContactToGroup(MCONTACT 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(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); + HANDLE MraWPRequestW(MCONTACT 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(MCONTACT 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(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage); + DWORD MraSMSW(MCONTACT 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, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize); + DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, MCONTACT 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(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList); + void MraAddrListStoreToContact(MCONTACT hContact, MRA_ADDR_LIST *pmalAddrList); - 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 GetContactFlags(MCONTACT hContact); + DWORD SetContactFlags(MCONTACT hContact, DWORD dwContactFlag); + DWORD GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones); + DWORD SetContactBasicInfoW(MCONTACT 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(HCONTACT hContact, BOOL bMRAOnly); - bool GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff); + DWORD GetContactEMailCount(MCONTACT hContact, BOOL bMRAOnly); + bool GetContactFirstEMail(MCONTACT hContact, BOOL bMRAOnly, CMStringA &szRetBuff); - bool IsContactMra(HCONTACT hContact); + bool IsContactMra(MCONTACT hContact); bool IsEMailMy(const CMStringA &szEmail); bool IsEMailChatAgent(const CMStringA &szEmail); - bool IsContactChatAgent(HCONTACT hContact); + bool IsContactChatAgent(MCONTACT hContact); - HCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded); - bool MraUpdateContactInfo(HCONTACT hContact); + MCONTACT MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded); + bool MraUpdateContactInfo(MCONTACT hContact); DWORD MraSetXStatusInternal(DWORD dwXStatus); - DWORD MraGetContactStatus(HCONTACT hContact); - DWORD MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus); - DWORD MraContactCapabilitiesGet(HCONTACT hContact); - void MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags); + DWORD MraGetContactStatus(MCONTACT hContact); + DWORD MraSetContactStatus(MCONTACT hContact, DWORD dwNewStatus); + DWORD MraContactCapabilitiesGet(MCONTACT hContact); + void MraContactCapabilitiesSet(MCONTACT 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 DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &plpsFrom, CMStringA &plpsText, CMStringA &plpsRFTText, CMStringA &plpsMultiChatData); - void SetExtraIcons(HCONTACT hContact); + void SetExtraIcons(MCONTACT hContact); void InitMenus(void); HGENMENU CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult); - DWORD ProtoBroadcastAckAsync(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam); - CMStringA CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason); + DWORD ProtoBroadcastAckAsync(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam); + CMStringA CreateBlobFromContact(MCONTACT hContact, const CMStringW &wszRequestReason); bool GetPassDB(CMStringA& pass); bool MraRequestXStatusDetails(DWORD dwXStatus); - bool MraSendReplyBlogStatus(HCONTACT hContact); - DWORD MraSelectEMailDlgShow(HCONTACT hContact, DWORD dwType); + bool MraSendReplyBlogStatus(MCONTACT hContact); + DWORD MraSelectEMailDlgShow(MCONTACT hContact, DWORD dwType); DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection); @@ -300,8 +300,8 @@ struct CMraProto : public PROTO void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue); size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort); - 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 MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwIDRequest, const CMStringW &wszFiles, const CMStringA &szAddresses); + DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, MCONTACT 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 bool bChatExists; void MraChatDllError(); bool MraChatRegister(); - INT_PTR MraChatSessionNew(HCONTACT hContactChatSession); - void MraChatSessionDestroy(HCONTACT hContactChatSession); + INT_PTR MraChatSessionNew(MCONTACT hContactChatSession); + void MraChatSessionDestroy(MCONTACT hContactChatSession); void MraChatSendPrivateMessage(LPSTR lpwszEMail); - 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); + INT_PTR MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, DWORD dwType, DWORD dwFlags, const CMStringA &szUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime); + INT_PTR MraChatSessionInvite(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionMembersAdd(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionJoinUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionLeftUser(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime); + INT_PTR MraChatSessionSetIviter(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); + INT_PTR MraChatSessionSetOwner(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat); + INT_PTR MraChatSessionMessageAdd(MCONTACT 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, 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); + DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID); + bool MraAvatarsGetContactTime (MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); + void MraAvatarsSetContactTime (MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime); + DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, MCONTACT hContact, DWORD dwFormat, CMStringW &res); + DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath); + DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwSourceID); + DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, MCONTACT hContact); void __cdecl MraAvatarsThreadProc(LPVOID lpParameter); }; diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index fc889d5058..bfe205f2e0 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -4,11 +4,11 @@ struct MraSelectEMailDlgData { CMraProto *ppro; - HCONTACT hContact; + MCONTACT hContact; DWORD dwType; }; -void AddContactEMailToListParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList) +void AddContactEMailToListParam(MCONTACT 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(HCONTACT hContact, DWORD dwType) +DWORD CMraProto::MraSelectEMailDlgShow(MCONTACT 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 e673e2e4b8..27bd038607 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -71,7 +71,7 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// -DWORD CMraProto::MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize) +DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT 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(HCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage) +DWORD CMraProto::MraAddContact(MCONTACT 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(HCONTACT hContact, DWORD dwContactFlag, DWORD dwG } // change contact -DWORD CMraProto::MraModifyContact(HCONTACT hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones) +DWORD CMraProto::MraModifyContact(MCONTACT 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(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 CMraProto::MraWPRequestW(MCONTACT 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(HCONTACT hContact, DWORD dwAckType, DWORD dwRequ } // Поиск контакта по EMail -HANDLE CMraProto::MraWPRequestByEMail(HCONTACT hContact, DWORD dwAckType, CMStringA &szEmail) +HANDLE CMraProto::MraWPRequestByEMail(MCONTACT 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(HCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage) +DWORD CMraProto::MraSMSW(MCONTACT 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, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize) +DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, MCONTACT 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 08146fe8b2..41a90c55bc 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; - HCONTACT hContact; + MCONTACT hContact; DWORD dwAckType; LPBYTE lpbData; size_t dwDataSize; @@ -59,7 +59,7 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle) } -DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize) +DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, MCONTACT 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, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) +DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, MCONTACT *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, HCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize) +DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, MCONTACT *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 e75038cfd9..cb3a62b4e3 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, HCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize); +DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize); DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum); -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); +DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, MCONTACT *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize); +DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, MCONTACT *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 5864886814..7d52e201ac 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; - HCONTACT hContact; + MCONTACT hContact; }; #define RECURSION_DATA_STACK_ITEMS_MIN 128 @@ -157,7 +157,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList) return res; } -void CMraProto::MraAddrListStoreToContact(HCONTACT hContact, MRA_ADDR_LIST *pmalAddrList) +void CMraProto::MraAddrListStoreToContact(MCONTACT hContact, MRA_ADDR_LIST *pmalAddrList) { if (!hContact || !pmalAddrList) return; @@ -181,7 +181,7 @@ void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList) } } -bool DB_GetStaticStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetStaticStringA(MCONTACT 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(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN } // sizes in wchars -bool DB_GetStaticStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetStaticStringW(MCONTACT 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(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN return bRet; } -bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res) +bool DB_GetStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA& res) { char *szRes = db_get_sa(hContact, lpszModule, lpszValueName); if (szRes) { @@ -249,7 +249,7 @@ bool DB_GetStringA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, C } -bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res) +bool DB_GetStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringW& res) { WCHAR *szRes = db_get_wsa(hContact, lpszModule, lpszValueName); if (szRes) { @@ -262,7 +262,7 @@ bool DB_GetStringW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, C return false; } -bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue) +bool DB_SetStringExA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringA &szValue) { if (szValue.IsEmpty()) { db_unset(hContact, lpszModule, lpszValueName); @@ -272,7 +272,7 @@ bool DB_SetStringExA(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, return db_set_s(hContact, lpszModule, lpszValueName, szValue) != 0; } -bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue) +bool DB_SetStringExW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, const CMStringW &szValue) { if (szValue.IsEmpty()) { db_unset(hContact, lpszModule, lpszValueName); @@ -282,7 +282,7 @@ bool DB_SetStringExW(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, return db_set_ws(hContact, lpszModule, lpszValueName, szValue) != 0; } -bool DB_GetContactSettingBlob(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) +bool DB_GetContactSettingBlob(MCONTACT 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(HCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszV return bRet; } -DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName) +DWORD CMraProto::MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName) { MraGroupItem *p = NULL; @@ -335,7 +335,7 @@ DWORD CMraProto::MraMoveContactToGroup(HCONTACT hContact, DWORD dwGroupID, LPCTS return p->m_id; } -DWORD CMraProto::GetContactFlags(HCONTACT hContact) +DWORD CMraProto::GetContactFlags(MCONTACT hContact) { DWORD dwRet = 0; @@ -366,7 +366,7 @@ DWORD CMraProto::GetContactFlags(HCONTACT hContact) return(dwRet); } -DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag) +DWORD CMraProto::SetContactFlags(MCONTACT hContact, DWORD dwContactFlag) { if (!IsContactMra(hContact)) return ERROR_INVALID_HANDLE; @@ -398,7 +398,7 @@ DWORD CMraProto::SetContactFlags(HCONTACT hContact, DWORD dwContactFlag) return 0; } -DWORD CMraProto::GetContactBasicInfoW(HCONTACT hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, CMStringA *szEmail, CMStringW *wszNick, CMStringA *szPhones) +DWORD CMraProto::GetContactBasicInfoW(MCONTACT 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(HCONTACT hContact, DWORD *pdwID, DWORD *pd return 0; } -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) +DWORD CMraProto::SetContactBasicInfoW(MCONTACT 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(HCONTACT hContact, DWORD dwSetInfoFlags, D return 0; } -HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded) +MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded) { if (szEmail.IsEmpty()) return NULL; - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; bool bFound = false; //check not already on list @@ -541,7 +541,7 @@ HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe } } else { - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName); } @@ -563,7 +563,7 @@ HCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe return hContact; } -bool CMraProto::MraUpdateContactInfo(HCONTACT hContact) +bool CMraProto::MraUpdateContactInfo(MCONTACT hContact) { if (m_bLoggedIn && hContact) if (IsContactMra(hContact)) { @@ -577,22 +577,22 @@ bool CMraProto::MraUpdateContactInfo(HCONTACT hContact) return false; } -DWORD CMraProto::MraContactCapabilitiesGet(HCONTACT hContact) +DWORD CMraProto::MraContactCapabilitiesGet(MCONTACT hContact) { return getDword(hContact, DBSETTING_CAPABILITIES, 0); } -void CMraProto::MraContactCapabilitiesSet(HCONTACT hContact, DWORD dwFutureFlags) +void CMraProto::MraContactCapabilitiesSet(MCONTACT hContact, DWORD dwFutureFlags) { setDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags); } -DWORD CMraProto::MraGetContactStatus(HCONTACT hContact) +DWORD CMraProto::MraGetContactStatus(MCONTACT hContact) { return getWord(hContact, "Status", ID_STATUS_OFFLINE); } -DWORD CMraProto::MraSetContactStatus(HCONTACT hContact, DWORD dwNewStatus) +DWORD CMraProto::MraSetContactStatus(MCONTACT hContact, DWORD dwNewStatus) { DWORD dwOldStatus = MraGetContactStatus(hContact); @@ -641,7 +641,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (m_dwEmailMessagesUnread) { CMStringA szEmail; - HCONTACT hContact = NULL; + MCONTACT 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(HCONTACT hContact) +bool CMraProto::IsContactMra(MCONTACT hContact) { return CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0; } // определяется является ли контакт контактом MRA протокола, не зависимо от того какому плагину он принадлежит -bool IsContactMraProto(HCONTACT hContact) +bool IsContactMraProto(MCONTACT hContact) { LPSTR lpszProto = GetContactProto(hContact); if (lpszProto) { @@ -751,7 +751,7 @@ bool CMraProto::IsEMailChatAgent(const CMStringA &szEmail) return false; } -bool CMraProto::IsContactChatAgent(HCONTACT hContact) +bool CMraProto::IsContactChatAgent(MCONTACT hContact) { if (hContact == NULL) return false; @@ -791,7 +791,7 @@ bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail) return false; } -DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName) +DWORD GetContactEMailCountParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName) { DWORD dwRet = 0; CMStringA szEmail; @@ -815,7 +815,7 @@ DWORD GetContactEMailCountParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu return dwRet; } -DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly) +DWORD CMraProto::GetContactEMailCount(MCONTACT hContact, BOOL bMRAOnly) { LPSTR lpszProto = (hContact) ? GetContactProto(hContact) : m_szModuleName; @@ -828,7 +828,7 @@ DWORD CMraProto::GetContactEMailCount(HCONTACT hContact, BOOL bMRAOnly) return dwRet; } -bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res) +bool GetContactFirstEMailParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, CMStringA &res) { CMStringA szEmail; @@ -853,7 +853,7 @@ bool GetContactFirstEMailParam(HCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModul return false; } -bool CMraProto::GetContactFirstEMail(HCONTACT hContact, BOOL bMRAOnly, CMStringA &res) +bool CMraProto::GetContactFirstEMail(MCONTACT 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(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) +DWORD CMraProto::ProtoBroadcastAckAsync(MCONTACT 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(HCONTACT hContact, int type, int hResult return 0; } -CMStringA CMraProto::CreateBlobFromContact(HCONTACT hContact, const CMStringW &wszRequestReason) +CMStringA CMraProto::CreateBlobFromContact(MCONTACT 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(HCONTACT hContact) +bool CMraProto::MraSendReplyBlogStatus(MCONTACT 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 ba91e2e660..d6584728d4 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { 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) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)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((HCONTACT)wParam, "e-mail", szEmail)) + if (mraGetStringA((MCONTACT)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((HCONTACT)wParam, FALSE); + DWORD dwContactEMailCount = GetContactEMailCount((MCONTACT)wParam, FALSE); if (dwContactEMailCount) { if (dwContactEMailCount == 1) { CMStringA szUrl, szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, FALSE, szEmail)) { + if (GetContactFirstEMail((MCONTACT)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((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD); + else MraSelectEMailDlgShow((MCONTACT)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((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_FOTO_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM); + else MraSelectEMailDlgShow((MCONTACT)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((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG); + else MraSelectEMailDlgShow((MCONTACT)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((HCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg); + mraGetStringW((MCONTACT)wParam, DBSETTING_BLOGSTATUS, blogStatusMsg); if (!blogStatusMsg.IsEmpty() || wParam == 0) - MraSendReplyBlogStatus((HCONTACT)wParam); + MraSendReplyBlogStatus((MCONTACT)wParam); return 0; } @@ -188,14 +188,14 @@ INT_PTR CMraProto::MraViewVideo(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn) return 0; - DWORD dwContactEMailMRCount = GetContactEMailCount((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_VIDEO_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO); + else MraSelectEMailDlgShow((MCONTACT)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((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_ANSWERS_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS); + else MraSelectEMailDlgShow((MCONTACT)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((HCONTACT)wParam, TRUE); + DWORD dwContactEMailMRCount = GetContactEMailCount((MCONTACT)wParam, TRUE); if (dwContactEMailMRCount) { if (dwContactEMailMRCount == 1) { CMStringA szEmail; - if (GetContactFirstEMail((HCONTACT)wParam, TRUE, szEmail)) + if (GetContactFirstEMail((MCONTACT)wParam, TRUE, szEmail)) MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_WORLD_URL, szEmail); } - else MraSelectEMailDlgShow((HCONTACT)wParam, MRA_SELECT_EMAIL_TYPE_WORLD); + else MraSelectEMailDlgShow((MCONTACT)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; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // proto own contact bIsContactMRA = IsContactMra(hContact); diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 73270f7d9e..eb968f9d10 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; - HCONTACT hContact; + MCONTACT 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(); - HCONTACT hContact; + MCONTACT 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; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); + MCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); if (bAdded) MraUpdateContactInfo(hContact); @@ -613,7 +613,7 @@ bool CMraProto::CmdFileTransfer(BinBuffer &buf) } BOOL bAdded = FALSE; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded); + MCONTACT 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 (HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, TRUE, &bAdded)) { + if (MCONTACT 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; HCONTACT hContact; LPBYTE pData; size_t dataLen; + DWORD dwAckType; MCONTACT 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; HCONTACT hContact; LPBYTE pData; size_t dataLen; + DWORD dwAckType, dwFlags; MCONTACT 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) { - HCONTACT hContact; + MCONTACT 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; - HCONTACT hContact = MraHContactFromEmail(szEmail, TRUE, FALSE, &bAdded); + MCONTACT 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { 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 (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { 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 (HCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL)) { + if (MCONTACT 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; - HCONTACT hContact = NULL; + MCONTACT 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; - HCONTACT hContact = MraHContactFromEmail(plpsFrom, TRUE, TRUE, &bAdded); + MCONTACT 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 16efbc3467..bbc74e26cb 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(HCONTACT hContact) +void CMraProto::SetExtraIcons(MCONTACT 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) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!m_bLoggedIn || !hContact) return 0; @@ -191,7 +191,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn || !lParam) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)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((HCONTACT)wParam); + SetExtraIcons((MCONTACT)wParam); return 0; } @@ -449,7 +449,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)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); - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)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) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (hContact == NULL) { CLISTGROUPCHANGE *cgc = (CLISTGROUPCHANGE*)lParam; if (cgc->pszOldName == NULL) -- cgit v1.2.3