summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api/message.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-12-28 21:21:10 +0300
committeraunsane <aunsane@gmail.com>2017-12-28 21:21:28 +0300
commit0156ed41dceeef48f070adf67f14d4ba4c4f6d61 (patch)
treed0e1dca4c2c9c3c056ae9cb69dde10ea59316481 /protocols/Steam/src/api/message.h
parentf0075f2b956969f29acd3bc9289c8a5f78faddad (diff)
Steam: refactoring
- reworking http requests - added ability to get game name by appid - another attempt to fix #633 - minor refactoring
Diffstat (limited to 'protocols/Steam/src/api/message.h')
-rw-r--r--protocols/Steam/src/api/message.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/protocols/Steam/src/api/message.h b/protocols/Steam/src/api/message.h
index 77adb4a240..eee4c43b28 100644
--- a/protocols/Steam/src/api/message.h
+++ b/protocols/Steam/src/api/message.h
@@ -5,17 +5,14 @@ class SendMessageRequest : public HttpRequest
{
public:
SendMessageRequest(const char *token, const char *umqId, const char *steamId, const char *text) :
- HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001")
+ HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001")
{
- CMStringA data;
- data.AppendFormat("access_token=%s&umqid=%s&steamid_dst=%s&type=saytext&text=%s",
- token,
- umqId,
- steamId,
- ptrA(mir_urlEncode(text)));
-
- SetData(data, data.GetLength());
- AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+ Content = new FormUrlEncodedContent(this)
+ << CHAR_PARAM("access_token", token)
+ << CHAR_PARAM("umqid", umqId)
+ << CHAR_PARAM("steamid_dst", steamId)
+ << CHAR_PARAM("type", "saytext")
+ << CHAR_PARAM("text", text);
}
};
@@ -23,16 +20,13 @@ class SendTypingRequest : public HttpRequest
{
public:
SendTypingRequest(const char *token, const char *umqId, const char *steamId) :
- HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001")
+ HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001")
{
- CMStringA data;
- data.AppendFormat("access_token=%s&umqid=%s&steamid_dst=%s&type=typing",
- token,
- umqId,
- steamId);
-
- SetData(data, data.GetLength());
- AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+ Content = new FormUrlEncodedContent(this)
+ << CHAR_PARAM("access_token", token)
+ << CHAR_PARAM("umqid", umqId)
+ << CHAR_PARAM("steamid_dst", steamId)
+ << CHAR_PARAM("type", "typing");
}
};