diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-05-27 14:54:57 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-05-27 14:55:01 +0300 |
| commit | f86bb06d4f7225f17677d9bd3af8f40f5a0b5b3d (patch) | |
| tree | 3dceef6426ac1e6b4949cdf6a88ebd2a936af1de /protocols | |
| parent | 208a98883b8823cac608113f0215d2a232350ada (diff) | |
Teams: old Skype search site removed
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/Teams/Teams.vcxproj | 1 | ||||
| -rw-r--r-- | protocols/Teams/Teams.vcxproj.filters | 3 | ||||
| -rw-r--r-- | protocols/Teams/src/requests/search.h | 33 | ||||
| -rw-r--r-- | protocols/Teams/src/stdafx.h | 2 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_http.cpp | 4 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_proto.h | 1 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_search.cpp | 16 |
7 files changed, 9 insertions, 51 deletions
diff --git a/protocols/Teams/Teams.vcxproj b/protocols/Teams/Teams.vcxproj index 2c3d994fe9..844f6d0ffe 100644 --- a/protocols/Teams/Teams.vcxproj +++ b/protocols/Teams/Teams.vcxproj @@ -49,7 +49,6 @@ <ClCompile Include="src\teams_trouter.cpp" /> <ClCompile Include="src\teams_utils.cpp" /> <ClInclude Include="src\requests\chatrooms.h" /> - <ClInclude Include="src\requests\search.h" /> <ClInclude Include="src\resource.h" /> <ClInclude Include="src\stdafx.h" /> <ClInclude Include="src\teams_menus.h" /> diff --git a/protocols/Teams/Teams.vcxproj.filters b/protocols/Teams/Teams.vcxproj.filters index 7f16e45a0d..98d55c54ab 100644 --- a/protocols/Teams/Teams.vcxproj.filters +++ b/protocols/Teams/Teams.vcxproj.filters @@ -84,9 +84,6 @@ <ClInclude Include="src\requests\chatrooms.h"> <Filter>Header Files\Requests</Filter> </ClInclude> - <ClInclude Include="src\requests\search.h"> - <Filter>Header Files\Requests</Filter> - </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="res\Resource.rc"> diff --git a/protocols/Teams/src/requests/search.h b/protocols/Teams/src/requests/search.h deleted file mode 100644 index 701b158339..0000000000 --- a/protocols/Teams/src/requests/search.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2015-25 Miranda NG team (https://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _SKYPE_REQUEST_SEARCH_H_ -#define _SKYPE_REQUEST_SEARCH_H_ - -struct GetSearchRequest : public AsyncHttpRequest -{ - GetSearchRequest(const char *string) : - AsyncHttpRequest(REQUEST_GET, HOST_GRAPH, "/v2.0/search/", &CTeamsProto::OnSearch) - { - this << CHAR_PARAM("requestid", Utils_GenerateUUID()) - << CHAR_PARAM("locale", "en-US") << CHAR_PARAM("searchstring", string); - - AddHeader("Accept", "application/json"); - } -}; - -#endif //_SKYPE_REQUEST_SEARCH_H_ diff --git a/protocols/Teams/src/stdafx.h b/protocols/Teams/src/stdafx.h index 25d04cc5e4..1e7c333898 100644 --- a/protocols/Teams/src/stdafx.h +++ b/protocols/Teams/src/stdafx.h @@ -69,7 +69,6 @@ enum SkypeHost HOST_CONTACTS, HOST_DEFAULT, HOST_DEFAULT_V2, - HOST_GRAPH, HOST_LOGIN, HOST_TEAMS, HOST_TEAMS_API, @@ -92,6 +91,5 @@ struct AsyncHttpRequest : public MTHttpRequest<CTeamsProto> #include "teams_proto.h" #include "requests/chatrooms.h" -#include "requests/search.h" #endif //_COMMON_H_ diff --git a/protocols/Teams/src/teams_http.cpp b/protocols/Teams/src/teams_http.cpp index 7c602e5cdc..50b73d6750 100644 --- a/protocols/Teams/src/teams_http.cpp +++ b/protocols/Teams/src/teams_http.cpp @@ -23,7 +23,6 @@ AsyncHttpRequest::AsyncHttpRequest(int type, SkypeHost host, LPCSTR url, MTHttpR switch (host) { case HOST_API: m_szUrl = "api.skype.com"; break; case HOST_CONTACTS: m_szUrl = "contacts.skype.com/contacts/v2"; break; - case HOST_GRAPH: m_szUrl = "skypegraph.skype.com"; break; case HOST_LOGIN: m_szUrl = "login.microsoftonline.com"; break; case HOST_TEAMS: m_szUrl = TEAMS_BASE_HOST; break; case HOST_TEAMS_API: m_szUrl = TEAMS_BASE_HOST "/api/mt/beta"; break; @@ -130,7 +129,7 @@ MHttpResponse* CTeamsProto::DoSend(AsyncHttpRequest *pReq) case HOST_TEAMS: case HOST_TEAMS_API: if (!pReq->FindHeader("Authorization")) - pReq->AddHeader("Authorization", "Bearer " + m_szAccessToken); + pReq->AddHeader("Authorization", "Bearer " + m_szAccessToken); if (m_szSkypeToken) pReq->AddHeader("X-Skypetoken", m_szSkypeToken); pReq->AddHeader("Accept", "application/json"); @@ -145,7 +144,6 @@ MHttpResponse* CTeamsProto::DoSend(AsyncHttpRequest *pReq) break; case HOST_API: - case HOST_GRAPH: if (m_szSkypeToken) pReq->AddHeader("X-Skypetoken", m_szSkypeToken); pReq->AddHeader("Accept", "application/json"); diff --git a/protocols/Teams/src/teams_proto.h b/protocols/Teams/src/teams_proto.h index 22e6e061b9..3cbf00003a 100644 --- a/protocols/Teams/src/teams_proto.h +++ b/protocols/Teams/src/teams_proto.h @@ -152,7 +152,6 @@ public: void UninitPopups(); // search - void __cdecl SearchBasicThread(void *param); ////////////////////////////////////////////////////////////////////////////////////// // settings diff --git a/protocols/Teams/src/teams_search.cpp b/protocols/Teams/src/teams_search.cpp index 5cceab3c3f..c175cbea37 100644 --- a/protocols/Teams/src/teams_search.cpp +++ b/protocols/Teams/src/teams_search.cpp @@ -19,15 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. HANDLE CTeamsProto::SearchBasic(const wchar_t *id) { - ForkThread(&CTeamsProto::SearchBasicThread, (void *)id); - return (HANDLE)1; -} - -void CTeamsProto::SearchBasicThread(void *id) -{ debugLogA("CTeamsProto::OnSearchBasicThread"); - if (IsOnline()) - PushRequest(new GetSearchRequest(T2Utf((wchar_t *)id))); + if (!IsOnline()) + return 0; + + auto *pReq = new AsyncHttpRequest(REQUEST_POST, HOST_TEAMS_API, "/users/searchV2?includeDLs=true&includeBots=true&enableGuest=true&source=newChat&skypeTeamsInfo=true", &CTeamsProto::OnSearch); + pReq->m_szParam = mir_urlEncode(T2Utf(id)); + PushRequest(pReq); + + return (HANDLE)1; } void CTeamsProto::OnSearch(MHttpResponse *response, AsyncHttpRequest*) |
