diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-03-15 17:27:35 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-03-15 17:27:35 +0300 |
| commit | bab3e26dcc716f25e3a016056feee4c98a518157 (patch) | |
| tree | 9e411a81fadd84a41fcf683187e626f220a979a3 /protocols/SkypeWeb/src/skype_login.cpp | |
| parent | f5af0de316fc2701511beb413ae37cb612af24e0 (diff) | |
code cleaning
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
| -rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 804160fc6a..06234effbe 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -147,7 +147,18 @@ void CSkypeProto::TryCreateEndpoint() m_impl.m_heartBeat.StartSafe(600 * 1000);
- PushRequest(new CreateEndpointRequest(this));
+ SendCreateEndpoint();
+}
+
+void CSkypeProto::SendCreateEndpoint()
+{
+ auto *pReq = new AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT, "/users/ME/endpoints", &CSkypeProto::OnEndpointCreated);
+ pReq->m_szParam = "{\"endpointFeatures\":\"Agent,Presence2015,MessageProperties,CustomUserProperties,Casts,ModernBots,AutoIdleForWebApi,secureThreads,notificationStream,InviteFree,SupportsReadReceipts,ued\"}";
+ pReq->AddHeader("Origin", "https://web.skype.com");
+ pReq->AddHeader("Referer", "https://web.skype.com/");
+ pReq->AddAuthentication(this);
+
+ PushRequest(pReq);
}
void CSkypeProto::OnEndpointCreated(MHttpResponse *response, AsyncHttpRequest*)
@@ -174,7 +185,7 @@ void CSkypeProto::OnEndpointCreated(MHttpResponse *response, AsyncHttpRequest*) int iEnd = szUrl.Find('/');
g_plugin.szDefaultServer = (iEnd != -1) ? szUrl.Left(iEnd) : szUrl;
}
- PushRequest(new CreateEndpointRequest(this));
+ SendCreateEndpoint();
return;
case 401: // unauthorized
|
