Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / communicate / src / main / proto / signal_groups.proto

signal_groups.proto309 lines · 8.1 KiBRaw
1/*
2 * Copyright 2020 Signal Messenger, LLC
3 * SPDX-License-Identifier: AGPL-3.0-only
4 */
5
6syntax = "proto3";
7
8package signal;
9
10option java_package = "org.signal.storageservice.storage.protos.groups";
11option java_outer_classname = "GroupProtos";
12option java_multiple_files = true;
13
14message AvatarUploadAttributes {
15 string key = 1;
16 string credential = 2;
17 string acl = 3;
18 string algorithm = 4;
19 string date = 5;
20 string policy = 6;
21 string signature = 7;
22}
23
24// Stored data
25
26message Member {
27 enum Role {
28 UNKNOWN = 0;
29 DEFAULT = 1;
30 ADMINISTRATOR = 2;
31 }
32
33 bytes userId = 1;
34 Role role = 2;
35 bytes profileKey = 3;
36 bytes presentation = 4;
37 uint32 joinedAtVersion = 5;
38 bytes labelEmoji = 6; // decrypts to a UTF-8 string
39 bytes labelString = 7; // decrypts to a UTF-8 string
40}
41
42message MemberPendingProfileKey {
43 Member member = 1;
44 bytes addedByUserId = 2;
45 uint64 timestamp = 3; // ms since epoch
46}
47
48message MemberPendingAdminApproval {
49 bytes userId = 1;
50 bytes profileKey = 2;
51 bytes presentation = 3;
52 uint64 timestamp = 4; // ms since epoch
53}
54
55message MemberBanned {
56 bytes userId = 1;
57 uint64 timestamp = 2; // ms since epoch
58}
59
60message AccessControl {
61 enum AccessRequired {
62 UNKNOWN = 0;
63 ANY = 1;
64 MEMBER = 2;
65 ADMINISTRATOR = 3;
66 UNSATISFIABLE = 4;
67 }
68
69 AccessRequired attributes = 1;
70 AccessRequired members = 2;
71 AccessRequired addFromInviteLink = 3;
72 AccessRequired memberLabel = 4;
73}
74
75message Group {
76 bytes publicKey = 1;
77 bytes title = 2;
78 bytes description = 11;
79 // The URL for this group's avatar. The content at this URL can be
80 // decrypted/deserialized into a `GroupAttributeBlob`.
81 string avatarUrl = 3;
82 bytes disappearingMessagesTimer = 4;
83 AccessControl accessControl = 5;
84 uint32 version = 6;
85 repeated Member members = 7;
86 repeated MemberPendingProfileKey membersPendingProfileKey = 8;
87 repeated MemberPendingAdminApproval membersPendingAdminApproval = 9;
88 bytes inviteLinkPassword = 10;
89 bool announcements_only = 12;
90 repeated MemberBanned members_banned = 13;
91 bool terminated = 14;
92 // next: 15
93}
94
95message GroupAttributeBlob {
96 oneof content {
97 string title = 1;
98 bytes avatar = 2;
99 uint32 disappearingMessagesDuration = 3;
100 string descriptionText = 4;
101 }
102}
103
104message GroupInviteLink {
105 message GroupInviteLinkContentsV1 {
106 bytes groupMasterKey = 1;
107 bytes inviteLinkPassword = 2;
108 }
109
110 oneof contents {
111 GroupInviteLinkContentsV1 contentsV1 = 1;
112 }
113}
114
115message GroupJoinInfo {
116 bytes publicKey = 1;
117 bytes title = 2;
118 bytes description = 8;
119 string avatar = 3;
120 uint32 memberCount = 4;
121 AccessControl.AccessRequired addFromInviteLink = 5;
122 uint32 version = 6;
123 bool pendingAdminApproval = 7;
124 // bool pendingAdminApprovalFull = 9;
125 // next: 10
126}
127
128// Deltas
129
130message GroupChange {
131
132 message Actions {
133
134 message AddMemberAction {
135 Member added = 1;
136 bool joinFromInviteLink = 2;
137 }
138
139 message DeleteMemberAction {
140 bytes deletedUserId = 1;
141 }
142
143 message ModifyMemberRoleAction {
144 bytes userId = 1;
145 Member.Role role = 2;
146 }
147
148 message ModifyMemberLabelAction {
149 bytes userId = 1;
150 bytes labelEmoji = 2; // decrypts to a UTF-8 string
151 bytes labelString = 3; // decrypts to a UTF-8 string
152 }
153
154 message ModifyMemberProfileKeyAction {
155 bytes presentation = 1;
156 bytes user_id = 2;
157 bytes profile_key = 3;
158 }
159
160 message AddMemberPendingProfileKeyAction {
161 MemberPendingProfileKey added = 1;
162 }
163
164 message DeleteMemberPendingProfileKeyAction {
165 bytes deletedUserId = 1;
166 }
167
168 message PromoteMemberPendingProfileKeyAction {
169 bytes presentation = 1;
170 bytes user_id = 2;
171 bytes profile_key = 3;
172 }
173
174 message PromoteMemberPendingPniAciProfileKeyAction {
175 bytes presentation = 1;
176 bytes user_id = 2;
177 bytes pni = 3;
178 bytes profile_key = 4;
179 }
180
181 message AddMemberPendingAdminApprovalAction {
182 MemberPendingAdminApproval added = 1;
183 }
184
185 message DeleteMemberPendingAdminApprovalAction {
186 bytes deletedUserId = 1;
187 }
188
189 message PromoteMemberPendingAdminApprovalAction {
190 bytes userId = 1;
191 Member.Role role = 2;
192 }
193
194 message AddMemberBannedAction {
195 MemberBanned added = 1;
196 }
197
198 message DeleteMemberBannedAction {
199 bytes deletedUserId = 1;
200 }
201
202 message ModifyTitleAction {
203 bytes title = 1;
204 }
205
206 message ModifyDescriptionAction {
207 bytes description = 1;
208 }
209
210 message ModifyAvatarAction {
211 string avatar = 1;
212 }
213
214 message ModifyDisappearingMessageTimerAction {
215 bytes timer = 1;
216 }
217
218 message ModifyAttributesAccessControlAction {
219 AccessControl.AccessRequired attributesAccess = 1;
220 }
221
222 message ModifyMembersAccessControlAction {
223 AccessControl.AccessRequired membersAccess = 1;
224 }
225
226 message ModifyAddFromInviteLinkAccessControlAction {
227 AccessControl.AccessRequired addFromInviteLinkAccess = 1;
228 }
229
230 message ModifyMemberLabelAccessControlAction {
231 AccessControl.AccessRequired memberLabelAccess = 1;
232 }
233
234 message ModifyInviteLinkPasswordAction {
235 bytes inviteLinkPassword = 1;
236 }
237
238 message ModifyAnnouncementsOnlyAction {
239 bool announcements_only = 1;
240 }
241
242 message TerminateGroupAction {}
243
244 bytes sourceUserId = 1;
245 // clients should not provide this value; the server will provide it in the response buffer to ensure the signature is binding to a particular group
246 // if clients set it during a request the server will respond with 400.
247 bytes group_id = 25;
248 uint32 version = 2;
249
250 repeated AddMemberAction addMembers = 3;
251 repeated DeleteMemberAction deleteMembers = 4;
252 repeated ModifyMemberRoleAction modifyMemberRoles = 5;
253 repeated ModifyMemberProfileKeyAction modifyMemberProfileKeys = 6;
254 repeated AddMemberPendingProfileKeyAction addMembersPendingProfileKey = 7;
255 repeated DeleteMemberPendingProfileKeyAction deleteMembersPendingProfileKey = 8;
256 repeated PromoteMemberPendingProfileKeyAction promoteMembersPendingProfileKey = 9;
257 ModifyTitleAction modifyTitle = 10;
258 ModifyAvatarAction modifyAvatar = 11;
259 ModifyDisappearingMessageTimerAction modifyDisappearingMessageTimer = 12;
260 ModifyAttributesAccessControlAction modifyAttributesAccess = 13;
261 ModifyMembersAccessControlAction modifyMemberAccess = 14;
262 ModifyAddFromInviteLinkAccessControlAction modifyAddFromInviteLinkAccess = 15; // change epoch = 1
263 repeated AddMemberPendingAdminApprovalAction addMembersPendingAdminApproval = 16; // change epoch = 1
264 repeated DeleteMemberPendingAdminApprovalAction deleteMembersPendingAdminApproval = 17; // change epoch = 1
265 repeated PromoteMemberPendingAdminApprovalAction promoteMembersPendingAdminApproval = 18; // change epoch = 1
266 ModifyInviteLinkPasswordAction modifyInviteLinkPassword = 19; // change epoch = 1
267 ModifyDescriptionAction modifyDescription = 20; // change epoch = 2
268 ModifyAnnouncementsOnlyAction modify_announcements_only = 21; // change epoch = 3
269 repeated AddMemberBannedAction add_members_banned = 22; // change epoch = 4
270 repeated DeleteMemberBannedAction delete_members_banned = 23; // change epoch = 4
271 repeated PromoteMemberPendingPniAciProfileKeyAction promote_members_pending_pni_aci_profile_key = 24; // change epoch = 5
272 repeated ModifyMemberLabelAction modifyMemberLabels = 26; // change epoch = 6;
273 ModifyMemberLabelAccessControlAction modifyMemberLabelAccess = 27; // change epoch = 6
274 TerminateGroupAction terminate_group = 28; // change epoch = 7
275 // next: 29
276 }
277
278 bytes actions = 1;
279 bytes serverSignature = 2;
280 uint32 changeEpoch = 3;
281}
282
283// External credentials
284
285message ExternalGroupCredential {
286 string token = 1;
287}
288
289// API responses
290
291message GroupResponse {
292 Group group = 1;
293 bytes group_send_endorsements_response = 2;
294}
295
296message GroupChanges {
297 message GroupChangeState {
298 GroupChange groupChange = 1;
299 Group groupState = 2;
300 }
301
302 repeated GroupChangeState groupChanges = 1;
303 bytes group_send_endorsements_response = 2;
304}
305
306message GroupChangeResponse {
307 GroupChange group_change = 1;
308 bytes group_send_endorsements_response = 2;
309}