diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-23 13:30:45 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-23 13:30:45 +0300 |
commit | 5bcd9e270692e1c3839d9905dbe28d30108fc1a3 (patch) | |
tree | 6d2e4430549d7b8dbc0d605e68b623c445d3d6d6 /protocols/ConnectionNotify/src/filter.cpp | |
parent | 48cdf8c723137754bd2dab9d4c0618afbd306d27 (diff) |
ConnectionNotify:
- fixes #2014 (traces of removed statuses);
- code cleaning
Diffstat (limited to 'protocols/ConnectionNotify/src/filter.cpp')
-rw-r--r-- | protocols/ConnectionNotify/src/filter.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/protocols/ConnectionNotify/src/filter.cpp b/protocols/ConnectionNotify/src/filter.cpp index e5cc01e98e..38c704ddaf 100644 --- a/protocols/ConnectionNotify/src/filter.cpp +++ b/protocols/ConnectionNotify/src/filter.cpp @@ -1,13 +1,7 @@ #include "stdafx.h" HWND filterAddDlg = nullptr; -extern struct CONNECTION *connExceptions; -extern HANDLE hFilterOptionsThread; -extern DWORD FilterOptionsThreadId; -extern struct CONNECTION *connCurrentEdit; -extern BOOL settingDefaultAction; -extern HANDLE hExceptionsMutex; -extern BOOL bOptionsOpen; + static unsigned __stdcall filterQueue(void *dummy); static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -25,7 +19,7 @@ static unsigned __stdcall filterQueue(void *) { if (msg.message == WM_ADD_FILTER) { - struct CONNECTION *conn = (struct CONNECTION *)msg.lParam; + CONNECTION *conn = (CONNECTION *)msg.lParam; filterAddDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FILTER_DIALOG), nullptr, ConnectionFilterEditProc, (LPARAM)conn); ShowWindow(filterAddDlg, SW_SHOW); @@ -45,7 +39,7 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM { case WM_INITDIALOG: { - struct CONNECTION *conn = (struct CONNECTION*)lParam; + CONNECTION *conn = (CONNECTION*)lParam; TranslateDialogDefault(hWnd); SetDlgItemText(hWnd, ID_TEXT_NAME, conn->PName); @@ -80,7 +74,7 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM { if (connCurrentEdit == nullptr) { - connCurrentEdit = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION)); + connCurrentEdit = (CONNECTION*)mir_alloc(sizeof(CONNECTION)); connCurrentEdit->next = connExceptions; connExceptions = connCurrentEdit; } @@ -129,13 +123,13 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM return FALSE; } -BOOL checkFilter(struct CONNECTION *head, struct CONNECTION *conn) +BOOL checkFilter(CONNECTION *head, CONNECTION *conn) { - for (struct CONNECTION *cur = head; cur != nullptr; cur = cur->next) + for (CONNECTION *cur = head; cur != nullptr; cur = cur->next) if (wildcmpw(conn->PName, cur->PName) && wildcmpw(conn->strIntIp, cur->strIntIp) && wildcmpw(conn->strExtIp, cur->strExtIp) && (cur->intIntPort == -1 || cur->intIntPort == conn->intIntPort) && (cur->intExtPort == -1 || cur->intExtPort == conn->intExtPort)) return cur->Pid; - return settingDefaultAction; + return g_plugin.iDefaultAction; } |