summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-03 20:26:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-03 20:26:55 +0300
commit1158dcf1d252d95c3fecf34c3d09bb21c20b812e (patch)
tree360acfc73f5ba9fca1e352f8d252e9e48b791526 /protocols/SkypeWeb/src
parent59d3e0a8aa91452de46df3ae448f3cb499c5dce1 (diff)
Skype: no need to use formatting where one can use string concatenation
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/requests/capabilities.h4
-rw-r--r--protocols/SkypeWeb/src/requests/contacts.h6
-rw-r--r--protocols/SkypeWeb/src/requests/endpoint.h3
-rw-r--r--protocols/SkypeWeb/src/requests/messages.h4
-rw-r--r--protocols/SkypeWeb/src/requests/poll.h3
-rw-r--r--protocols/SkypeWeb/src/skype_search.cpp2
6 files changed, 7 insertions, 15 deletions
diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h
index c733bf633f..e6620a5464 100644
--- a/protocols/SkypeWeb/src/requests/capabilities.h
+++ b/protocols/SkypeWeb/src/requests/capabilities.h
@@ -21,10 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct SendCapabilitiesRequest : public AsyncHttpRequest
{
SendCapabilitiesRequest(const char *hostname, CSkypeProto *ppro) :
- AsyncHttpRequest(REQUEST_PUT, HOST_DEFAULT, 0, &CSkypeProto::OnCapabilitiesSended)
+ AsyncHttpRequest(REQUEST_PUT, HOST_DEFAULT, "/users/ME/endpoints/" + mir_urlEncode(ppro->m_szId) + "/presenceDocs/messagingService", &CSkypeProto::OnCapabilitiesSended)
{
- m_szUrl.AppendFormat("/users/ME/endpoints/%s/presenceDocs/messagingService", mir_urlEncode(ppro->m_szId).c_str());
-
JSONNode privateInfo; privateInfo.set_name("privateInfo");
privateInfo << CHAR_PARAM("epname", hostname);
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h
index ea22bb49a0..ec0c3a4141 100644
--- a/protocols/SkypeWeb/src/requests/contacts.h
+++ b/protocols/SkypeWeb/src/requests/contacts.h
@@ -50,7 +50,7 @@ struct AddContactRequest : public AsyncHttpRequest
AddHeader("Accept", "application/json");
JSONNode node;
- node << CHAR_PARAM("mri", CMStringA(::FORMAT, "8:", who).GetString()) << CHAR_PARAM("greeting", greeting);
+ node << CHAR_PARAM("mri", CMStringA(::FORMAT, "8:%s", who)) << CHAR_PARAM("greeting", greeting);
m_szParam = node.write().c_str();
}
};
@@ -58,10 +58,8 @@ struct AddContactRequest : public AsyncHttpRequest
struct DeleteContactRequest : public AsyncHttpRequest
{
DeleteContactRequest(const char *who) :
- AsyncHttpRequest(REQUEST_DELETE, HOST_CONTACTS)
+ AsyncHttpRequest(REQUEST_DELETE, HOST_CONTACTS, "/contacts/v2/users/SELF/contacts/8%3A" + mir_urlEncode(who))
{
- m_szUrl.AppendFormat("/contacts/v2/users/SELF/contacts/8:%s", who);
-
AddHeader("Accept", "application/json");
}
};
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h
index 135ca178dc..bcb4929d76 100644
--- a/protocols/SkypeWeb/src/requests/endpoint.h
+++ b/protocols/SkypeWeb/src/requests/endpoint.h
@@ -32,9 +32,8 @@ struct CreateEndpointRequest : public AsyncHttpRequest
struct DeleteEndpointRequest : public AsyncHttpRequest
{
DeleteEndpointRequest(CSkypeProto *ppro) :
- AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT)
+ AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT, "/users/ME/endpoints/" + mir_urlEncode(ppro->m_szId))
{
- m_szUrl.AppendFormat("/users/ME/endpoints/%s", mir_urlEncode(ppro->m_szId).c_str());
}
};
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h
index 817d459046..da5c37662e 100644
--- a/protocols/SkypeWeb/src/requests/messages.h
+++ b/protocols/SkypeWeb/src/requests/messages.h
@@ -58,10 +58,8 @@ struct SendActionRequest : public AsyncHttpRequest
struct SendTypingRequest : public AsyncHttpRequest
{
SendTypingRequest(const char *username, int iState) :
- AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT)
+ AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT, "/users/ME/conversations/8:" + mir_urlEncode(username) + "/messages")
{
- m_szUrl.AppendFormat("/users/ME/conversations/8:%s/messages", mir_urlEncode(username).c_str());
-
const char *state = (iState == PROTOTYPE_SELFTYPING_ON) ? "Control/Typing" : "Control/ClearTyping";
JSONNode node;
diff --git a/protocols/SkypeWeb/src/requests/poll.h b/protocols/SkypeWeb/src/requests/poll.h
index f2d8ad17c8..87c9e6b977 100644
--- a/protocols/SkypeWeb/src/requests/poll.h
+++ b/protocols/SkypeWeb/src/requests/poll.h
@@ -21,9 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct PollRequest : public AsyncHttpRequest
{
PollRequest(CSkypeProto *ppro) :
- AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT)
+ AsyncHttpRequest(REQUEST_POST, HOST_DEFAULT, "/users/ME/endpoints/" + mir_urlEncode(ppro->m_szId) + "/subscriptions/0/poll")
{
- 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/skype_search.cpp b/protocols/SkypeWeb/src/skype_search.cpp
index 7ec04060ec..845882f78c 100644
--- a/protocols/SkypeWeb/src/skype_search.cpp
+++ b/protocols/SkypeWeb/src/skype_search.cpp
@@ -27,7 +27,7 @@ void CSkypeProto::SearchBasicThread(void *id)
{
debugLogA("CSkypeProto::OnSearchBasicThread");
if (IsOnline())
- SendRequest(new GetSearchRequest(mir_urlEncode(T2Utf((wchar_t *)id))));
+ SendRequest(new GetSearchRequest(T2Utf((wchar_t *)id)));
}
void CSkypeProto::OnSearch(NETLIBHTTPREQUEST *response, AsyncHttpRequest*)