From 184155c8aaf1dd0c8bcd498dfd7ba9c512433e73 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 22 Apr 2014 11:51:27 +0000 Subject: db_mc_setDefault/db_mc_setDefaultNum got a flag to update database or not git-svn-id: http://svn.miranda-ng.org/main/trunk@9047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/mc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/mc.cpp b/src/mir_core/mc.cpp index 90e967fa98..00431a0875 100644 --- a/src/mir_core/mc.cpp +++ b/src/mir_core/mc.cpp @@ -129,7 +129,7 @@ MIR_CORE_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum) } //sets the default contact, using the subcontact's handle -MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub) +MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb) { DBCachedContact *cc = CheckMeta(hMetaContact); if (cc == NULL) @@ -140,14 +140,15 @@ MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub) return 1; cc->nDefault = contact_number; - currDb->MetaSetDefault(cc); + if (bWriteDb) + currDb->MetaSetDefault(cc); NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub); return 0; } //sets the default contact, using the subcontact's number -MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum) +MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb) { DBCachedContact *cc = CheckMeta(hMetaContact); if (cc == NULL) @@ -156,7 +157,8 @@ MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum) return 1; cc->nDefault = iNum; - currDb->MetaSetDefault(cc); + if (bWriteDb) + currDb->MetaSetDefault(cc); NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum)); return 0; -- cgit v1.2.3