From 8e1537517ef28468ec101d042a29c865b4e1b931 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Sep 2013 17:27:07 +0000 Subject: also uploading new group's name to server git-svn-id: http://svn.miranda-ng.org/main/trunk@6004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/MraProto.h | 2 +- protocols/MRA/src/MraSendCommand.cpp | 8 ++++---- protocols/MRA/src/Mra_functions.cpp | 3 ++- protocols/MRA/src/Mra_proto.cpp | 7 +++---- protocols/MRA/src/Mra_svcs.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols') diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 3cbf5bd6b6..ddf7117766 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -206,7 +206,7 @@ struct CMraProto : public PROTO DWORD MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize); DWORD MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF); DWORD MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID); - DWORD MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones, const CMStringW &wszAuthMessage, DWORD dwActions); + DWORD MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0); DWORD MraModifyContact(HANDLE hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0); DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL); DWORD MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszGroup); diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index b95df280ee..7f64f1c3c3 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -184,7 +184,7 @@ DWORD CMraProto::MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID) } // Adds new contact -DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA &szPhones, const CMStringW &wszAuthMessage, DWORD dwActions) +DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage) { if (szEmail.GetLength() <= 4) return 0; @@ -196,16 +196,16 @@ DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGro buf.SetUL(dwGroupID); buf.SetLPSLowerCase(szEmail); buf.SetLPSW(wszCustomName); - buf.SetLPS(szPhones); + buf.SetLPS((szPhones == NULL) ? "" : *szPhones); // pack auth message OutBuffer buf2; buf2.SetUL(2); buf2.SetLPSW(L"");//***deb possible nick here - buf2.SetLPSW(wszAuthMessage); + buf2.SetLPSW((wszAuthMessage == NULL) ? L"" : *wszAuthMessage); buf.SetLPS(CMStringA( ptrA( mir_base64_encode(buf2.Data(), buf2.Len())))); - buf.SetUL(dwActions); + buf.SetUL(0); return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_ADD_CONTACT, buf.Data(), buf.Len()); } diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index e3548ebad4..542f750543 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -316,8 +316,9 @@ DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR if (m_groups.find((MraGroupItem*)&id) == NULL) break; - p = new MraGroupItem(id, CONTACT_FLAG_GROUP, ptszName); + p = new MraGroupItem(id, CONTACT_FLAG_UNICODE_NAME | CONTACT_FLAG_GROUP, ptszName); m_groups.insert(p); + MraAddContact(NULL, (CONTACT_FLAG_UNICODE_NAME | CONTACT_FLAG_GROUP) + (id << 24), 0, ptszName, p->m_name); } if (dwGroupID != p->m_id) { diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 0c95346715..c2991d9244 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1378,15 +1378,14 @@ bool CMraProto::CmdClist2(BinBuffer &buf) MraSetContactStatus(hContact, ID_STATUS_ONLINE); CMStringW wszCustomName = GetContactNameW(hContact); - MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME), - -1, szEmail, wszCustomName, "", L"", 0); + MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT), -1, szEmail, wszCustomName); } else { if (db_get_b(hContact, "CList", "NotOnList", 0) == 0) { // set extra icons and upload contact SetExtraIcons(hContact); if (getByte("AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)) { //add all contacts to server GetContactBasicInfoW(hContact, NULL, &dwGroupID, NULL, NULL, NULL, NULL, &wszNick, &szPhones); - MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME), dwGroupID, szEmail, wszNick, szPhones, wszAuthMessage, 0); + MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME), dwGroupID, szEmail, wszNick, &szPhones, &wszAuthMessage); } } } @@ -1790,7 +1789,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & break; case MULTICHAT_INVITE: MraChatSessionInvite(hContact, lpsEMailInMultiChat, dwTime);// LPS sender - MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME), -1, plpsFrom, lpsMultichatName, "", L"", 0); + MraAddContact(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME), -1, plpsFrom, lpsMultichatName); break; default: DebugBreak(); diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index aded6d16b4..999a6ba551 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -498,7 +498,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) CMStringW wszNick; DWORD dwGroupID, dwContactFlag; GetContactBasicInfoW(hContact, NULL, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones); - MraAddContact(hContact, dwContactFlag, dwGroupID, szEmail, wszNick, szPhones, wszAuthMessage, 0); + MraAddContact(hContact, dwContactFlag, dwGroupID, szEmail, wszNick, &szPhones, &wszAuthMessage); } } // Hidden setting -- cgit v1.2.3