summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-02 20:06:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-02 20:06:53 +0000
commit419d2a2454ee7d3eb7b394547351509ac801c8f6 (patch)
tree275f14934ccfd91ba8eae7b76346b8351e83a03f
parente27f1addc43bdfeb896081ecca5e0b52e9e6179a (diff)
MS_MC_DISABLEHIDDENGROUP - nasty clutch removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@8363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/delphi/m_metacontacts.inc11
-rw-r--r--include/m_metacontacts.h11
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp3
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp8
-rw-r--r--plugins/Clist_nicer/src/contact.cpp16
-rw-r--r--plugins/Clist_nicer/src/init.cpp2
-rw-r--r--plugins/Db3x_mmap/src/commonheaders.h1
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp26
8 files changed, 28 insertions, 50 deletions
diff --git a/include/delphi/m_metacontacts.inc b/include/delphi/m_metacontacts.inc
index 27912d1e4f..19d46d518a 100644
--- a/include/delphi/m_metacontacts.inc
+++ b/include/delphi/m_metacontacts.inc
@@ -138,17 +138,6 @@ const
}
MS_MC_REMOVEFROMMETA = 'MetaContacts/RemoveFromMetacontact';
-
- { wParam=(BOOL)disable
- lParam=0
- enable/disable the 'hidden group hack' - for clists that support subcontact
- hiding using 'IsSubcontact' setting. Should be called once in the clist
- 'onmodulesloaded' event handler (which, since it's loaded after the db, will
- be called before the metacontact onmodulesloaded handler where the subcontact
- hiding is usually done)
- }
- MS_MC_DISABLEHIDDENGROUP = 'MetaContacts/DisableHiddenGroup';
-
const
META_PROTO = 'MetaContacts';
diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h
index e652d09871..09921af590 100644
--- a/include/m_metacontacts.h
+++ b/include/m_metacontacts.h
@@ -102,7 +102,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// lParam= (DWORD)&contact_number or NULL
//
// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
-// or if none is in force, the value (DWORD)-1 will be copied
+// or if none is in force, the value INVALID_CONTACT_ID will be copied
// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
@@ -145,15 +145,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// remove a contact from a metacontact
#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
-
-// added 0.9.13.2 (6/10/05)
-// wParam=(BOOL)disable
-// lParam=0
-// enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
-// should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
-// before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
-#define MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
-
/////////////////////////////////////////////////////////////////////////////////////////
// binary interface to MC
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 <m_icolib.h>
#include <m_options.h>
#include <m_crypto.h>
+#include <m_metacontacts.h>
#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;
}