summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-02 20:06:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-02 20:06:53 +0000
commit419d2a2454ee7d3eb7b394547351509ac801c8f6 (patch)
tree275f14934ccfd91ba8eae7b76346b8351e83a03f /plugins/Db3x_mmap
parente27f1addc43bdfeb896081ecca5e0b52e9e6179a (diff)
MS_MC_DISABLEHIDDENGROUP - nasty clutch removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@8363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/commonheaders.h1
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp26
2 files changed, 23 insertions, 4 deletions
diff --git a/plugins/Db3x_mmap/src/commonheaders.h b/plugins/Db3x_mmap/src/commonheaders.h
index 3467c6ddee..6fac634f56 100644
--- a/plugins/Db3x_mmap/src/commonheaders.h
+++ b/plugins/Db3x_mmap/src/commonheaders.h
@@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_icolib.h>
#include <m_options.h>
#include <m_crypto.h>
+#include <m_metacontacts.h>
#include "database.h"
#include "dbintf.h"
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp
index e0dfbf6108..1337341bde 100644
--- a/plugins/Db3x_mmap/src/dbcontacts.cpp
+++ b/plugins/Db3x_mmap/src/dbcontacts.cpp
@@ -247,17 +247,35 @@ void CDb3Mmap::FillContacts()
CheckProto(cc, "");
DBVARIANT dbv; dbv.type = DBVT_DWORD;
- cc->nSubs = (0 != GetContactSetting(dwContactID, "MetaContacts", "NumContacts", &dbv)) ? -1 : dbv.dVal;
+ cc->nSubs = (0 != GetContactSetting(dwContactID, META_PROTO, "NumContacts", &dbv)) ? -1 : dbv.dVal;
if (cc->nSubs != -1) {
cc->pSubs = (MCONTACT*)mir_alloc(cc->nSubs*sizeof(MCONTACT));
for (int i = 0; i < cc->nSubs; i++) {
char setting[100];
mir_snprintf(setting, sizeof(setting), "Handle%d", i);
- cc->pSubs[i] = (0 != GetContactSetting(dwContactID, "MetaContacts", setting, &dbv)) ? NULL : dbv.dVal;
+ cc->pSubs[i] = (0 != GetContactSetting(dwContactID, META_PROTO, setting, &dbv)) ? NULL : dbv.dVal;
+ }
+ }
+ cc->activeID = (0 != GetContactSetting(dwContactID, META_PROTO, "Default", &dbv)) ? NULL : dbv.dVal;
+ cc->parentID = (0 != GetContactSetting(dwContactID, META_PROTO, "Handle", &dbv)) ? NULL : dbv.dVal;
+
+ // whether we need conversion or not
+ if (!GetContactSetting(dwContactID, META_PROTO, "MetaID", &dbv)) {
+ // we don't need it anymore
+ DeleteContactSetting(dwContactID, META_PROTO, "MetaID");
+
+ for (int i = 0; i < cc->nSubs; i++) {
+ // store contact id instead of the old mc number
+ DBCONTACTWRITESETTING dbws = { META_PROTO, "ParentMeta" };
+ dbws.value.type = DBVT_DWORD;
+ dbws.value.dVal = dwContactID;
+ WriteContactSetting(cc->pSubs[i], &dbws);
+
+ // wipe out old data from subcontacts
+ DeleteContactSetting(cc->pSubs[i], META_PROTO, "ContactNumber");
+ DeleteContactSetting(cc->pSubs[i], META_PROTO, "MetaLink");
}
}
- cc->activeID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Default", &dbv)) ? NULL : dbv.dVal;
- cc->parentID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Handle", &dbv)) ? NULL : dbv.dVal;
dwOffset = p->ofsNext;
}