diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-29 18:23:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-29 18:23:21 +0300 |
commit | 81cd378b0a0ee5e26d58c085a3b10bd89a7244c2 (patch) | |
tree | 42ff87c45b6bffcdaca0d5db1ae55ce43aab377a | |
parent | 74608bcc6cb28e2d5e111dbc30c2009ea01bffc0 (diff) |
meta contacts registration should be delayed
-rw-r--r-- | src/mir_app/src/meta_main.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/mir_app/src/meta_main.cpp b/src/mir_app/src/meta_main.cpp index 5a276f03e8..62b3bf476d 100644 --- a/src/mir_app/src/meta_main.cpp +++ b/src/mir_app/src/meta_main.cpp @@ -54,6 +54,21 @@ void UnloadMetacontacts(void) // Initializes the services provided and the link to those needed
// Called when the plugin is loaded into Miranda
+
+static int RegisterMeta(WPARAM, LPARAM)
+{
+ PROTOCOLDESCRIPTOR pd = { 0 };
+ pd.cbSize = sizeof(pd);
+ pd.szName = META_FILTER;
+ pd.type = PROTOTYPE_FILTER;
+ Proto_RegisterModule(&pd);
+
+ pd.szName = META_PROTO;
+ pd.type = PROTOTYPE_VIRTUAL;
+ Proto_RegisterModule(&pd);
+ return 0;
+}
+
int LoadMetacontacts(void)
{
Icon_Register(g_hInst, LPGEN("MetaContacts"), iconList, _countof(iconList), "mc");
@@ -61,7 +76,7 @@ int LoadMetacontacts(void) db_set_resident(META_PROTO, "Status");
db_set_resident(META_PROTO, "IdleTS");
- //set all contacts to 'offline', and initialize subcontact counter for db consistency check
+ // set all contacts to 'offline', and initialize subcontact counter for db consistency check
for (MCONTACT hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) {
db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE);
db_set_dw(hContact, META_PROTO, "IdleTS", 0);
@@ -69,15 +84,7 @@ int LoadMetacontacts(void) Meta_ReadOptions();
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = META_FILTER;
- pd.type = PROTOTYPE_FILTER;
- Proto_RegisterModule(&pd);
-
- pd.szName = META_PROTO;
- pd.type = PROTOTYPE_VIRTUAL;
- Proto_RegisterModule(&pd);
+ HookEvent(ME_SYSTEM_MODULESLOADED, RegisterMeta);
// further db setup done in modules loaded (nick [protocol string required] & clist display name)
Meta_InitServices();
|