From 1b410d8cefa448ee1809bab7c52a3d34383e5df7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Aug 2020 13:19:04 +0300 Subject: Steam: minor code cleaning --- protocols/Steam/src/api/friend.h | 4 ++-- protocols/Steam/src/api/history.h | 4 ++-- protocols/Steam/src/api/poll.h | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'protocols/Steam/src/api') diff --git a/protocols/Steam/src/api/friend.h b/protocols/Steam/src/api/friend.h index 0997d42b0f..2f088a7e40 100644 --- a/protocols/Steam/src/api/friend.h +++ b/protocols/Steam/src/api/friend.h @@ -4,11 +4,11 @@ class GetUserSummariesRequest : public HttpRequest { public: - GetUserSummariesRequest(const char *token, const char *steamIds) : + GetUserSummariesRequest(CSteamProto *ppro, const char *steamIds) : HttpRequest(HttpGet, STEAM_API_URL "/ISteamUserOAuth/GetUserSummaries/v0002") { Uri - << CHAR_PARAM("access_token", token) + << CHAR_PARAM("access_token", ppro->getMStringA("TokenSecret")) << CHAR_PARAM("steamids", steamIds); } diff --git a/protocols/Steam/src/api/history.h b/protocols/Steam/src/api/history.h index 0eaea38fb1..decbea87f0 100644 --- a/protocols/Steam/src/api/history.h +++ b/protocols/Steam/src/api/history.h @@ -4,10 +4,10 @@ class GetConversationsRequest : public HttpRequest { public: - GetConversationsRequest(const char *token) : + GetConversationsRequest(CSteamProto *ppro) : HttpRequest(HttpGet, STEAM_API_URL "/IFriendMessagesService/GetActiveMessageSessions/v0001") { - Uri << CHAR_PARAM("access_token", token); + Uri << CHAR_PARAM("access_token", ppro->getMStringA("TokenSecret")); } //{ diff --git a/protocols/Steam/src/api/poll.h b/protocols/Steam/src/api/poll.h index 6336b212e9..0487411c6c 100644 --- a/protocols/Steam/src/api/poll.h +++ b/protocols/Steam/src/api/poll.h @@ -4,8 +4,8 @@ class PollRequest : public HttpRequest { public: - PollRequest(const char *token, const char *umqId, UINT32 messageId, int idleSeconds) : - HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v0001") + PollRequest(CSteamProto *ppro) : + HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v1") { timeout = (STEAM_API_TIMEOUT + 5) * 1000; // flags |= NLHRF_PERSISTENT; @@ -13,10 +13,10 @@ public: Headers << CHAR_PARAM("Connection", "keep-alive"); Content = new FormUrlEncodedContent(this) - << CHAR_PARAM("access_token", token) - << CHAR_PARAM("umqid", umqId) - << INT64_PARAM("message", messageId) - << INT_PARAM("secidletime", idleSeconds) + << CHAR_PARAM("access_token", ppro->getMStringA("TokenSecret")) + << CHAR_PARAM("umqid", ppro->getMStringA("UMQID")) + << INT64_PARAM("message", ppro->getDword("MessageID")) + << INT_PARAM("secidletime", ppro->IdleSeconds()) << INT_PARAM("sectimeout", STEAM_API_TIMEOUT); } -- cgit v1.2.3