-
Notifications
You must be signed in to change notification settings - Fork 2
/
mtschema.h
250 lines (233 loc) · 12 KB
/
mtschema.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#ifndef MTSCHEMA_H
#define MTSCHEMA_H
//Generated code.
#include "tgstream.h"
namespace MTType {
enum Types
{
Unknown = 0,
Vector = 481674261, //0x1cb5c415
ResPQ = 85337187, //0x05162463
PQInnerDataDc = -1443537003, //0xa9f55f95
PQInnerDataTempDc = 1459478408, //0x56fddf88
ServerDHParamsOk = -790100132, //0xd0e8075c
ServerDHInnerData = -1249309254, //0xb5890dba
ClientDHInnerData = 1715713620, //0x6643b654
DhGenOk = 1003222836, //0x3bcbf734
DhGenRetry = 1188831161, //0x46dc1fb9
DhGenFail = -1499615742, //0xa69dae02
BindAuthKeyInner = 1973679973, //0x75a3f765
RpcResult = -212046591, //0xf35c6d01
RpcError = 558156313, //0x2144ca19
RpcAnswerUnknown = 1579864942, //0x5e2ad36e
RpcAnswerDroppedRunning = -847714938, //0xcd78e586
RpcAnswerDropped = -1539647305, //0xa43ad8b7
FutureSalt = 155834844, //0x0949d9dc
FutureSalts = -1370486635, //0xae500895
Pong = 880243653, //0x347773c5
DestroySessionOk = -501201412, //0xe22045fc
DestroySessionNone = 1658015945, //0x62d350c9
NewSessionCreated = -1631450872, //0x9ec20908
MsgContainer = 1945237724, //0x73f1f8dc
Message = 1538843921, //0x5bb8e511
MsgCopy = -530561358, //0xe06046b2
GzipPacked = 812830625, //0x3072cfa1
MsgsAck = 1658238041, //0x62d6b459
BadMsgNotification = -1477445615, //0xa7eff811
BadServerSalt = -307542917, //0xedab447b
MsgResendReq = 2105940488, //0x7d861a08
MsgsStateReq = -630588590, //0xda69fb52
MsgsStateInfo = 81704317, //0x04deb57d
MsgsAllInfo = -1933520591, //0x8cc0d131
MsgDetailedInfo = 661470918, //0x276d3ec6
MsgNewDetailedInfo = -2137147681, //0x809db6df
DestroyAuthKeyOk = -161422892, //0xf660e1d4
DestroyAuthKeyNone = 178201177, //0x0a9f2259
DestroyAuthKeyFail = -368010477, //0xea109b13
ReqPqMultiMethod = -1099002127, //0xbe7e8ef1
ReqDHParamsMethod = -686627650, //0xd712e4be
SetClientDHParamsMethod = -184262881, //0xf5045f1f
RpcDropAnswerMethod = 1491380032, //0x58e4a740
GetFutureSaltsMethod = -1188971260, //0xb921bd04
PingMethod = 2059302892, //0x7abe77ec
PingDelayDisconnectMethod = -213746804, //0xf3427b8c
DestroySessionMethod = -414113498, //0xe7512126
HttpWaitMethod = -1835453025, //0x9299359f
DestroyAuthKeyMethod = -784117408, //0xd1435160
};
}
template <READ_METHOD R, WRITE_METHOD W> void readMTRpcResult(TelegramStream &stream, QVariant &i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void writeMTRpcResult(TelegramStream &stream, QVariant i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void readMTMessageContainer(TelegramStream &stream, QVariant &i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessageContainer(TelegramStream &stream, QVariant i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void readMTMessage(TelegramStream &stream, QVariant &i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessage(TelegramStream &stream, QVariant i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void readMTMessageCopy(TelegramStream &stream, QVariant &i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessageCopy(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTVector(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTVector(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTResPQ(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTResPQ(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTPQInnerData(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTPQInnerData(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTServerDHParams(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTServerDHParams(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTServerDHInnerData(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTServerDHInnerData(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTClientDHInnerData(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTClientDHInnerData(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTSetClientDHParamsAnswer(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTSetClientDHParamsAnswer(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTBindAuthKeyInner(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTBindAuthKeyInner(TelegramStream &stream, QVariant i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void readMTRpcResult(TelegramStream &stream, QVariant &i, void* callback)
{
TelegramObject obj;
QVariant conId;
readInt32(stream, conId, callback);
switch (conId.toInt()) {
case -212046591:
obj["_"] = conId.toInt();
readInt64(stream, obj["req_msg_id"], callback);
(*R)(stream, obj["result"], callback);
break;
}
i = obj;
}
template <READ_METHOD R, WRITE_METHOD W> void writeMTRpcResult(TelegramStream &stream, QVariant i, void* callback)
{
TelegramObject obj = i.toMap();
switch (obj["_"].toInt()) {
case -212046591:
writeInt32(stream, obj["_"], callback);
writeInt64(stream, obj["req_msg_id"], callback);
(*W)(stream, obj["result"], callback);
break;
}
}
void readMTRpcError(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTRpcError(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTRpcDropAnswer(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTRpcDropAnswer(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTFutureSalt(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTFutureSalt(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTFutureSalts(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTFutureSalts(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTPong(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTPong(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTDestroySessionRes(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTDestroySessionRes(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTNewSession(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTNewSession(TelegramStream &stream, QVariant i, void* callback = 0);
template <READ_METHOD R, WRITE_METHOD W> void readMTMessageContainer(TelegramStream &stream, QVariant &i, void* callback)
{
TelegramObject obj;
QVariant conId;
readInt32(stream, conId, callback);
switch (conId.toInt()) {
case 1945237724:
obj["_"] = conId.toInt();
readVector(stream, obj["messages"], (void*) &readMTMessage<R, W>);
break;
}
i = obj;
}
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessageContainer(TelegramStream &stream, QVariant i, void* callback)
{
TelegramObject obj = i.toMap();
switch (obj["_"].toInt()) {
case 1945237724:
writeInt32(stream, obj["_"], callback);
writeVector(stream, obj["messages"], (void*) &writeMTMessage<R, W>);
break;
}
}
template <READ_METHOD R, WRITE_METHOD W> void readMTMessage(TelegramStream &stream, QVariant &i, void* callback)
{
TelegramObject obj;
QVariant conId;
switch (conId.toInt()) {
case 1538843921:
obj["_"] = conId.toInt();
readInt64(stream, obj["msg_id"], callback);
readInt32(stream, obj["seqno"], callback);
readInt32(stream, obj["bytes"], callback);
(*R)(stream, obj["body"], callback);
break;
}
i = obj;
}
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessage(TelegramStream &stream, QVariant i, void* callback)
{
TelegramObject obj = i.toMap();
switch (obj["_"].toInt()) {
case 1538843921:
writeInt64(stream, obj["msg_id"], callback);
writeInt32(stream, obj["seqno"], callback);
writeInt32(stream, obj["bytes"], callback);
(*W)(stream, obj["body"], callback);
break;
}
}
template <READ_METHOD R, WRITE_METHOD W> void readMTMessageCopy(TelegramStream &stream, QVariant &i, void* callback)
{
TelegramObject obj;
QVariant conId;
readInt32(stream, conId, callback);
switch (conId.toInt()) {
case -530561358:
obj["_"] = conId.toInt();
readMTMessage<R, W>(stream, obj["orig_message"], callback);
break;
}
i = obj;
}
template <READ_METHOD R, WRITE_METHOD W> void writeMTMessageCopy(TelegramStream &stream, QVariant i, void* callback)
{
TelegramObject obj = i.toMap();
switch (obj["_"].toInt()) {
case -530561358:
writeInt32(stream, obj["_"], callback);
writeMTMessage<R, W>(stream, obj["orig_message"], callback);
break;
}
}
void readMTObject(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTObject(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgsAck(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgsAck(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTBadMsgNotification(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTBadMsgNotification(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgResendReq(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgResendReq(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgsStateReq(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgsStateReq(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgsStateInfo(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgsStateInfo(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgsAllInfo(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgsAllInfo(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMsgDetailedInfo(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMsgDetailedInfo(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTDestroyAuthKeyRes(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTDestroyAuthKeyRes(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodReqPqMulti(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodReqPqMulti(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodReqDHParams(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodReqDHParams(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodSetClientDHParams(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodSetClientDHParams(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodRpcDropAnswer(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodRpcDropAnswer(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodGetFutureSalts(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodGetFutureSalts(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodPing(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodPing(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodPingDelayDisconnect(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodPingDelayDisconnect(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodDestroySession(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodDestroySession(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodHttpWait(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodHttpWait(TelegramStream &stream, QVariant i, void* callback = 0);
void readMTMethodDestroyAuthKey(TelegramStream &stream, QVariant &i, void* callback = 0);
void writeMTMethodDestroyAuthKey(TelegramStream &stream, QVariant i, void* callback = 0);
#endif //MTSCHEMA_H