From 9b11e2e558cdee65b42ffd56601488ec3cbce534 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 10 Sep 2014 20:29:30 +0000 Subject: Tox: - reworked searching - updated tox core - updated icon git-svn-id: http://svn.miranda-ng.org/main/trunk@10423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.cpp | 66 ----------------------------------------- 1 file changed, 66 deletions(-) (limited to 'protocols/Tox/src/tox_proto.cpp') diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 83163a9670..4bd9ca4efc 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -157,72 +157,6 @@ HANDLE __cdecl CToxProto::ChangeInfo(int iInfoType, void* pInfoData) { return 0; int __cdecl CToxProto::GetInfo(MCONTACT hContact, int infoType) { return 0; } -HANDLE __cdecl CToxProto::SearchBasic(const PROTOCHAR* id) { return 0; } - -HANDLE __cdecl CToxProto::SearchByEmail(const PROTOCHAR* email) { return 0; } - -HANDLE __cdecl CToxProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName) { return 0; } - -HWND __cdecl CToxProto::SearchAdvanced(HWND owner) -{ - if (!IsOnline()) - { - // we cannot add someone to friend list while tox is offline - return NULL; - } - - std::smatch match; - std::regex regex("^\\s*([A-Fa-f0-9]{76})\\s*$"); - - char text[TOX_FRIEND_ADDRESS_SIZE * 2 + 1]; - GetDlgItemTextA(owner, IDC_SEARCH, text, SIZEOF(text)); - - const std::string query = text; - if (std::regex_search(query, match, regex)) - { - std::string address = match[1]; - std::vector id = HexStringToData(address); - MCONTACT hContact = FindContact(id); - if (!hContact) - { - PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.flags = PSR_TCHAR; - psr.id = mir_a2t(query.c_str()); - - ADDCONTACTSTRUCT acs = { HANDLE_SEARCHRESULT }; - acs.szProto = m_szModuleName; - acs.psr = &psr; - - CallService(MS_ADDCONTACT_SHOW, (WPARAM)owner, (LPARAM)&acs); - } - else - { - ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact); - } - ForkThread(&CToxProto::SearchByIdAsync, mir_strdup(query.c_str())); - } - else - { - regex = "^\\s*([^ @/:;()\"']+)(@toxme.se)?\\s*$"; - if (std::regex_search(query, match, regex)) - { - std::string query = match[1]; - ForkThread(&CToxProto::SearchByNameAsync, mir_strdup(query.c_str())); - } - } - return (HWND)1; -} - -HWND __cdecl CToxProto::CreateExtendedSearchUI(HWND owner) -{ - return CreateDialogParam( - g_hInstance, - MAKEINTRESOURCE(IDD_SEARCH), - owner, - SearchDlgProc, - (LPARAM)this); -} - int __cdecl CToxProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT*) { return 0; } int __cdecl CToxProto::RecvFile(MCONTACT hContact, PROTOFILEEVENT *pre) -- cgit v1.2.3