From a39e5feeb667a633cf6a24a4785233a73bb60e00 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Sep 2013 13:44:11 +0000 Subject: - full group support - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@5998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra_functions.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'protocols/MRA/src/Mra_functions.cpp') diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 66d71e5966..e3548ebad4 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -297,12 +297,41 @@ BOOL DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszVal return(bRet); } +DWORD CMraProto::MraMoveContactToGroup(HANDLE hContact, DWORD dwGroupID, LPCTSTR ptszName) +{ + MraGroupItem *p = NULL; + + for (int i=0; i < m_groups.getCount(); i++) + if (m_groups[i].m_name == ptszName) { + p = &m_groups[i]; + break; + } + + if (p == NULL) { + if (m_groups.getCount() == 20) + return 0; + + DWORD id; + for (id=0; id < 20; id++) + if (m_groups.find((MraGroupItem*)&id) == NULL) + break; + + p = new MraGroupItem(id, CONTACT_FLAG_GROUP, ptszName); + m_groups.insert(p); + } + + if (dwGroupID != p->m_id) { + setDword("GroupID", p->m_id); + MraModifyContact(hContact, 0, 0, &p->m_id); + } + return p->m_id; +} + DWORD CMraProto::GetContactFlags(HANDLE hContact) { DWORD dwRet = 0; - if (IsContactMra(hContact)) - { + if (IsContactMra(hContact)) { dwRet = getDword(hContact, "ContactFlags", 0); dwRet &= ~(CONTACT_FLAG_REMOVED|CONTACT_FLAG_GROUP|CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE|CONTACT_FLAG_IGNORE|CONTACT_FLAG_SHADOW|CONTACT_FLAG_MULTICHAT); dwRet |= CONTACT_FLAG_UNICODE_NAME; -- cgit v1.2.3