diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-06 11:30:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-06 11:30:40 +0000 |
commit | 8dabe06ba2c2e42aedaadc9f712190e239a17f28 (patch) | |
tree | 75cfc289e51db97352278ba8b6b2aa5899fe63fd | |
parent | 58d6ac34a9cea9499948f06aee6c011a2fc9bf7f (diff) |
methods for meta-history merging & splitting
git-svn-id: http://svn.miranda-ng.org/main/trunk@8428 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | include/m_db_int.h | 2 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbcontacts.cpp | 10 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 2 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 16 |
4 files changed, 18 insertions, 12 deletions
diff --git a/include/m_db_int.h b/include/m_db_int.h index 3989424c40..3b913f7bb0 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -114,6 +114,8 @@ interface MIDatabase STDMETHOD_(BOOL, MetaDetouchSub)(DBCachedContact*, int nSub) PURE;
STDMETHOD_(BOOL, MetaSetDefault)(DBCachedContact*) PURE;
+ STDMETHOD_(BOOL, MetaMergeHistory)(DBCachedContact *ccMeta, MCONTACT hSub) PURE;
+ STDMETHOD_(BOOL, MetaSplitHistory)(DBCachedContact *ccMeta, MCONTACT hSub) PURE;
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 0f3027afb4..e384319cfb 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -213,6 +213,16 @@ BOOL CDb3Mmap::MetaSetDefault(DBCachedContact *cc) return db_set_dw(cc->contactID, META_PROTO, "Default", cc->nDefault);
}
+BOOL CDb3Mmap::MetaMergeHistory(DBCachedContact *ccMeta, MCONTACT hSub)
+{
+ return 0;
+}
+
+BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, MCONTACT hSub)
+{
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// contacts convertor
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 50821b6204..253d7e803c 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -236,6 +236,8 @@ public: STDMETHODIMP_(BOOL) MetaDetouchSub(DBCachedContact *cc, int nSub);
STDMETHODIMP_(BOOL) MetaSetDefault(DBCachedContact *cc);
+ STDMETHODIMP_(BOOL) MetaMergeHistory(DBCachedContact *ccMeta, MCONTACT hSub);
+ STDMETHODIMP_(BOOL) MetaSplitHistory(DBCachedContact *ccMeta, MCONTACT hSub);
protected:
STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback);
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index 8c42b1539c..fe5ac94efa 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -48,14 +48,7 @@ static HGENMENU INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
{
- DBVARIANT dbv;
- char *group = 0;
-
- // Get some information about the selected contact.
- if (!db_get_utf(wParam, "CList", "Group", &dbv)) {
- group = _strdup(dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszGroup(db_get_tsa(wParam, "CList", "Group"));
// Create a new metacontact
MCONTACT hMetaContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
@@ -70,8 +63,8 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) // Add the MetaContact protocol to the new meta contact
CallService(MS_PROTO_ADDTOCONTACT, hMetaContact, (LPARAM)META_PROTO);
- if (group)
- db_set_utf(hMetaContact, "CList", "Group", group);
+ if (tszGroup)
+ db_set_ts(hMetaContact, "CList", "Group", tszGroup);
// Assign the contact to the MetaContact just created (and make default).
if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
@@ -85,8 +78,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) db_set_b(hMetaContact, "CList", "Hidden", 1);
}
- free(group);
- return (INT_PTR)hMetaContact;
+ return hMetaContact;
}
void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateInfo)
|