diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-29 19:52:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-29 19:52:35 +0300 |
commit | 509b46f98375153fad4157ceb18a8999fd6294f4 (patch) | |
tree | c0e6febf5d69b10abdee27bfacc45eb739085266 /src | |
parent | 5890b9a61ddfbd0fe84b7db2833bc4761211ffe8 (diff) |
major clutch removed with double service mode plugins launch
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/modules.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/newplugins.cpp | 16 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp index a4730df8a6..600683eaa4 100644 --- a/src/mir_app/src/modules.cpp +++ b/src/mir_app/src/modules.cpp @@ -101,16 +101,6 @@ int LoadDefaultModules(void) pfn();
}
- switch (SetServiceModePlugin(CmdLine_GetOption(L"svc"))) {
- case SERVICE_CONTINUE: // continue loading Miranda normally
- case SERVICE_ONLYDB: // load database and go to the message cycle
- break;
- case SERVICE_MONOPOLY: // unload database and go to the message cycle
- return 0;
- default: // smth went wrong, terminating
- return 1;
- }
-
// the database will select which db plugin to use, or fail if no profile is selected
if (LoadDatabaseModule()) return 1;
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 192b916ab7..9a7b38ff12 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -716,18 +716,16 @@ MIR_APP_DLL(int) SetServiceModePlugin(const wchar_t *wszPluginName) {
size_t cbLen = mir_wstrlen(wszPluginName);
if (cbLen == 0)
- return SERVICE_CONTINUE;
+ return 1;
for (auto &p : servicePlugins) {
if (!wcsnicmp(p->pluginname, wszPluginName, cbLen)) {
- int res = LaunchServicePlugin(p);
- if (res == SERVICE_ONLYDB) // load it later
- plugin_service = p;
- return res;
+ plugin_service = p;
+ return 0;
}
}
- return SERVICE_CONTINUE;
+ return 2;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -876,7 +874,11 @@ int LoadNewPluginsModuleInfos(void) enumPlugins(scanPluginsDir, 0, 0);
MuuidReplacement stdCrypt = { MIID_CRYPTO, L"stdcrypt", nullptr };
- return !LoadCorePlugin(stdCrypt);
+ if (!LoadCorePlugin(stdCrypt))
+ return 1;
+
+ SetServiceModePlugin(CmdLine_GetOption(L"svc"));
+ return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
|