summaryrefslogtreecommitdiff
path: root/plugins/QuickContacts/src/quickcontacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-27 21:51:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-27 21:51:46 +0000
commit1fb0cd07fba1e8d6f9ac2ebe3b4f2e1c60acb81b (patch)
tree904c95b33e03e806aea734552281257768273a14 /plugins/QuickContacts/src/quickcontacts.cpp
parenta8e8aebfd4f53977873c72c2d828c2c1f505f10d (diff)
- metacontacts are always present;
- added META_PROTO constant for mc module name; - MS_MC_GETPROTOCOLNAME removed, because it always returns META_PROTO git-svn-id: http://svn.miranda-ng.org/main/trunk@8319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickContacts/src/quickcontacts.cpp')
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp37
1 files changed, 10 insertions, 27 deletions
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 0708700494..ab849acbc0 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -21,8 +21,7 @@ Boston, MA 02111-1307, USA.
#include "commons.h"
// Prototypes ///////////////////////////////////////////////////////////////////////////
-
-
+
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -37,7 +36,6 @@ PLUGININFOEX pluginInfo={
{0xf93ba59c, 0x4f48, 0x4f2e, {0x8a, 0x91, 0x77, 0xa2, 0x80, 0x15, 0x27, 0xa3}}
};
-
HINSTANCE hInst;
HIMAGELIST hIml;
int hLangpack = 0;
@@ -61,14 +59,10 @@ int hksAction = 0;
BOOL hasNewHotkeyModule = FALSE;
-char *metacontacts_proto = NULL;
-
#define IDC_ICO 12344
-
// Functions ////////////////////////////////////////////////////////////////////////////
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
@@ -202,8 +196,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.ptszName = LPGENT("Quick Contacts...");
mi.pszService = MS_QC_SHOW_DIALOG;
Menu_AddMainMenuItem(&mi);
-
- metacontacts_proto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
return 0;
}
@@ -343,8 +335,7 @@ void FreeContacts()
void LoadContacts(HWND hwndDlg, BOOL show_all)
{
- BOOL metacontactsEnabled = (metacontacts_proto != NULL
- && db_get_b(0, metacontacts_proto, "Enabled", 1));
+ BOOL metacontactsEnabled = db_get_b(0, META_PROTO, "Enabled", 1);
// Read last-sent-to contact from db and set handle as window-userdata
HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1);
@@ -366,12 +357,8 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
if ((!show_all && opts.hide_subcontacts) || opts.group_append)
hMeta = db_mc_getMeta(hContact);
}
- else
- {
- if (metacontacts_proto != NULL && strcmp(metacontacts_proto, pszProto) == 0)
- continue;
- }
-
+ else if (!strcmp(META_PROTO, pszProto))
+ continue;
if (!show_all)
{
@@ -398,17 +385,13 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
if (!opts.keep_subcontacts_from_offline)
continue;
- if (GetStatus(hMeta, metacontacts_proto) > ID_STATUS_OFFLINE)
- {
+ if (GetStatus(hMeta, META_PROTO) > ID_STATUS_OFFLINE)
+ continue;
+
+ char setting[128];
+ mir_snprintf(setting, sizeof(setting), "ShowOffline%s", META_PROTO);
+ if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
- }
- else
- {
- char setting[128];
- mir_snprintf(setting, sizeof(setting), "ShowOffline%s", metacontacts_proto);
- if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
- continue;
- }
}
}