1use crate::state::{OutgoingAttachment, Screen};
2
3#[derive(uniffi::Enum, Clone, Debug)]
4pub enum AppAction {
5 CreateAccount {
6 name: String,
7 },
8 UpdateProfileMetadata {
9 name: String,
10 picture_url: Option<String>,
11 },
12 RestoreSession {
13 owner_nsec: String,
14 },
15 RestoreAccountBundle {
16 owner_nsec: Option<String>,
17 owner_pubkey_hex: String,
18 device_nsec: String,
19 },
20 StartLinkedDevice {
21 owner_input: String,
22 },
23 SetCurrentDeviceLabels {
24 device_label: String,
25 client_label: String,
26 },
27 AppForegrounded,
28 Logout,
29 CreateChat {
30 peer_input: String,
31 },
32 CreateGroup {
33 name: String,
34 member_inputs: Vec<String>,
35 },
36 CreateGroupWithPicture {
37 name: String,
38 member_inputs: Vec<String>,
39 picture_file_path: String,
40 picture_filename: String,
41 },
42 CreatePublicInvite,
43 AcceptInvite {
44 invite_input: String,
45 },
46 OpenChat {
47 chat_id: String,
48 },
49 SendMessage {
50 chat_id: String,
51 text: String,
52 },
53 SendDisappearingMessage {
54 chat_id: String,
55 text: String,
56 expires_at_secs: u64,
57 },
58 SetChatMessageTtl {
59 chat_id: String,
60 ttl_seconds: Option<u64>,
61 },
62 SetChatMuted {
63 chat_id: String,
64 muted: bool,
65 },
66 SetChatPinned {
67 chat_id: String,
68 pinned: bool,
69 },
70 SetChatUnread {
71 chat_id: String,
72 unread: bool,
73 },
74 SendAttachment {
75 chat_id: String,
76 file_path: String,
77 filename: String,
78 caption: String,
79 },
80 SendAttachments {
81 chat_id: String,
82 attachments: Vec<OutgoingAttachment>,
83 caption: String,
84 },
85 ToggleReaction {
86 chat_id: String,
87 message_id: String,
88 emoji: String,
89 },
90 SendTyping {
91 chat_id: String,
92 },
93 StopTyping {
94 chat_id: String,
95 },
96 SetTypingIndicatorsEnabled {
97 enabled: bool,
98 },
99 SetReadReceiptsEnabled {
100 enabled: bool,
101 },
102 SetDesktopNotificationsEnabled {
103 enabled: bool,
104 },
105 SetInviteAcceptanceNotificationsEnabled {
106 enabled: bool,
107 },
108 SetStartupAtLoginEnabled {
109 enabled: bool,
110 },
111 SetNearbyEnabled {
112 enabled: bool,
113 },
114 SetNearbyBluetoothEnabled {
115 enabled: bool,
116 },
117 SetNearbyLanEnabled {
118 enabled: bool,
119 },
120 SetDebugLoggingEnabled {
121 enabled: bool,
122 },
123 SetAcceptUnknownDirectMessages {
124 enabled: bool,
125 },
126 SetUserBlocked {
132 owner_pubkey_hex: String,
133 blocked: bool,
134 },
135 SetMessageRequestAccepted {
139 chat_id: String,
140 },
141 SetNearbyMailbagEnabled {
147 enabled: bool,
148 },
149 AddNostrRelay {
150 relay_url: String,
151 },
152 UpdateNostrRelay {
153 old_relay_url: String,
154 new_relay_url: String,
155 },
156 RemoveNostrRelay {
157 relay_url: String,
158 },
159 SetNostrRelays {
160 relay_urls: Vec<String>,
161 },
162 ResetNostrRelays,
163 SetImageProxyEnabled {
164 enabled: bool,
165 },
166 SetImageProxyUrl {
167 url: String,
168 },
169 SetImageProxyKeyHex {
170 key_hex: String,
171 },
172 SetImageProxySaltHex {
173 salt_hex: String,
174 },
175 ResetImageProxySettings,
176 SetMobilePushServerUrl {
177 url: String,
178 },
179 ResetMobilePushServerUrl,
180 IngestMobilePushPayload {
181 payload_json: String,
182 },
183 MarkMessagesSeen {
184 chat_id: String,
185 message_ids: Vec<String>,
186 },
187 SendReceipt {
188 chat_id: String,
189 receipt_type: String,
190 message_ids: Vec<String>,
191 },
192 DeleteLocalMessage {
193 chat_id: String,
194 message_id: String,
195 },
196 DeleteChat {
197 chat_id: String,
198 },
199 UpdateGroupName {
200 group_id: String,
201 name: String,
202 },
203 UpdateGroupPicture {
204 group_id: String,
205 file_path: String,
206 filename: String,
207 },
208 AddGroupMembers {
209 group_id: String,
210 member_inputs: Vec<String>,
211 },
212 SetGroupAdmin {
213 group_id: String,
214 owner_pubkey_hex: String,
215 is_admin: bool,
216 },
217 RemoveGroupMember {
218 group_id: String,
219 owner_pubkey_hex: String,
220 },
221 UploadProfilePicture {
222 file_path: String,
223 },
224 AddAuthorizedDevice {
225 device_input: String,
226 },
227 RemoveAuthorizedDevice {
228 device_pubkey_hex: String,
229 },
230 AcknowledgeRevokedDevice,
231 PushScreen {
232 screen: Screen,
233 },
234 UpdateScreenStack {
235 stack: Vec<Screen>,
236 },
237 NavigateBack,
243 SetChatDraft {
248 chat_id: String,
249 text: String,
250 },
251 DeleteProfileMetadata,
254}