From 419d2a2454ee7d3eb7b394547351509ac801c8f6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Mar 2014 20:06:53 +0000 Subject: MS_MC_DISABLEHIDDENGROUP - nasty clutch removed git-svn-id: http://svn.miranda-ng.org/main/trunk@8363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clc.cpp | 3 --- plugins/Clist_modern/src/modern_clui.cpp | 8 ++------ plugins/Clist_nicer/src/contact.cpp | 16 ++-------------- plugins/Clist_nicer/src/init.cpp | 2 -- plugins/Db3x_mmap/src/commonheaders.h | 1 + plugins/Db3x_mmap/src/dbcontacts.cpp | 26 ++++++++++++++++++++++---- 6 files changed, 27 insertions(+), 29 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 971e0f1266..3bf7f46083 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -82,9 +82,6 @@ static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam) hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Modern contact list"), MIRANDA_PATHT _T("\\") _T(DEFAULT_SKIN_FOLDER)); FoldersGetCustomPathT(hSkinFolder, SkinsFolder, SIZEOF(SkinsFolder), _T(DEFAULT_SKIN_FOLDER)); - if (ServiceExists(MS_MC_DISABLEHIDDENGROUP)) - CallService(MS_MC_DISABLEHIDDENGROUP, TRUE, 0); - // Get icons TCHAR szMyPath[MAX_PATH]; GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath)); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 63f8bb1ad0..a8a1a8c884 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -140,7 +140,7 @@ static TCHAR tszFolderPath[MAX_PATH]; void CLUI::cliOnCreateClc(void) { - _ASSERT( m_pCLUI ); + _ASSERT(m_pCLUI); m_pCLUI->CreateCluiFrames(); } @@ -148,18 +148,14 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM wParam, LPARAM lParam) { setlocale(LC_ALL, ""); //fix for case insensitive comparing - if ( ServiceExists(MS_MC_DISABLEHIDDENGROUP)) - CallService(MS_MC_DISABLEHIDDENGROUP, TRUE, 0); - cliCluiProtocolStatusChanged(0, 0); SleepEx(0, TRUE); g_flag_bOnModulesLoadedCalled = TRUE; - ///pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE); + SendMessage(pcli->hwndContactList,UM_CREATECLC, 0, 0); //$$$ InitSkinHotKeys(); g_CluiData.bSTATE = STATE_NORMAL; ske_RedrawCompleteWindow(); - return 0; } diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 5272152279..e3a7f4ca47 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -122,14 +122,11 @@ void MF_UpdateThread(LPVOID) CloseHandle(hEvent); } -static BOOL mc_hgh_removed = FALSE; - void LoadContactTree(void) { int i, status, hideOffline; - BOOL mc_disablehgh = ServiceExists(MS_MC_DISABLEHIDDENGROUP); - DBVARIANT dbv = {0}; - BYTE bMsgFrequency = cfg::getByte("CList", "fhistdata", 0); + BYTE bMsgFrequency = cfg::getByte("CList", "fhistdata", 0); + DBVARIANT dbv = { 0 }; CallService(MS_CLUI_LISTBEGINREBUILD, 0, 0); for (i = 1; ; i++) { @@ -145,20 +142,11 @@ void LoadContactTree(void) if ((!hideOffline || status != ID_STATUS_OFFLINE) && !CLVM_GetContactHiddenStatus(hContact, NULL, NULL)) pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(GetContactProto(hContact), status, hContact, NULL), 1); - if (mc_disablehgh && !mc_hgh_removed) { - if ( !db_get(hContact, "CList", "Group", &dbv)) { - if ( !strcmp(dbv.pszVal, "MetaContacts Hidden Group")) - db_unset(hContact, "CList", "Group"); - mir_free(dbv.pszVal); - } - } - // build initial data for message frequency if ( !bMsgFrequency) MF_CalcFrequency(hContact, 100, 0); } cfg::writeByte("CList", "fhistdata", 1); - mc_hgh_removed = TRUE; CallService(MS_CLUI_LISTENDREBUILD, 0, 0); } diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 73c7381fa6..2188683315 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -174,8 +174,6 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) GetSystemTime(&cfg::dat.st); SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft); - if (ServiceExists(MS_MC_DISABLEHIDDENGROUP)) - CallService(MS_MC_DISABLEHIDDENGROUP, 1, 0); cfg::dat.bMetaEnabled = cfg::getByte(META_PROTO, "Enabled", 1); cfg::dat.bAvatarServiceAvail = ServiceExists(MS_AV_GETAVATARBITMAP) ? TRUE : FALSE; diff --git a/plugins/Db3x_mmap/src/commonheaders.h b/plugins/Db3x_mmap/src/commonheaders.h index 3467c6ddee..6fac634f56 100644 --- a/plugins/Db3x_mmap/src/commonheaders.h +++ b/plugins/Db3x_mmap/src/commonheaders.h @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include "database.h" #include "dbintf.h" diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index e0dfbf6108..1337341bde 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -247,17 +247,35 @@ void CDb3Mmap::FillContacts() CheckProto(cc, ""); DBVARIANT dbv; dbv.type = DBVT_DWORD; - cc->nSubs = (0 != GetContactSetting(dwContactID, "MetaContacts", "NumContacts", &dbv)) ? -1 : dbv.dVal; + cc->nSubs = (0 != GetContactSetting(dwContactID, META_PROTO, "NumContacts", &dbv)) ? -1 : dbv.dVal; if (cc->nSubs != -1) { cc->pSubs = (MCONTACT*)mir_alloc(cc->nSubs*sizeof(MCONTACT)); for (int i = 0; i < cc->nSubs; i++) { char setting[100]; mir_snprintf(setting, sizeof(setting), "Handle%d", i); - cc->pSubs[i] = (0 != GetContactSetting(dwContactID, "MetaContacts", setting, &dbv)) ? NULL : dbv.dVal; + cc->pSubs[i] = (0 != GetContactSetting(dwContactID, META_PROTO, setting, &dbv)) ? NULL : dbv.dVal; + } + } + cc->activeID = (0 != GetContactSetting(dwContactID, META_PROTO, "Default", &dbv)) ? NULL : dbv.dVal; + cc->parentID = (0 != GetContactSetting(dwContactID, META_PROTO, "Handle", &dbv)) ? NULL : dbv.dVal; + + // whether we need conversion or not + if (!GetContactSetting(dwContactID, META_PROTO, "MetaID", &dbv)) { + // we don't need it anymore + DeleteContactSetting(dwContactID, META_PROTO, "MetaID"); + + for (int i = 0; i < cc->nSubs; i++) { + // store contact id instead of the old mc number + DBCONTACTWRITESETTING dbws = { META_PROTO, "ParentMeta" }; + dbws.value.type = DBVT_DWORD; + dbws.value.dVal = dwContactID; + WriteContactSetting(cc->pSubs[i], &dbws); + + // wipe out old data from subcontacts + DeleteContactSetting(cc->pSubs[i], META_PROTO, "ContactNumber"); + DeleteContactSetting(cc->pSubs[i], META_PROTO, "MetaLink"); } } - cc->activeID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Default", &dbv)) ? NULL : dbv.dVal; - cc->parentID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Handle", &dbv)) ? NULL : dbv.dVal; dwOffset = p->ofsNext; } -- cgit v1.2.3