summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-08-08 12:42:22 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-08-08 12:42:22 +0300
commit63026a4ad1411dc49590f7f3f2c2a459cae82f63 (patch)
treec97489aa51a2741ddaf84d5de61a2291c49e5d9b
parent92fba480e36acb126781ad27510aaaecf084b9d1 (diff)
code cleaning
-rw-r--r--protocols/SkypeWeb/SkypeWeb.vcxproj1
-rw-r--r--protocols/SkypeWeb/SkypeWeb.vcxproj.filters3
-rw-r--r--protocols/SkypeWeb/src/requests/status.h7
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp11
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h3
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp73
6 files changed, 9 insertions, 89 deletions
diff --git a/protocols/SkypeWeb/SkypeWeb.vcxproj b/protocols/SkypeWeb/SkypeWeb.vcxproj
index 7215a586d5..9c7bd4801a 100644
--- a/protocols/SkypeWeb/SkypeWeb.vcxproj
+++ b/protocols/SkypeWeb/SkypeWeb.vcxproj
@@ -46,7 +46,6 @@
<ClCompile Include="src\skype_profile.cpp" />
<ClCompile Include="src\skype_proto.cpp" />
<ClCompile Include="src\skype_search.cpp" />
- <ClCompile Include="src\skype_trouter.cpp" />
<ClCompile Include="src\skype_utils.cpp" />
<ClCompile Include="src\stdafx.cxx">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/protocols/SkypeWeb/SkypeWeb.vcxproj.filters b/protocols/SkypeWeb/SkypeWeb.vcxproj.filters
index c1d3dbee23..95284e95df 100644
--- a/protocols/SkypeWeb/SkypeWeb.vcxproj.filters
+++ b/protocols/SkypeWeb/SkypeWeb.vcxproj.filters
@@ -67,9 +67,6 @@
<ClCompile Include="src\skype_search.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\skype_trouter.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\skype_utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h
index 95f3a99cdb..777465935a 100644
--- a/protocols/SkypeWeb/src/requests/status.h
+++ b/protocols/SkypeWeb/src/requests/status.h
@@ -18,13 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _SKYPE_REQUEST_STATUS_H_
#define _SKYPE_REQUEST_STATUS_H_
-struct GetStatusRequest : public AsyncHttpRequest
-{
- GetStatusRequest() :
- AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, "/users/ME/contacts/ALL/presenceDocs/messagingService", &CSkypeProto::OnReceiveStatus)
- {}
-};
-
struct SetStatusRequest : public AsyncHttpRequest
{
SetStatusRequest(const char *status) :
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index 6c802bd420..83ad944745 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -41,6 +41,15 @@ void CSkypeProto::CheckConvert()
}
}
+void CSkypeProto::ProcessTimer()
+{
+ if (!IsOnline())
+ return;
+
+ PushRequest(new GetContactListRequest());
+ SendPresence();
+}
+
void CSkypeProto::Login()
{
CheckConvert();
@@ -209,8 +218,6 @@ void CSkypeProto::OnEndpointCreated(MHttpResponse *response, AsyncHttpRequest*)
}
}
- RefreshStatuses();
-
PushRequest(new CreateSubscriptionsRequest());
}
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 79c23ebc33..32c634f3c6 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -135,7 +135,6 @@ public:
void OnLoginOAuth(MHttpResponse *response, AsyncHttpRequest *pRequest);
void OnSubscriptionsCreated(MHttpResponse *response, AsyncHttpRequest *pRequest);
void OnCapabilitiesSended(MHttpResponse *response, AsyncHttpRequest *pRequest);
- void OnReceiveStatus(MHttpResponse *response, AsyncHttpRequest *pRequest);
void OnStatusChanged(MHttpResponse *response, AsyncHttpRequest *pRequest);
void OnEndpointCreated(MHttpResponse *response, AsyncHttpRequest *pRequest);
@@ -294,8 +293,6 @@ private:
void ProcessEndpointPresence(const JSONNode &node);
void ProcessConversationUpdate(const JSONNode &node);
- void RefreshStatuses(void);
-
// utils
template <typename T>
__inline static void FreeList(const LIST<T> &lst)
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
deleted file mode 100644
index bcabf8a0f3..0000000000
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-Copyright (c) 2015-24 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/>.
-*/
-
-#include "stdafx.h"
-
-void CSkypeProto::ProcessTimer()
-{
- if (!IsOnline())
- return;
-
- PushRequest(new GetContactListRequest());
- SendPresence();
-}
-
-void CSkypeProto::OnReceiveStatus(MHttpResponse *response, AsyncHttpRequest*)
-{
- JsonReply reply(response);
- if (reply.error())
- return;
-
- auto &root = reply.data();
- for (auto &it : root["Responses"]) {
- std::string id = it["Contact"].as_string();
-
- MCONTACT hContact = AddContact(id.c_str(), nullptr);
- if (hContact) {
- int status = SkypeToMirandaStatus(it["Payload"]["status"].as_string().c_str());
- setWord(hContact, "Status", status);
- }
- }
-}
-
-void CSkypeProto::RefreshStatuses(void)
-{
- int nRecs = 0;
- GetStatusRequest *pReq = nullptr;
-
- for (auto &it : AccContacts()) {
- CMStringA id(getId(it));
- if (id.IsEmpty())
- continue;
-
- if (pReq == nullptr) {
- pReq = new GetStatusRequest();
- nRecs = 0;
- }
-
- pReq << CHAR_PARAM("cMri", id);
- nRecs++;
-
- if (nRecs >= 10) {
- PushRequest(pReq);
- pReq = nullptr;
- }
- }
-
- if (pReq)
- PushRequest(pReq);
-}