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 AppForegrounded,
24 Logout,
25 CreateChat {
26 peer_input: String,
27 },
28 CreateGroup {
29 name: String,
30 member_inputs: Vec<String>,
31 },
32 CreateGroupWithPicture {
33 name: String,
34 member_inputs: Vec<String>,
35 picture_file_path: String,
36 picture_filename: String,
37 },
38 CreatePublicInvite,
39 AcceptInvite {
40 invite_input: String,
41 },
42 OpenChat {
43 chat_id: String,
44 },
45 SendMessage {
46 chat_id: String,
47 text: String,
48 },
49 SendDisappearingMessage {
50 chat_id: String,
51 text: String,
52 expires_at_secs: u64,
53 },
54 SetChatMessageTtl {
55 chat_id: String,
56 ttl_seconds: Option<u64>,
57 },
58 SetChatMuted {
59 chat_id: String,
60 muted: bool,
61 },
62 SetChatPinned {
63 chat_id: String,
64 pinned: bool,
65 },
66 SetChatUnread {
67 chat_id: String,
68 unread: bool,
69 },
70 SendAttachment {
71 chat_id: String,
72 file_path: String,
73 filename: String,
74 caption: String,
75 },
76 SendAttachments {
77 chat_id: String,
78 attachments: Vec<OutgoingAttachment>,
79 caption: String,
80 },
81 ToggleReaction {
82 chat_id: String,
83 message_id: String,
84 emoji: String,
85 },
86 SendTyping {
87 chat_id: String,
88 },
89 StopTyping {
90 chat_id: String,
91 },
92 SetTypingIndicatorsEnabled {
93 enabled: bool,
94 },
95 SetReadReceiptsEnabled {
96 enabled: bool,
97 },
98 SetDesktopNotificationsEnabled {
99 enabled: bool,
100 },
101 SetInviteAcceptanceNotificationsEnabled {
102 enabled: bool,
103 },
104 SetStartupAtLoginEnabled {
105 enabled: bool,
106 },
107 SetNearbyEnabled {
108 enabled: bool,
109 },
110 SetNearbyBluetoothEnabled {
111 enabled: bool,
112 },
113 SetNearbyLanEnabled {
114 enabled: bool,
115 },
116 SetDebugLoggingEnabled {
117 enabled: bool,
118 },
119 SetAcceptUnknownDirectMessages {
120 enabled: bool,
121 },
122 SetUserBlocked {
128 owner_pubkey_hex: String,
129 blocked: bool,
130 },
131 SetMessageRequestAccepted {
135 chat_id: String,
136 },
137 SetNearbyMailbagEnabled {
143 enabled: bool,
144 },
145 AddNostrRelay {
146 relay_url: String,
147 },
148 UpdateNostrRelay {
149 old_relay_url: String,
150 new_relay_url: String,
151 },
152 RemoveNostrRelay {
153 relay_url: String,
154 },
155 SetNostrRelays {
156 relay_urls: Vec<String>,
157 },
158 ResetNostrRelays,
159 SetImageProxyEnabled {
160 enabled: bool,
161 },
162 SetImageProxyUrl {
163 url: String,
164 },
165 SetImageProxyKeyHex {
166 key_hex: String,
167 },
168 SetImageProxySaltHex {
169 salt_hex: String,
170 },
171 ResetImageProxySettings,
172 SetMobilePushServerUrl {
173 url: String,
174 },
175 ResetMobilePushServerUrl,
176 IngestMobilePushPayload {
177 payload_json: String,
178 },
179 MarkMessagesSeen {
180 chat_id: String,
181 message_ids: Vec<String>,
182 },
183 SendReceipt {
184 chat_id: String,
185 receipt_type: String,
186 message_ids: Vec<String>,
187 },
188 DeleteLocalMessage {
189 chat_id: String,
190 message_id: String,
191 },
192 DeleteChat {
193 chat_id: String,
194 },
195 UpdateGroupName {
196 group_id: String,
197 name: String,
198 },
199 UpdateGroupPicture {
200 group_id: String,
201 file_path: String,
202 filename: String,
203 },
204 AddGroupMembers {
205 group_id: String,
206 member_inputs: Vec<String>,
207 },
208 SetGroupAdmin {
209 group_id: String,
210 owner_pubkey_hex: String,
211 is_admin: bool,
212 },
213 RemoveGroupMember {
214 group_id: String,
215 owner_pubkey_hex: String,
216 },
217 UploadProfilePicture {
218 file_path: String,
219 },
220 AddAuthorizedDevice {
221 device_input: String,
222 },
223 RemoveAuthorizedDevice {
224 device_pubkey_hex: String,
225 },
226 AcknowledgeRevokedDevice,
227 PushScreen {
228 screen: Screen,
229 },
230 UpdateScreenStack {
231 stack: Vec<Screen>,
232 },
233 NavigateBack,
239 SetChatDraft {
244 chat_id: String,
245 text: String,
246 },
247 DeleteProfileMetadata,
250}