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/Mra_functions.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/Mra_functions.cpp')
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
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;
|