From 9ac20243efe27f58501c59060a4f22c37104c0e3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 15:29:24 +0000 Subject: - PROTOCOLDESCRIPTOR_V3_SIZE to identify an ANSI plugin; - absence of fnInitFunc to identify a protocol without instances; - whole bunch of ansi crutches discarded git-svn-id: http://svn.miranda-ng.org/main/trunk@13937 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'plugins/ConnectionNotify/src') diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 32eaf32610..387df80cda 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -864,33 +864,30 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) hInst = hinstDLL; return TRUE; } + extern "C" int __declspec(dllexport) Load(void) { - char service[100] = { "" }; - - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; - #ifdef _DEBUG _OutputDebugString(_T("Entering Load dll")); #endif mir_getLP(&pluginInfo); - //hCurrentEditMutex=CreateMutex(NULL,FALSE,_T("CurrentEditMutex")); hExceptionsMutex = CreateMutex(NULL, FALSE, _T("ExceptionsMutex")); LoadSettings(); connExceptions = LoadSettingsConnections(); - //create protocol - //memset(&pd, 0, sizeof(pd)); - //pd.cbSize=sizeof(pd); + + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = PLUGINNAME; pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); - //set all contacts to offline + //set all contacts to offline for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME)) db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE); + char service[100] = { "" }; mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETCAPS); CreateServiceFunction(service, GetCaps); mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETNAME); @@ -902,7 +899,6 @@ extern "C" int __declspec(dllexport) Load(void) mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETSTATUS); CreateServiceFunction(service, GetStatus); - SkinAddNewSoundEx(PLUGINNAME_NEWSOUND, PLUGINNAME, LPGEN("New Connection Notification")); hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call assert(hOptInit); -- cgit v1.2.3