From 0173277372e2962b8f5703a0ebad7892dda15e6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Mar 2014 21:50:49 +0000 Subject: end of the old MC API git-svn-id: http://svn.miranda-ng.org/main/trunk@8534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_menu.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/modules/metacontacts/meta_menu.cpp') diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index 8524c1cdf0..c71c452c81 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -131,12 +131,10 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI // if the default contact was equal to or greater than 'number', decrement it (and deal with ends) if (ccMeta->nDefault >= number) { - ccMeta->nDefault--; - if (ccMeta->nDefault < 0) - ccMeta->nDefault = 0; - - currDb->MetaSetDefault(ccMeta); - NotifyEventHooks(hEventDefaultChanged, ccMeta->contactID, Meta_GetContactHandle(ccMeta, ccMeta->nDefault)); + int iNumber = ccMeta->nDefault-1; + if (iNumber < 0) + iNumber = 0; + db_mc_setDefaultNum(ccMeta->contactID, iNumber); } ccMeta->nSubs--; @@ -221,11 +219,8 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) INT_PTR Meta_Default(WPARAM hSub, LPARAM wParam) { DBCachedContact *cc = currDb->m_cache->GetCachedContact(db_mc_getMeta(hSub)); - if (cc && cc->IsMeta()) { - cc->nDefault = Meta_GetContactNumber(cc, hSub); - currDb->MetaSetDefault(cc); - NotifyEventHooks(hEventDefaultChanged, cc->contactID, hSub); - } + if (cc && cc->IsMeta()) + db_mc_setDefault(cc->contactID, hSub); return 0; } -- cgit v1.2.3