diff options
Diffstat (limited to 'protocols/Steam/src/Steam/friend_list.h')
-rw-r--r-- | protocols/Steam/src/Steam/friend_list.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/protocols/Steam/src/Steam/friend_list.h b/protocols/Steam/src/Steam/friend_list.h index d5c1c5dc34..94f25d4427 100644 --- a/protocols/Steam/src/Steam/friend_list.h +++ b/protocols/Steam/src/Steam/friend_list.h @@ -165,6 +165,64 @@ namespace SteamWebApi result->success = true;
}
};
+
+ class GetFriendListRequest : public HttpsGetRequest
+ {
+ public:
+ GetFriendListRequest(const char *token, const char *steamId) :
+ HttpsGetRequest(STEAM_API_URL "/ISteamUserOAuth/GetFriendList/v0001")
+ {
+ AddParameter("access_token", token);
+ AddParameter("steamid", steamId);
+ AddParameter("relationship=friend,ignoredfriend,requestrecipient");
+ }
+ };
+
+ class AddFriendRequest : public HttpsPostRequest
+ {
+ public:
+ AddFriendRequest(const char *token, const char *sessionId, const char *steamId, const char *who) :
+ HttpsPostRequest(STEAM_COM_URL "/actions/AddFriendAjax")
+ {
+ char login[MAX_PATH];
+ mir_snprintf(login, SIZEOF(login), "%s||oauth:%s", steamId, token);
+
+ char cookie[MAX_PATH];
+ mir_snprintf(cookie, SIZEOF(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+
+ char data[128];
+ mir_snprintf(data, SIZEOF(data),
+ "sessionID=%s&steamid=%s",
+ sessionId,
+ who);
+
+ SetData(data, strlen(data));
+ AddHeader("Cookie", cookie);
+ }
+ };
+
+ class RemoveFriendRequest : public HttpsPostRequest
+ {
+ public:
+ RemoveFriendRequest(const char *token, const char *sessionId, const char *steamId, const char *who) :
+ HttpsPostRequest(STEAM_COM_URL "/actions/RemoveFriendAjax")
+ {
+ char login[MAX_PATH];
+ mir_snprintf(login, SIZEOF(login), "%s||oauth:%s", steamId, token);
+
+ char cookie[MAX_PATH];
+ mir_snprintf(cookie, SIZEOF(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+
+ char data[128];
+ mir_snprintf(data, SIZEOF(data),
+ "sessionID=%s&steamid=%s",
+ sessionId,
+ who);
+
+ SetData(data, strlen(data));
+ AddHeader("Cookie", cookie);
+ }
+ };
}
#endif //_STEAM_FRIEND_LIST_H_
\ No newline at end of file |