diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-16 20:27:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-16 20:27:26 +0300 |
commit | 3b576fbd2dc5359c9c2e3b79633f77ec97d307c9 (patch) | |
tree | e1ee7ed1f19ea84342e3f6b827d14be7f2c2a63c /protocols/SkypeWeb/src/requests | |
parent | a1c32d8bf1118b20e9a701e2b6ac0300cf704e55 (diff) |
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
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r-- | protocols/SkypeWeb/src/requests/contacts.h | 15 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/poll.h | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/status.h | 13 |
3 files changed, 17 insertions, 15 deletions
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<char> &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 <http://www.gnu.org/licenses/>. #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:
|