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
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Chat {
#[prost(oneof="chat::Message", tags="3, 4, 5")]
pub message: ::core::option::Option<chat::Message>,
}
pub mod chat {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
#[prost(message, tag="3")]
ConversationRequest(super::ChatConversationRequest),
#[prost(message, tag="4")]
ConversationList(super::ChatConversationList),
#[prost(message, tag="5")]
Send(super::ChatMessageSend),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatConversationRequest {
#[prost(bytes="vec", tag="1")]
pub group_id: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag="2")]
pub last_index: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatConversationList {
#[prost(bytes="vec", tag="1")]
pub group_id: ::prost::alloc::vec::Vec<u8>,
#[prost(message, repeated, tag="2")]
pub message_list: ::prost::alloc::vec::Vec<ChatMessage>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatMessage {
#[prost(uint64, tag="1")]
pub index: u64,
#[prost(bytes="vec", tag="2")]
pub sender_id: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="3")]
pub message_id: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration="MessageStatus", tag="4")]
pub status: i32,
#[prost(message, repeated, tag="10")]
pub message_reception_confirmed: ::prost::alloc::vec::Vec<MessageReceptionConfirmed>,
#[prost(bytes="vec", tag="5")]
pub group_id: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag="6")]
pub sent_at: u64,
#[prost(uint64, tag="7")]
pub received_at: u64,
#[prost(bytes="vec", tag="8")]
pub content: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageReceptionConfirmed {
#[prost(bytes="vec", tag="1")]
pub user_id: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag="2")]
pub confirmed_at: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatContentMessage {
#[prost(oneof="chat_content_message::Message", tags="1, 2, 3")]
pub message: ::core::option::Option<chat_content_message::Message>,
}
pub mod chat_content_message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
#[prost(message, tag="1")]
ChatContent(super::ChatContent),
#[prost(message, tag="2")]
FileContent(super::FileContent),
#[prost(message, tag="3")]
GroupEvent(super::GroupEvent),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatContent {
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileContent {
#[prost(uint64, tag="1")]
pub file_id: u64,
#[prost(string, tag="2")]
pub file_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub file_extension: ::prost::alloc::string::String,
#[prost(uint32, tag="4")]
pub file_size: u32,
#[prost(string, tag="5")]
pub file_description: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupEvent {
#[prost(enumeration="GroupEventType", tag="1")]
pub event_type: i32,
#[prost(bytes="vec", tag="2")]
pub user_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatMessageSend {
#[prost(bytes="vec", tag="1")]
pub group_id: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag="2")]
pub content: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageStatus {
Sending = 0,
Sent = 1,
Confirmed = 2,
ConfirmedByAll = 3,
Receiving = 4,
Received = 5,
}
impl MessageStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
MessageStatus::Sending => "SENDING",
MessageStatus::Sent => "SENT",
MessageStatus::Confirmed => "CONFIRMED",
MessageStatus::ConfirmedByAll => "CONFIRMED_BY_ALL",
MessageStatus::Receiving => "RECEIVING",
MessageStatus::Received => "RECEIVED",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GroupEventType {
Default = 0,
Invited = 1,
Joined = 2,
Left = 3,
Removed = 4,
Closed = 5,
Created = 6,
InviteAccepted = 7,
}
impl GroupEventType {
pub fn as_str_name(&self) -> &'static str {
match self {
GroupEventType::Default => "DEFAULT",
GroupEventType::Invited => "INVITED",
GroupEventType::Joined => "JOINED",
GroupEventType::Left => "LEFT",
GroupEventType::Removed => "REMOVED",
GroupEventType::Closed => "CLOSED",
GroupEventType::Created => "CREATED",
GroupEventType::InviteAccepted => "INVITE_ACCEPTED",
}
}
}