diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-20 21:23:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-20 21:23:22 +0300 |
commit | dd6ac172c4f814fa4b5ace6caca80d00d7e01ac8 (patch) | |
tree | 805abd69e64f8e1f268e6415689de8742cac2215 /protocols/Tox/src | |
parent | 79d99837e0fefa32d695dba7e2a13b8a42f39da2 (diff) |
bunch of useless threads replaced with a call of ProtoBroadcastAsync
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 1 | ||||
-rw-r--r-- | protocols/Tox/src/tox_search.cpp | 10 |
2 files changed, 2 insertions, 9 deletions
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 62ecf196e8..8b357a0dce 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -167,7 +167,6 @@ private: // contacts search
void __cdecl SearchByNameAsync(void *arg);
- void __cdecl SearchFailedAsync(void *arg);
static INT_PTR CALLBACK SearchDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index 83e4b883cb..b36b66e80c 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -49,12 +49,6 @@ void CToxProto::SearchByNameAsync(void *arg) mir_free(arg);
}
-void CToxProto::SearchFailedAsync(void*)
-{
- Thread_SetName(MODULE ": SearchFailedThread");
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HWND)1, 0);
-}
-
INT_PTR CToxProto::SearchDlgProc(HWND hwnd, UINT uMsg, WPARAM, LPARAM lParam)
{
CToxProto *proto = (CToxProto*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -96,14 +90,14 @@ HWND CToxProto::OnSearchAdvanced(HWND owner) psr.id.a = mir_strdup(query.c_str());
Contact_AddBySearch(m_szModuleName, &psr, owner);
- ForkThread(&CToxProto::SearchFailedAsync, nullptr);
+ ProtoBroadcastAsync(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HANDLE)1);
}
else {
regex = "^\\s*(([^ @/:;()\"']+)(@[A-Za-z]+.[A-Za-z]{2,6})?)\\s*$";
if (std::regex_search(query, match, regex))
ForkThread(&CToxProto::SearchByNameAsync, mir_strdup(query.c_str()));
else
- ForkThread(&CToxProto::SearchFailedAsync, nullptr);
+ ProtoBroadcastAsync(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HANDLE)1);
}
return (HWND)1;
}
|