From 0e43801b96fb8d702294d8b0dce1b6eff37caeff Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 3 May 2015 09:32:12 +0000 Subject: SkypeWeb: Code optimization. git-svn-id: http://svn.miranda-ng.org/main/trunk@13391 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/capabilities.h | 4 ++-- protocols/SkypeWeb/src/requests/chatrooms.h | 3 +-- protocols/SkypeWeb/src/requests/messages.h | 3 +-- protocols/SkypeWeb/src/requests/status.h | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) (limited to 'protocols') diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h index 8bb8cebdf1..91c0aada93 100644 --- a/protocols/SkypeWeb/src/requests/capabilities.h +++ b/protocols/SkypeWeb/src/requests/capabilities.h @@ -29,7 +29,6 @@ public: << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken); - CMStringA data; int bitness = 32; char compName[MAX_COMPUTERNAME_LENGTH + 1]; DWORD size = SIZEOF(compName); @@ -38,7 +37,8 @@ public: #ifdef _WIN64 bitness = 64; #endif - data.AppendFormat("{\"id\":\"messagingService\",\"type\":\"EndpointPresenceDoc\",\"selfLink\":\"uri\",\"privateInfo\":{\"epname\":\"%s\"},\"publicInfo\":{\"capabilities\":\"Audio|Video\",\"typ\":125,\"skypeNameVersion\":\"Miranda NG Skype\",\"nodeInfo\":\"xx\",\"version\":\"%s x%d\"}}", compName, g_szMirVer, bitness); + + CMStringA data(::FORMAT, "{\"id\":\"messagingService\",\"type\":\"EndpointPresenceDoc\",\"selfLink\":\"uri\",\"privateInfo\":{\"epname\":\"%s\"},\"publicInfo\":{\"capabilities\":\"Audio|Video\",\"typ\":125,\"skypeNameVersion\":\"Miranda NG Skype\",\"nodeInfo\":\"xx\",\"version\":\"%s x%d\"}}", compName, g_szMirVer, bitness); Body << VALUE(data); diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 87531bed1a..588c0de37b 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -116,8 +116,7 @@ public: << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken); - CMStringA data; - data.AppendFormat("{\"role\":\"%s\"}", role); + CMStringA data(::FORMAT, "{\"role\":\"%s\"}", role); Body << VALUE(data); } }; diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h index 3aba9a4fc4..07fbfc6e61 100644 --- a/protocols/SkypeWeb/src/requests/messages.h +++ b/protocols/SkypeWeb/src/requests/messages.h @@ -106,8 +106,7 @@ public: << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken) << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); - CMStringA data; - data.AppendFormat("{\"consumptionhorizon\":\"%lld000;%lld000;%lld000\"}", msgTimestamp, time(NULL), msgId); + CMStringA data(::FORMAT, "{\"consumptionhorizon\":\"%lld000;%lld000;%lld000\"}", msgTimestamp, time(NULL), msgId); Body << VALUE(data); } }; diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h index b0047bb809..a980e431d1 100644 --- a/protocols/SkypeWeb/src/requests/status.h +++ b/protocols/SkypeWeb/src/requests/status.h @@ -29,8 +29,7 @@ public: << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken) << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); - CMStringA data; - data.AppendFormat("{\"status\":\"%s\"}", status); + CMStringA data(::FORMAT, "{\"status\":\"%s\"}", status); Body << VALUE(data); } }; -- cgit v1.2.3