diff options
author | George Hazan <george.hazan@gmail.com> | 2013-09-07 13:44:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-09-07 13:44:11 +0000 |
commit | a39e5feeb667a633cf6a24a4785233a73bb60e00 (patch) | |
tree | 7bfdcd0f6a33df62f396d3946cc9c26ebfd95487 /protocols/MRA/src/MraSendCommand.cpp | |
parent | 8543e1e7f855b195154a2d3739e834b58fa739cd (diff) |
- full group support
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@5998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/MraSendCommand.cpp')
-rw-r--r-- | protocols/MRA/src/MraSendCommand.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 33796b5c36..ab7df94a28 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -71,7 +71,7 @@ public: /////////////////////////////////////////////////////////////////////////////////////////
-DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
+DWORD CMraProto::MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
{
Netlib_Logf(m_hNetlibUser, "Sending message: flags %08x, to '%S', message '%S'\n", dwFlags, szEmail, lpwszMessage);
@@ -156,7 +156,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, }
// Send confirmation
-DWORD CMraProto::MraMessageAskW(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, const CMStringW &lpwszMessageRTF)
+DWORD CMraProto::MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, const CMStringW &lpwszMessageRTF)
{
if (szEmail.GetLength() <= 4 || lpwszMessage.IsEmpty())
return 0;
@@ -184,7 +184,7 @@ DWORD CMraProto::MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID) }
// Adds new contact
-DWORD CMraProto::MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones, const CMStringW &wszAuthMessage, DWORD dwActions)
+DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones, const CMStringW &wszAuthMessage, DWORD dwActions)
{
if (szEmail.GetLength() <= 4)
return 0;
@@ -211,11 +211,23 @@ DWORD CMraProto::MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGr }
// change contact
-DWORD CMraProto::MraModifyContactW(HANDLE hContact, DWORD dwID, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones)
+DWORD CMraProto::MraModifyContact(HANDLE hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones)
{
- if (dwID == -1)
+ if (pdwID && *pdwID == -1)
return 0;
+ CMStringA szEmail, szPhones;
+ CMStringW wszNick, wszCustomName;
+ DWORD dwID, dwGroupID, dwContactFlag;
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones);
+
+ if (pdwID) dwID = *pdwID;
+ if (pszEmail) szEmail = *pszEmail;
+ if (pszPhones) szPhones = *pszPhones;
+ if (pdwGroupID) dwGroupID = *pdwGroupID;
+ if (pdwContactFlag) dwContactFlag = *pdwContactFlag;
+ if (pwszCustomName) wszCustomName = *pwszCustomName;
+
dwContactFlag |= CONTACT_FLAG_UNICODE_NAME;
OutBuffer buf;
@@ -247,7 +259,7 @@ DWORD CMraProto::MraAuthorize(const CMStringA& szEmail) }
// change status
-DWORD CMraProto::MraChangeStatusW(DWORD dwStatus, const CMStringA &szStatusUri, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc, DWORD dwFutureFlags)
+DWORD CMraProto::MraChangeStatus(DWORD dwStatus, const CMStringA &szStatusUri, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc, DWORD dwFutureFlags)
{
OutBuffer buf;
buf.SetUL(dwStatus);
|