diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-28 20:30:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-28 20:30:46 +0300 |
commit | 3e34adae711d9ddf79b4959143a696b6a403a522 (patch) | |
tree | aebc8cc38c164558e6da1d9c30971592045e1617 /protocols/Discord/src/proto.h | |
parent | e7a87b3c82204e048f23750a18b456e567a6f436 (diff) |
first version that logs in successfully
Diffstat (limited to 'protocols/Discord/src/proto.h')
-rw-r--r-- | protocols/Discord/src/proto.h | 20 |
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 ¶m) +{ + json.push_back(JSONNode(param.szName, param.iValue)); + return json; +} + +__forceinline JSONNode& operator<<(JSONNode &json, const CHAR_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, param.szValue)); + return json; +} + +__forceinline JSONNode& operator<<(JSONNode &json, const WCHAR_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue)))); + return json; +} + ///////////////////////////////////////////////////////////////////////////////////////// class CDiscordProto : public PROTO<CDiscordProto> |