diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-06 13:36:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-06 13:36:00 +0000 |
commit | aeff43204a4f2b583f9f83b383be00cac89cbd4e (patch) | |
tree | 4e319e6d96e9614899e36b251f2319836eae37a5 /src | |
parent | 8dabe06ba2c2e42aedaadc9f712190e239a17f28 (diff) |
stubs for metahistory were slightly changed
git-svn-id: http://svn.miranda-ng.org/main/trunk@8429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 2 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 18 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index fe5ac94efa..054081febe 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -126,6 +126,8 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI ccSub->parentID = 0;
currDb->MetaDetouchSub(ccMeta, ccMeta->nSubs - 1);
+ currDb->MetaSplitHistory(ccMeta, ccSub);
+
// if the default contact was equal to or greater than 'number', decrement it (and deal with ends)
if (ccMeta->nDefault >= number) {
ccMeta->nDefault--;
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index 37c9691dfd..af13339382 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -83,8 +83,6 @@ int Meta_SetNick(char *szProto) BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
{
- char buffer[512], szId[40];
-
DBCachedContact *ccDest = CheckMeta(hMeta), *ccSub = currDb->m_cache->GetCachedContact(hSub);
if (ccDest == NULL || ccSub == NULL)
return FALSE;
@@ -110,7 +108,8 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) return FALSE;
}
- ccDest->nSubs++;
+ char szId[40];
+ _itoa(ccDest->nSubs++, szId, 10);
if (ccDest->nSubs >= MAX_CONTACTS) {
MessageBox(0, TranslateT("MetaContact is full"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -118,9 +117,8 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) }
// write the contact's protocol
- strcpy(buffer, "Protocol");
- strcat(buffer, _itoa(ccDest->nSubs - 1, szId, 10));
-
+ char buffer[512];
+ strcpy(buffer, "Protocol"); strcat(buffer, szId);
if (db_set_s(hMeta, META_PROTO, buffer, szProto)) {
MessageBox(0, TranslateT("Could not write contact protocol to MetaContact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -128,9 +126,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) }
// write the login
- strcpy(buffer, "Login");
- strcat(buffer, szId);
-
+ strcpy(buffer, "Login"); strcat(buffer, szId);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
MessageBox(0, TranslateT("Could not write unique ID of contact to MetaContact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -210,8 +206,8 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) db_set_ts(hMeta, "ContactPhoto", "File", AI.filename);
}
- // !!!!!!!!!!!!!!!!!!!!!!!!!
- // copyHistory(hSub, hMeta);
+ // merge sub's events to the meta-history
+ currDb->MetaMergeHistory(ccDest, ccSub);
// Ignore status if the option is on
if (options.suppress_status)
|