-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct_message.bt
165 lines (157 loc) · 3.74 KB
/
struct_message.bt
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
#ifndef __STRUCT_MESSAGE__
#define __STRUCT_MESSAGE__
#include "struct_messageaction.bt"
#include "struct_messagefwdheader.bt"
#include "struct_messagemedia.bt"
#include "struct_replymarkup.bt"
#include "struct_messageentity.bt"
typedef struct _messageEmpty { // 0x83e5de54
int id;
};
typedef struct _messageService { // 0x9e19a1f6
int : 1;
int b_out : 1; // 1
int : 1;
int b_reply_to_msg_id : 1; // 3
int b_mentioned : 1; // 4
int b_media_unread : 1; // 5
int : 2;
int b_from_id : 1; // 8
int : 4;
int b_silent : 1; // 13
int b_post : 1; // 14
int : 4;
int b_legacy : 1; // 19
int : 12;
int id;
if (b_from_id)
int from_id;
Peer to_id;
if (b_reply_to_msg_id)
int reply_to_msg_id;
int date;
MessageAction action;
};
// layer 104
typedef struct _messageOld { // 0x44f9b43d
int : 2;
int b_fwd_from : 1; // 2
int b_reply_to_msg_id : 1; // 3
int : 2;
int b_reply_markup : 1; // 6
int b_entities : 1; // 7
int b_from_id : 1; // 8
int b_media : 1; // 9
int b_views : 1; // 10
int b_via_bot_id : 1; // 11
int : 3;
int b_edit_date : 1; // 15
int b_post_author : 1; // 16
int b_grouped_id : 1; // 17
int : 14;
int id;
if (b_from_id)
int from_id;
Peer to_id;
if (b_fwd_from)
MessageFwdHeader fwd_from;
if (b_via_bot_id)
int via_bot_id;
if (b_reply_to_msg_id)
int reply_to_msg_id;
int date;
TLString message;
if (b_media)
MessageMedia media;
if (b_reply_markup)
ReplyMarkup reply_markup;
if (b_entities)
VectorMessageEntity entities;
if (b_views)
int views;
if (b_edit_date)
int edit_date;
if (b_post_author)
TLString post_author;
if (b_grouped_id)
int64 grouped_id;
};
typedef struct _message { // 0x452c0e65
int : 1;
int b_out : 1; // 1
int b_fwd_from : 1; // 2
int b_reply_to_msg_id : 1; // 3
int b_mentioned : 1; // 4
int b_media_unread : 1; // 5
int b_reply_markup : 1; // 6
int b_entities : 1; // 7
int b_from_id : 1; // 8
int b_media : 1; // 9
int b_views : 1; // 10
int b_via_bot_id : 1; // 11
int : 1;
int b_silent : 1; // 13
int b_post : 1; // 14
int b_edit_date : 1; // 15
int b_post_author : 1; // 16
int b_grouped_id : 1; // 17
int b_from_scheduled : 1; // 18
int b_legacy : 1; // 19
int : 1;
int b_edit_hide : 1; // 21
int b_restriction_reason : 1; // 22
int : 9;
int id;
if (b_from_id)
int from_id;
Peer to_id;
if (b_fwd_from)
MessageFwdHeader fwd_from;
if (b_via_bot_id)
int via_bot_id;
if (b_reply_to_msg_id)
int reply_to_msg_id;
int date;
TLString message;
if (b_media)
MessageMedia media;
if (b_reply_markup)
ReplyMarkup reply_markup;
if (b_entities)
VectorMessageEntity entities;
if (b_views)
int views;
if (b_edit_date)
int edit_date;
if (b_post_author)
TLString post_author;
if (b_grouped_id)
int64 grouped_id;
if (b_restriction_reason)
VectorRestrictionReason restriction_reason;
};
typedef struct Message {
int id;
if (id == -2082087340)
_messageEmpty val;
else if (id == 1157215293)
_messageOld val;
else if (id == -1642487306)
_messageService val;
else if (id == 1160515173)
_message val;
else {
Printf("Invalid id %d for Message\n", id);
Exit(1);
}
};
typedef struct VectorMessage {
int id;
if (id != 0x1CB5C415) {
Printf("Invalid id %d for VectorMessage\n", id);
Exit(1);
}
int size;
Message items[size] <optimize=false>;
};
#endif