summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src/proto.h')
-rw-r--r--protocols/Discord/src/proto.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index 5a381e52f9..7f4c1e4c52 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -5,7 +5,7 @@ typedef void (CDiscordProto::*HttpCallback)(NETLIBHTTPREQUEST*, struct AsyncHttp
struct AsyncHttpRequest : public NETLIBHTTPREQUEST, public MZeroedObject
{
AsyncHttpRequest();
- AsyncHttpRequest(CDiscordProto*, int iRequestType, LPCSTR szUrl, HttpCallback pFunc);
+ AsyncHttpRequest(CDiscordProto*, int iRequestType, LPCSTR szUrl, HttpCallback pFunc, JSONNode *pNode = NULL);
~AsyncHttpRequest();
void AddHeader(LPCSTR, LPCSTR);
@@ -51,6 +51,24 @@ struct WCHAR_PARAM : public PARAM
};
AsyncHttpRequest* operator<<(AsyncHttpRequest*, const WCHAR_PARAM&);
+__forceinline JSONNode& operator<<(JSONNode &json, const INT_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, param.iValue));
+ return json;
+}
+
+__forceinline JSONNode& operator<<(JSONNode &json, const CHAR_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, param.szValue));
+ return json;
+}
+
+__forceinline JSONNode& operator<<(JSONNode &json, const WCHAR_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue))));
+ return json;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
class CDiscordProto : public PROTO<CDiscordProto>