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/modules/metacontacts/meta_utils.cpp | |
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/modules/metacontacts/meta_utils.cpp')
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
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)
|