diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-09 21:50:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-09 21:50:49 +0000 |
commit | 0173277372e2962b8f5703a0ebad7892dda15e6c (patch) | |
tree | d1ff4bbecbc00f8d77b9a71c71579de53246303c /src/modules/metacontacts/meta_menu.cpp | |
parent | 61dfdec9a37cc06a6ee624aaaf03df41f821c1c6 (diff) |
end of the old MC API
git-svn-id: http://svn.miranda-ng.org/main/trunk@8534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/metacontacts/meta_menu.cpp')
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
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;
}
|