1use crate::state::{OutgoingAttachment, Screen};
2
3#[derive(uniffi::Enum, Clone, Debug)]
4pub enum AppAction {
5 SetPublicFollow {
6 owner_pubkey_hex: String,
7 following: bool,
8 },
9 ApproveContactName {
10 owner_pubkey_hex: String,
11 name: String,
12 },
13 SetContactFavorite {
14 owner_pubkey_hex: String,
15 favorite: bool,
16 },
17 StartCall {
18 chat_id: String,
19 video: bool,
20 },
21 AnswerCall {
22 call_id: String,
23 },
24 AnswerCallWithVoice {
25 call_id: String,
26 },
27 EndCall {
28 call_id: String,
29 },
30 SetCallMuted {
31 muted: bool,
32 },
33 SetCallVideoEnabled {
34 enabled: bool,
35 },
36 SendCallMedia {
37 call_id: String,
38 kind: u8,
39 timestamp_us: u64,
40 key_frame: bool,
41 data: Vec<u8>,
42 },
43 RequestCallKeyFrame {
44 call_id: String,
45 },
46 SetCallMediaConnected {
47 call_id: String,
48 connected: bool,
49 },
50 SetCallQuality {
51 quality: String,
52 max_bitrate_bps: u32,
53 },
54 SetVoiceCallsEnabled {
55 enabled: bool,
56 },
57 SetVideoCallsEnabled {
58 enabled: bool,
59 },
60 CreateAccount {
61 name: String,
62 },
63 UpdateProfileMetadata {
64 name: String,
65 picture_url: Option<String>,
66 about: Option<String>,
67 },
68 RestoreSession {
69 owner_nsec: String,
70 },
71 RestoreAccountBundle {
72 owner_nsec: Option<String>,
73 owner_pubkey_hex: String,
74 device_nsec: String,
75 },
76 RestorePendingDeviceLink {
77 device_nsec: String,
78 approval_bootstrap_json: String,
79 },
80 StartRemoteSignerLogin,
81 ConnectRemoteSigner {
82 connection_uri: String,
83 },
84 CancelRemoteSignerLogin,
85 BeginSignerLogin {
86 owner_pubkey_hex: String,
87 },
88 CompleteSignerLogin {
89 request_id: String,
90 signed_event_json: String,
91 },
92 CancelSignerLogin {
93 request_id: String,
94 },
95 StartLinkedDevice {
96 owner_input: String,
97 },
98 SetCurrentDeviceLabels {
99 device_label: String,
100 client_label: String,
101 },
102 AppForegrounded,
103 AppBackgrounded,
105 Logout,
106 CreateChat {
107 peer_input: String,
108 },
109 CreateGroup {
110 name: String,
111 member_inputs: Vec<String>,
112 },
113 CreateGroupWithPicture {
114 name: String,
115 member_inputs: Vec<String>,
116 picture_file_path: String,
117 picture_filename: String,
118 },
119 CreatePublicInvite,
120 CreateFullInvite,
121 CreateGroupInvite {
122 group_id: String,
123 max_uses: Option<u32>,
124 expires_in_seconds: Option<u64>,
125 },
126 RevokeGroupInvite {
127 group_id: String,
128 invite_id: String,
129 },
130 SetInviteOpenOnJoin {
131 enabled: bool,
132 },
133 AcceptInvite {
134 invite_input: String,
135 },
136 OpenChat {
137 chat_id: String,
138 },
139 RetryDirectChatCapability {
140 chat_id: String,
141 },
142 SendMessage {
143 chat_id: String,
144 text: String,
145 },
146 SendDisappearingMessage {
147 chat_id: String,
148 text: String,
149 expires_at_secs: u64,
150 },
151 SetChatMessageTtl {
152 chat_id: String,
153 ttl_seconds: Option<u64>,
154 },
155 SetChatMuted {
156 chat_id: String,
157 muted: bool,
158 },
159 SetChatMuteUntil {
160 chat_id: String,
161 until_secs: u64,
162 },
163 SetChatMentionNotifications {
164 chat_id: String,
165 enabled: bool,
166 },
167 SetChatPinned {
168 chat_id: String,
169 pinned: bool,
170 },
171 SetChatUnread {
172 chat_id: String,
173 unread: bool,
174 },
175 SendAttachment {
176 chat_id: String,
177 file_path: String,
178 filename: String,
179 caption: String,
180 },
181 SendAttachments {
182 chat_id: String,
183 attachments: Vec<OutgoingAttachment>,
184 caption: String,
185 },
186 SendDirectFiles {
187 chat_id: String,
188 attachments: Vec<OutgoingAttachment>,
189 caption: String,
190 },
191 DeclineDirectFiles {
192 chat_id: String,
193 transfer_id: String,
194 },
195 CancelDirectFiles {
196 chat_id: String,
197 transfer_id: String,
198 },
199 ToggleReaction {
200 chat_id: String,
201 message_id: String,
202 emoji: String,
203 },
204 SendTyping {
205 chat_id: String,
206 },
207 StopTyping {
208 chat_id: String,
209 },
210 SetTypingIndicatorsEnabled {
211 enabled: bool,
212 },
213 SetReadReceiptsEnabled {
214 enabled: bool,
215 },
216 SetDesktopNotificationsEnabled {
217 enabled: bool,
218 },
219 SetInviteAcceptanceNotificationsEnabled {
220 enabled: bool,
221 },
222 SetStartupAtLoginEnabled {
223 enabled: bool,
224 },
225 SetNearbyEnabled {
226 enabled: bool,
227 },
228 SetNearbyBluetoothEnabled {
229 enabled: bool,
230 },
231 SetNearbyLanEnabled {
232 enabled: bool,
233 },
234 SetDebugLoggingEnabled {
235 enabled: bool,
236 },
237 SetAcceptSocialGraphDirectMessages {
238 enabled: bool,
239 },
240 SetAcceptOvermutedDirectMessages {
241 enabled: bool,
242 },
243 SetAcceptUnknownDirectMessages {
244 enabled: bool,
245 },
246 SetUserBlocked {
252 owner_pubkey_hex: String,
253 blocked: bool,
254 },
255 SetMessageRequestAccepted {
259 chat_id: String,
260 },
261 SetNearbyMailbagEnabled {
267 enabled: bool,
268 },
269 SetNearbyShowInChatList {
270 enabled: bool,
271 },
272 AddNostrRelay {
273 relay_url: String,
274 },
275 UpdateNostrRelay {
276 old_relay_url: String,
277 new_relay_url: String,
278 },
279 RemoveNostrRelay {
280 relay_url: String,
281 },
282 SetNostrRelays {
283 relay_urls: Vec<String>,
284 },
285 ResetNostrRelays,
286 SetImageProxyEnabled {
287 enabled: bool,
288 },
289 SetImageProxyFallbackEnabled {
290 enabled: bool,
291 },
292 SetImageProxyUrl {
293 url: String,
294 },
295 SetImageProxyKeyHex {
296 key_hex: String,
297 },
298 SetImageProxySaltHex {
299 salt_hex: String,
300 },
301 ResetImageProxySettings,
302 SetMobilePushServerUrl {
303 url: String,
304 },
305 ResetMobilePushServerUrl,
306 IngestMobilePushPayload {
307 payload_json: String,
308 },
309 MarkMessagesSeen {
310 chat_id: String,
311 message_ids: Vec<String>,
312 },
313 SendReceipt {
314 chat_id: String,
315 receipt_type: String,
316 message_ids: Vec<String>,
317 },
318 EditMessage {
319 chat_id: String,
320 message_id: String,
321 text: String,
322 },
323 DeleteMessageForEveryone {
324 chat_id: String,
325 message_id: String,
326 },
327 SetHideBlockedGroupMessages {
328 enabled: bool,
329 },
330 SetAllowMessageDeletionByOthers {
331 enabled: bool,
332 },
333 DeleteLocalMessage {
334 chat_id: String,
335 message_id: String,
336 },
337 DeleteChat {
338 chat_id: String,
339 },
340 UpdateGroupName {
341 group_id: String,
342 name: String,
343 },
344 UpdateGroupPicture {
345 group_id: String,
346 file_path: String,
347 filename: String,
348 },
349 UpdateGroupAbout {
352 group_id: String,
353 about: Option<String>,
354 },
355 AddGroupMembers {
356 group_id: String,
357 member_inputs: Vec<String>,
358 },
359 SetGroupAdmin {
360 group_id: String,
361 owner_pubkey_hex: String,
362 is_admin: bool,
363 },
364 RemoveGroupMember {
365 group_id: String,
366 owner_pubkey_hex: String,
367 },
368 UploadProfilePicture {
369 file_path: String,
370 },
371 AddAuthorizedDevice {
372 device_input: String,
373 },
374 AddAuthorizedDeviceWithHistory {
375 device_input: String,
376 include_message_history: bool,
377 },
378 RemoveAuthorizedDevice {
379 device_pubkey_hex: String,
380 },
381 AcknowledgeRevokedDevice,
382 PushScreen {
383 screen: Screen,
384 },
385 UpdateScreenStack {
386 stack: Vec<Screen>,
387 },
388 NavigateBack,
394 SetChatDraft {
399 chat_id: String,
400 text: String,
401 },
402 DeleteProfileMetadata,
405 SetContactNickname {
409 owner_pubkey_hex: String,
410 nickname: String,
411 },
412 SetContactDetails {
414 owner_pubkey_hex: String,
415 nickname: String,
416 note: String,
417 },
418}