From fcbb1eaac90fc62c658a6e64c500dc41a1846f22 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 26 Oct 2013 16:23:00 +0000 Subject: remove start timeout, coz now we have separate plugin StartupSilence git-svn-id: http://svn.miranda-ng.org/main/trunk@6634 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/src/main.cpp | 73 +---------------------------------- 1 file changed, 2 insertions(+), 71 deletions(-) (limited to 'plugins/NewXstatusNotify/src/main.cpp') diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 7d5822e8c9..8cd93caacf 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -30,7 +30,6 @@ HGENMENU hEnableDisableMenu; char szMetaModuleName[256] = {0}; STATUS StatusList[STATUS_COUNT]; -HWND SecretWnd; int hLangpack; PLUGININFOEX pluginInfoEx = { @@ -486,7 +485,7 @@ int ProcessStatus(DBCONTACTWRITESETTING *cws, HANDLE hContact) if (opt.IgnoreEmpty && (smi.compare == 2)) retem = FALSE; - else if (!db_get_b(0, MODULE, smi.proto, 1) && !opt.PopupOnConnect) + else if (!opt.PopupOnConnect) rettime = FALSE; char status[8]; @@ -782,13 +781,10 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) } else db_set_s(hContact, szProto, "LastOnline", szSubProto); - if (!db_get_b(0, MODULE, szSubProto, 1)) - return 0; - strcpy(szProto, szSubProto); } else { - if (myStatus == ID_STATUS_OFFLINE || !db_get_b(0, MODULE, szProto, 1)) + if (myStatus == ID_STATUS_OFFLINE) return 0; } @@ -991,52 +987,6 @@ void InitStatusList() StatusList[index].colorText = db_get_dw(NULL, MODULE, "40081tx", COLOR_TX_DEFAULT); } -VOID CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) -{ - if (uMsg == WM_TIMER) { - KillTimer(hwnd, idEvent); - - //We've received a timer message: enable the popups for a specified protocol. - char szProto[256]; - if ( GetAtomNameA((ATOM)idEvent, szProto, sizeof(szProto)) > 0) { - db_set_b(0, MODULE, szProto, 1); - DeleteAtom((ATOM)idEvent); - } - } -} - -int ProtoAck(WPARAM wParam,LPARAM lParam) -{ - ACKDATA *ack = (ACKDATA *)lParam; - - if (ack->type == ACKTYPE_STATUS) { - WORD newStatus = (WORD)ack->lParam; - WORD oldStatus = (WORD)ack->hProcess; - char *szProto = (char *)ack->szModule; - - if (oldStatus == newStatus) - return 0; - - if (newStatus == ID_STATUS_OFFLINE) { - //The protocol switched to offline. Disable the popups for this protocol - db_set_b(NULL, MODULE, szProto, 0); - } - else if (oldStatus < ID_STATUS_ONLINE && newStatus >= ID_STATUS_ONLINE) { - //The protocol changed from a disconnected status to a connected status. - //Enable the popups for this protocol. - int idTimer = AddAtomA(szProto); - if (idTimer) { - char TimerProtoName[256]; - mir_snprintf(TimerProtoName, sizeof(TimerProtoName), "ConnectionTimeout%s", szProto); - UINT ConnectTimer = db_get_dw(0, MODULE, TimerProtoName, db_get_dw(0, MODULE, "ConnectionTimeout", 10000)); - SetTimer(SecretWnd, idTimer, ConnectTimer, ConnectionTimerProc); - } - } - } - - return 0; -} - INT_PTR EnableDisableMenuCommand(WPARAM wParam, LPARAM lParam) { opt.TempDisabled = !opt.TempDisabled; @@ -1118,29 +1068,12 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent); HookEvent(ME_TTB_MODULELOADED, InitTopToolbar); - SecretWnd = CreateWindowEx(WS_EX_TOOLWINDOW,_T("static"),_T("ConnectionTimerWindow"),0, - CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,HWND_DESKTOP, - NULL,hInst,NULL); - - int count = 0; - PROTOACCOUNT **accounts = NULL; - CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts); - for (int i = 0; i < count; i++) - if (IsAccountEnabled(accounts[i])) - db_set_b(NULL, MODULE, accounts[i]->szModuleName, 0); - if (ServiceExists(MS_MC_GETPROTOCOLNAME)) strcpy(szMetaModuleName, (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0)); return 0; } -static int OnShutdown(WPARAM, LPARAM) -{ - DestroyWindow(SecretWnd); - return 0; -} - extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfoEx); @@ -1150,12 +1083,10 @@ extern "C" int __declspec(dllexport) Load(void) //We create this Hook which will notify everyone when a contact changes his status. hHookContactStatusChanged = CreateHookableEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED); HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); - HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); //We add the option page and the user info page (it's needed because options are loaded after plugins) HookEvent(ME_OPT_INITIALISE, OptionsInitialize); //This is needed for "NoSound"-like routines. HookEvent(ME_CLIST_STATUSMODECHANGE, StatusModeChanged); - HookEvent(ME_PROTO_ACK, ProtoAck); LoadOptions(); InitStatusList(); -- cgit v1.2.3