diff options
-rw-r--r-- | protocols/SkypeWeb/src/requests/poll.h | 3 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/status.h | 7 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.cpp | 48 |
5 files changed, 3 insertions, 61 deletions
diff --git a/protocols/SkypeWeb/src/requests/poll.h b/protocols/SkypeWeb/src/requests/poll.h index 89aaef587b..f2d8ad17c8 100644 --- a/protocols/SkypeWeb/src/requests/poll.h +++ b/protocols/SkypeWeb/src/requests/poll.h @@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. struct PollRequest : public AsyncHttpRequest
{
PollRequest(CSkypeProto *ppro) :
- AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT, "/users/ME/endpoints/SELF/subscriptions/0/poll")
+ AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT)
{
+ m_szUrl.AppendFormat("/users/ME/endpoints/%s/subscriptions/0/poll", mir_urlEncode(ppro->m_szId).c_str());
timeout = 120000;
if (ppro->m_iPollingId != -1)
diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h index 166b2e7bbe..9aafe49678 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 316607151c..3f4e0226a2 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -186,8 +186,6 @@ void CSkypeProto::OnEndpointCreated(NETLIBHTTPREQUEST *response, AsyncHttpReques if (auto *hdr = Netlib_GetHeader(response, "Location"))
g_plugin.szDefaultServer = GetServerFromUrl(hdr);
- RefreshStatuses();
-
SendRequest(new CreateSubscriptionsRequest());
}
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 826fdf4860..5279bc6c4d 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -115,8 +115,7 @@ public: void OnSubscriptionsCreated(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
void OnCapabilitiesSended(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
void OnStatusChanged(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
- void OnReceiveStatus(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
-
+
// oauth
void OnOAuthStart(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
void OnOAuthAuthorize(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest);
@@ -300,7 +299,6 @@ private: void ProcessEndpointPresence(const JSONNode &node);
void ProcessConversationUpdate(const JSONNode &node);
- void RefreshStatuses(void);
void ReadHistoryRest(const char *url);
// utils
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 2a698af42b..d74b3876ea 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -24,52 +24,4 @@ void CSkypeProto::ProcessTimer() PushRequest(new GetContactListRequest(this, nullptr));
SendPresence(false);
-
- RefreshStatuses();
-}
-
-void CSkypeProto::OnReceiveStatus(NETLIBHTTPREQUEST *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();
- id.erase(0, 2);
- MCONTACT hContact = AddContact(id.c_str());
- 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", "8:" + id);
- nRecs++;
-
- if (nRecs >= 10) {
- PushRequest(pReq);
- pReq = nullptr;
- }
- }
-
- if (pReq)
- PushRequest(pReq);
}
|