summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/MraProto.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MRA/src/MraProto.h')
-rw-r--r--protocols/MRA/src/MraProto.h199
1 files changed, 111 insertions, 88 deletions
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index 341398d368..e0f7e06254 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -21,8 +21,11 @@ struct MRA_FILES_QUEUE_ITEM;
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_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCSTR lpszValue, size_t dwValueSize);
-BOOL DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCWSTR lpwszValue, size_t dwValueSize);
+BOOL DB_GetStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, CMStringA &Ret);
+BOOL DB_GetStringW(HANDLE 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_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
@@ -82,9 +85,9 @@ struct CMraProto : public PROTO<CMraProto>
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, LPWSTR lpszMessage);
- void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage);
- __forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage) {
+ void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
+ void MraPopupShowFromContactW(HANDLE 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) {
@@ -92,20 +95,20 @@ struct CMraProto : public PROTO<CMraProto>
__forceinline BOOL mraGetStaticStringW(HANDLE Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
return DB_GetStaticStringW(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); }
- __forceinline BOOL mraSetStringA(HANDLE Contact, const char *valueName, const char *parValue) {
- return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue, lstrlenA(parValue)); }
- __forceinline BOOL mraSetStringW(HANDLE Contact, const char *valueName, const WCHAR *parValue) {
- return db_set_ws(Contact, m_szModuleName, valueName, parValue); }
+ __forceinline BOOL mraGetStringA(HANDLE Contact, const char *ValueName, CMStringA &Ret) {
+ return DB_GetStringA(Contact, m_szModuleName, ValueName, Ret); }
+ __forceinline BOOL mraGetStringW(HANDLE Contact, const char *ValueName, CMStringW &Ret) {
+ return DB_GetStringW(Contact, m_szModuleName, ValueName, Ret); }
- __forceinline BOOL mraSetLPSStringA(HANDLE Contact, const char *valueName, MRA_LPS *parValue) {
- return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue->lpszData, parValue->dwSize); }
- __forceinline BOOL mraSetLPSStringW(HANDLE Contact, const char *valueName, MRA_LPS *parValue) {
- return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue->lpwszData, parValue->dwSize/sizeof(WCHAR)); }
+ __forceinline BOOL mraSetStringA(HANDLE 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) {
+ return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
- __forceinline BOOL mraSetStringExA(HANDLE Contact, const char *valueName, const char *parValue, size_t parValueSize) {
- return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue, parValueSize); }
- __forceinline BOOL mraSetStringExW(HANDLE Contact, const char *valueName, const WCHAR *parValue, size_t parValueSize) {
- return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue, parValueSize); }
+ __forceinline BOOL mraSetStringExA(HANDLE 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) {
+ return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue); }
__forceinline BOOL mraWriteContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
return db_set_blob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize); }
@@ -165,26 +168,26 @@ struct CMraProto : public PROTO<CMraProto>
int __cdecl MraMusicChanged(WPARAM, LPARAM);
// ====| Data |========================================================================
- bool m_bLoggedIn;
+ bool m_bLoggedIn;
- HANDLE hSendQueueHandle, hFilesQueueHandle, hMPopSessionQueue;
+ HANDLE hSendQueueHandle, hFilesQueueHandle, hMPopSessionQueue;
- HANDLE hNetlibUser, heNudgeReceived;
- HANDLE hThreadWorker;
- HANDLE hConnection;
- DWORD dwThreadWorkerLastPingTime;
- DWORD dwThreadWorkerRunning;
- DWORD dwCMDNum;
+ HANDLE m_hNetlibUser, m_heNudgeReceived;
+ HANDLE m_hThreadWorker;
+ HANDLE m_hConnection;
+ DWORD m_dwThreadWorkerLastPingTime, m_dwNextPingSendTickTime, m_dwPingPeriod;
+ DWORD m_dwThreadWorkerRunning;
+ DWORD dwCMDNum;
- HANDLE hAvatarsQueueHandle;
+ HANDLE hAvatarsQueueHandle;
HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
HWND hWndEMailPopupStatus;
- DWORD dwEmailMessagesTotal, dwEmailMessagesUnread;
+ DWORD dwEmailMessagesTotal, m_dwEmailMessagesUnread;
- BOOL bHideXStatusUI;
+ bool bHideXStatusUI;
HGENMENU hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
HANDLE hExtraXstatusIcon;
HANDLE hExtraInfo;
@@ -195,102 +198,122 @@ struct CMraProto : public PROTO<CMraProto>
HANDLE AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
- DWORD MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPCWSTR lpwszMessage, size_t dwMessageSize, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
- DWORD MraMessageAskW(DWORD dwMsgID, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpwszMessageRTF, size_t dwMessageRTFSize);
- DWORD MraMessageRecv(LPSTR lpszFrom, size_t dwFromSize, DWORD dwMsgID);
- DWORD MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize, LPWSTR lpwszAuthMessage, size_t dwAuthMessageSize, DWORD dwActions);
- DWORD MraModifyContactW(HANDLE hContact, DWORD dwID, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize);
+ DWORD MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
+ DWORD MraMessageAskW(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF);
+ DWORD MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID);
+ DWORD MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones, const CMStringW &wszAuthMessage, DWORD dwActions);
+ DWORD MraModifyContactW(HANDLE hContact, DWORD dwID, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones);
DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL);
- DWORD MraAuthorize(LPSTR lpszEMail, size_t dwEMailSize);
- DWORD MraChangeStatusW(DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags);
- DWORD MraFileTransfer(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIdRequest, DWORD dwFilesTotalSize, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize);
- DWORD MraFileTransferAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIdRequest, LPBYTE lpbDescription, size_t dwDescriptionSize);
- HANDLE MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, LPSTR lpszUser, size_t dwUserSize, LPSTR lpszDomain, size_t dwDomainSize, LPCWSTR lpwszNickName, size_t dwNickNameSize, LPCWSTR lpwszFirstName, size_t dwFirstNameSize, LPCWSTR lpwszLastName, size_t dwLastNameSize, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
- HANDLE MraWPRequestA(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, LPSTR lpszUser, size_t dwUserSize, LPSTR lpszDomain, size_t dwDomainSize, LPSTR lpszNickName, size_t dwNickNameSize, LPSTR lpszFirstName, size_t dwFirstNameSize, LPSTR lpszLastName, size_t dwLastNameSize, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
- HANDLE MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, LPCSTR lpszEMail, size_t dwEMailSize);
- DWORD MraGame(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, LPSTR lpszData, size_t dwDataSize);
- DWORD MraLogin2W(LPSTR lpszLogin, size_t dwLoginSize, LPSTR lpszPassword, size_t dwPasswordSize, DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags, LPSTR dwUserAgentFormatted, size_t dwUserAgentFormattedSize, LPSTR lpszUserAgent, size_t dwUserAgentSize);
- DWORD MraSMSW(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize, LPWSTR lpwszMessage, size_t dwMessageSize);
- DWORD MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID);
- DWORD MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID);
- DWORD MraChangeUserBlogStatus(DWORD dwFlags, LPWSTR lpwszText, size_t dwTextSize, DWORDLONG dwBlogStatusID);
-
- DWORD MraSendPacket(HANDLE hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize);
+ DWORD MraAuthorize(const CMStringA &szEmail);
+ DWORD MraChangeStatusW(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);
+ 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 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 MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize);
+ DWORD MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc);
void MraAddrListStoreToContact(HANDLE 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, LPSTR lpszEMail, size_t dwEMailSize, size_t *pdwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, size_t *pdwNickSize, LPSTR lpszPhones, size_t dwPhonesSize, size_t *pdwPhonesSize);
- DWORD SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, LPSTR lpszPhones, size_t dwPhonesSize);
+ 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 GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly);
- BOOL GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+ bool GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA &szRetBuff);
- BOOL IsContactMra(HANDLE hContact);
- BOOL IsEMailMy(LPSTR lpszEMail, size_t dwEMailSize);
- BOOL IsEMailChatAgent(LPSTR lpszEMail, size_t dwEMailSize);
- BOOL IsContactChatAgent(HANDLE hContact);
+ bool IsContactMra(HANDLE hContact);
+ bool IsEMailMy(const CMStringA &szEmail);
+ bool IsEMailChatAgent(const CMStringA &szEmail);
+ bool IsContactChatAgent(HANDLE hContact);
- HANDLE MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
- BOOL MraUpdateContactInfo(HANDLE hContact);
+ HANDLE MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
+ bool MraUpdateContactInfo(HANDLE 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);
- void MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lpszSubject, size_t dwSubjectSize, DWORD dwDate, DWORD dwUIDL);
- DWORD MraConvertToRTFW(LPCWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpszMessageRTF, size_t dwMessageRTFBuffSize, size_t *pdwMessageRTFSize);
+ void MraUpdateEmailStatus(const CMStringA &szFrom, const CMStringA &szSubject, DWORD dwDate, DWORD dwUIDL);
+ DWORD MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMessageRTF);
void MraThreadClean();
DWORD StartConnect();
void __cdecl MraThreadProc(LPVOID lpParameter);
- DWORD MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPort);
+ DWORD MraGetNLBData(CMStringA &szHost, WORD *pwPort);
DWORD MraNetworkDispatcher();
- DWORD MraCommandDispatcher(struct mrim_packet_header_t *pmaHeader, DWORD *pdwPingPeriod, DWORD *pdwNextPingSendTickTime, BOOL *pbContinue);
- DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *plpsFrom, MRA_LPS *plpsText, MRA_LPS *plpsRFTText, MRA_LPS *plpsMultiChatData);
+ bool MraCommandDispatcher(struct mrim_packet_header_t *pmaHeader);
+ bool CmdHelloAck(BinBuffer &buf);
+ bool CmdLoginAck();
+ bool CmdLoginRejected(BinBuffer &buf);
+ bool CmdMessageAck(BinBuffer &buf);
+ bool CmdMessageStatus(ULONG seq, BinBuffer &buf);
+ bool CmdOfflineMessageAck(BinBuffer &buf);
+ bool CmdAuthAck(BinBuffer &buf);
+ bool CmdPopSession(BinBuffer &buf);
+ bool CmdFileTransfer(BinBuffer &buf);
+ bool CmdFileTransferAck(BinBuffer &buf);
+ bool CmdUserInfo(BinBuffer &buf);
+ bool CmdUserStatus(BinBuffer &buf);
+ bool CmdContactAck(int cmd, int seq, BinBuffer &buf);
+ bool CmdAnketaInfo(int seq, BinBuffer &buf);
+ bool CmdGame(BinBuffer &buf);
+ bool CmdClist2(BinBuffer &buf);
+ bool CmdProxy(BinBuffer &buf);
+ bool CmdProxyAck(BinBuffer &buf);
+ bool CmdNewMail(BinBuffer &buf);
+ bool CmdBlogStatus(BinBuffer &buf);
+
+ DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &plpsFrom, CMStringA &plpsText, CMStringA &plpsRFTText, CMStringA &plpsMultiChatData);
void SetExtraIcons(HANDLE hContact);
#define MESSAGE_NOT_SPAM 1
#define MESSAGE_SPAM 2
- DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwMessageFlags, LPWSTR lpwszMessage, size_t dwMessageSize);
- BOOL MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMessageSize);
+ DWORD MraAntiSpamReceivedMessageW(const CMStringA &szEmail, DWORD dwMessageFlags, const CMStringW &wszMessage);
+ bool MraAntiSpamHasMessageBadWordsW(const CMStringW &wszMessage);
void InitMainMenu();
void InitContactMenu();
void CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsStatus, const struct GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HGENMENU *hResult);
DWORD ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
- DWORD CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReason, size_t dwRequestReasonSize, LPBYTE lpbBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet);
+ CMStringA CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason);
- BOOL SetPassDB(LPSTR lpszBuff, size_t dwBuffSize);
- BOOL GetPassDB(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize);
+ bool SetPassDB(const CMStringA& pass);
+ bool GetPassDB(CMStringA& pass);
- BOOL MraRequestXStatusDetails(DWORD dwXStatus);
- BOOL MraSendReplyBlogStatus(HANDLE hContact);
+ bool MraRequestXStatusDetails(DWORD dwXStatus);
+ bool MraSendReplyBlogStatus(HANDLE hContact);
DWORD MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType);
DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection);
- DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize);
- DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize, LPSTR lpszEMail, size_t dwEMailSize);
+ DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, const CMStringA &szUrl);
+ DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue, const CMStringA &, CMStringA &szEmail);
DWORD MraMPopSessionQueueStart(HANDLE hMPopSessionQueue);
void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue);
size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort);
- DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize);
+ 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 MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline);
DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
- DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPSTR lpszAddreses, size_t dwAddresesSize);
- BOOL MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+ DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, const CMStringA &szAddresses);
+ bool MraFilesQueueHandCheck(HANDLE m_hConnection, MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPCWSTR lpwszPath, size_t dwPathSize);
@@ -298,29 +321,29 @@ struct CMraProto : public PROTO<CMraProto>
void __cdecl MraFilesQueueRecvThreadProc(LPVOID lpParameter);
void __cdecl MraFilesQueueSendThreadProc(LPVOID lpParameter);
- BOOL bChatExists;
+ bool bChatExists;
void MraChatDllError();
- BOOL MraChatRegister();
+ bool MraChatRegister();
INT_PTR MraChatSessionNew(HANDLE hContactChatSession);
void MraChatSessionDestroy(HANDLE hContactChatSession);
- void MraChatSendPrivateMessage(LPWSTR lpwszEMail);
+ void MraChatSendPrivateMessage(LPSTR lpwszEMail);
- INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, LPSTR lpszUID, size_t dwUIDSize, LPWSTR lpwszStatus, LPWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime);
- INT_PTR MraChatSessionInvite(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
- INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
- INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
- INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
- INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize);
- INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize);
- INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, LPWSTR lpwszMessage, size_t dwMessageSize, DWORD dwTime);
+ 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);
DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle);
void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle);
void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle);
DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID);
- BOOL MraAvatarsGetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
+ bool MraAvatarsGetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
void MraAvatarsSetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
- DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, LPTSTR lpszPath, size_t dwPathSize, size_t *pdwPathSizeRet);
+ 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);