summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-01 19:38:46 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-01 19:38:46 +0300
commit38853f0f252956930d6bd5bcd864fb76670d548b (patch)
treee89aee35e969228d5bd60ae099d20fa317ab6c5b /src/mir_core
parent1ad3f46ba54b0b2e57e4ab3ec66acf6da73cdde4 (diff)
four forgotten meta services removed
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/mc.cpp188
-rw-r--r--src/mir_core/src/mir_core.def13
-rw-r--r--src/mir_core/src/mir_core64.def13
-rw-r--r--src/mir_core/src/miranda.cpp2
4 files changed, 0 insertions, 216 deletions
diff --git a/src/mir_core/src/mc.cpp b/src/mir_core/src/mc.cpp
deleted file mode 100644
index ce38931fcb..0000000000
--- a/src/mir_core/src/mc.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-19 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-static HANDLE hEventDefaultChanged, hEventEnabled;
-static bool g_bEnabled;
-
-void InitMetaContacts()
-{
- hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED);
- hEventEnabled = CreateHookableEvent(ME_MC_ENABLED);
-}
-
-DBCachedContact* CheckMeta(MCONTACT hMeta)
-{
- if (!g_bEnabled)
- return nullptr;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hMeta);
- return (cc == nullptr || cc->nSubs == -1) ? nullptr : cc;
-}
-
-int Meta_GetContactNumber(DBCachedContact *cc, MCONTACT hContact)
-{
- if (g_bEnabled)
- for (int i = 0; i < cc->nSubs; i++)
- if (cc->pSubs[i] == hContact)
- return i;
-
- return -1;
-}
-
-MCONTACT Meta_GetContactHandle(DBCachedContact *cc, int contact_number)
-{
- if (contact_number >= cc->nSubs || contact_number < 0 || !g_bEnabled)
- return 0;
-
- return cc->pSubs[contact_number];
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// metacontacts
-
-MIR_CORE_DLL(BOOL) db_mc_isEnabled(void)
-{
- return g_bEnabled;
-}
-
-MIR_CORE_DLL(void) db_mc_enable(BOOL bEnabled)
-{
- g_bEnabled = bEnabled != 0;
-
- NotifyEventHooks(hEventEnabled, g_bEnabled, 0);
-}
-
-MIR_CORE_DLL(BOOL) db_mc_isMeta(MCONTACT hContact)
-{
- if (currDb == nullptr || !g_bEnabled) return FALSE;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- return (cc == nullptr) ? FALSE : cc->nSubs != -1;
-}
-
-MIR_CORE_DLL(BOOL) db_mc_isSub(MCONTACT hContact)
-{
- if (currDb == nullptr || !g_bEnabled) return FALSE;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- return (cc == nullptr) ? FALSE : cc->parentID != 0;
-}
-
-//returns a handle to the default contact, or null on failure
-MIR_CORE_DLL(MCONTACT) db_mc_getDefault(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 0;
-
- return (cc->nDefault != -1) ? Meta_GetContactHandle(cc, cc->nDefault) : 0;
-}
-
-//returns the default contact number, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getDefaultNum(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? -1 : cc->nDefault;
-}
-
-//returns the number of subcontacts, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getSubCount(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? -1 : cc->nSubs;
-}
-
-// returns parent hContact for a subcontact or NULL if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact)
-{
- if (currDb == nullptr) return NULL;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hSubContact);
- return (cc == nullptr) ? NULL : cc->parentID;
-}
-
-// returns parent hContact for a subcontact or hContact itself if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact)
-{
- if (currDb == nullptr) return hContact;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- if (cc == nullptr) return hContact;
-
- return (cc->IsSub()) ? cc->parentID : hContact;
-}
-
-// returns a subcontact with the given index
-MIR_CORE_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? 0 : Meta_GetContactHandle(cc, iNum);
-}
-
-//sets the default contact, using the subcontact's handle
-MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 1;
-
- int contact_number = Meta_GetContactNumber(cc, hSub);
- if (contact_number == -1)
- return 1;
-
- if (cc->nDefault != contact_number) {
- cc->nDefault = contact_number;
- 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, BOOL bWriteDb)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 1;
- if (iNum >= cc->nSubs || iNum < 0)
- return 1;
-
- if (cc->nDefault != iNum) {
- cc->nDefault = iNum;
- if (bWriteDb)
- currDb->MetaSetDefault(cc);
-
- NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
- }
- return 0;
-}
-
-extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam)
-{
- NotifyEventHooks(hEventDefaultChanged, wParam, lParam);
-}
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 2626bbf556..f5c92d7159 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -181,24 +181,11 @@ IsScreenSaverRunning @243
db_get_static @246
db_get_wstatic @247
db_get_static_utf @248
-db_mc_isMeta @249
-db_mc_isSub @250
-db_mc_getMeta @251
db_get_contact @252
-db_mc_getDefault @253
-db_mc_getDefaultNum @254
-db_mc_getSubCount @255
-db_mc_getSub @256
-db_mc_setDefault @257
-db_mc_setDefaultNum @258
mir_closeLog @259
-db_mc_enable @260
-db_mc_isEnabled @261
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
-db_mc_notifyDefChange @265
-db_mc_tryMeta @266
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 6a5981c157..87050de4e9 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -181,24 +181,11 @@ IsScreenSaverRunning @243
db_get_static @246
db_get_wstatic @247
db_get_static_utf @248
-db_mc_isMeta @249
-db_mc_isSub @250
-db_mc_getMeta @251
db_get_contact @252
-db_mc_getDefault @253
-db_mc_getDefaultNum @254
-db_mc_getSubCount @255
-db_mc_getSub @256
-db_mc_setDefault @257
-db_mc_setDefaultNum @258
mir_closeLog @259
-db_mc_enable @260
-db_mc_isEnabled @261
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
-db_mc_notifyDefChange @265
-db_mc_tryMeta @266
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index 73346d1eae..91ed71b53b 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -36,7 +36,6 @@ void UninitLogs();
void InitColourPicker();
void InitHyperlink();
-void InitMetaContacts();
void InitTimeZones();
void InitWinver();
@@ -114,7 +113,6 @@ static void LoadCoreModule(void)
InitHyperlink();
InitTimeZones();
InitialiseModularEngine();
- InitMetaContacts();
CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);