From 3b576fbd2dc5359c9c2e3b79633f77ec97d307c9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 16 Apr 2020 20:27:26 +0300 Subject: SkypeWeb: - fixes #2306 (SkypeWeb: sometimes plugin does not show contacts statuses); - obsoleted GetContactsInfoRequest removed (as well as its handler CSkypeProto::LoadContactsInfo); - major optimization for polling process; - ugly & crashy map Contacts removed; - old crappy timer code removed and replaced with CTimer; - version bump --- protocols/SkypeWeb/src/requests/contacts.h | 15 --------------- protocols/SkypeWeb/src/requests/poll.h | 4 ++++ protocols/SkypeWeb/src/requests/status.h | 13 +++++++++++++ 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'protocols/SkypeWeb/src/requests') diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index 880e9c33d1..430b51aa2f 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -35,21 +35,6 @@ public: } }; -class GetContactsInfoRequest : public HttpRequest -{ -public: - GetContactsInfoRequest(CSkypeProto *ppro, const LIST &skypenames, const char *skypename = "self") : - HttpRequest(REQUEST_POST, FORMAT, "api.skype.com/users/%s/contacts/profiles", skypename) - { - Headers - << CHAR_VALUE("X-Skypetoken", ppro->m_szApiToken) - << CHAR_VALUE("Accept", "application/json"); - - for (auto &it : skypenames) - Body << CHAR_VALUE("contacts[]", it); - } -}; - class GetContactsAuthRequest : public HttpRequest { public: diff --git a/protocols/SkypeWeb/src/requests/poll.h b/protocols/SkypeWeb/src/requests/poll.h index f0078c618a..7293c07067 100644 --- a/protocols/SkypeWeb/src/requests/poll.h +++ b/protocols/SkypeWeb/src/requests/poll.h @@ -25,6 +25,10 @@ public: HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/endpoints/SELF/subscriptions/0/poll", ppro->m_szServer) { timeout = 120000; + + if (ppro->m_iPollingId != -1) + Url << INT_VALUE("ackId", ppro->m_iPollingId); + Headers << CHAR_VALUE("Referer", "https://web.skype.com/main") << CHAR_VALUE("Content-Type", "application/x-www-form-urlencoded") diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h index 1000ebbccf..459b30471f 100644 --- a/protocols/SkypeWeb/src/requests/status.h +++ b/protocols/SkypeWeb/src/requests/status.h @@ -18,6 +18,19 @@ along with this program. If not, see . #ifndef _SKYPE_REQUEST_STATUS_H_ #define _SKYPE_REQUEST_STATUS_H_ +class GetStatusRequest : public HttpRequest +{ +public: + GetStatusRequest(CSkypeProto *ppro) : + HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/contacts/ALL/presenceDocs/messagingService", ppro->m_szServer) + { + Headers + << CHAR_VALUE("Accept", "application/json, text/javascript") + << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", ppro->m_szToken.get()) + << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); + } +}; + class SetStatusRequest : public HttpRequest { public: -- cgit v1.2.3