diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-10-26 16:23:00 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-10-26 16:23:00 +0000 |
commit | fcbb1eaac90fc62c658a6e64c500dc41a1846f22 (patch) | |
tree | 32a1b768c10085f7468a8912dd20f42b67af9871 /plugins | |
parent | eec506b7571dbc05ea7fe511ccddda1c6d8942e6 (diff) |
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
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewXstatusNotify/src/common.h | 2 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/main.cpp | 73 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/xstatus.cpp | 4 |
3 files changed, 4 insertions, 75 deletions
diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h index a80d4ddab8..a779892e40 100644 --- a/plugins/NewXstatusNotify/src/common.h +++ b/plugins/NewXstatusNotify/src/common.h @@ -142,8 +142,6 @@ Cast them to (int) if you need them that way. #define MS_STATUSCHANGE_MENUCOMMAND "NewStatusNotify/EnableDisableMenuCommand"
-#define TMR_CONNECTIONTIMEOUT 10000
-
extern OPTIONS opt;
extern LIST<DBEVENT> eventList;
extern TEMPLATES templates;
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();
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 60d215cdf3..1dcf8e69ef 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -334,10 +334,10 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if (opt.PDisableForMusic && xsc->type == TYPE_ICQ_XSTATUS && xstatusID == XSTATUS_MUSIC)
bEnableSound = bEnablePopup = false;
- if (bEnablePopup && db_get_b(xsc->hContact, MODULE, "EnableXStatusNotify", 1) && db_get_b(0, MODULE, xsc->szProto, 1))
+ if (bEnablePopup && db_get_b(xsc->hContact, MODULE, "EnableXStatusNotify", 1))
ShowPopup(xsc);
- if (bEnableSound && db_get_b(xsc->hContact, MODULE, "EnableXStatusNotify", 1))
+ if (bEnableSound && db_get_b(xsc->hContact, MODULE, "EnableXStatusNotify", 1))
PlayXStatusSound(xsc->action);
BYTE enableLog = opt.EnableLogging;
|