use crate::state::{OutgoingAttachment, Screen};
#[derive(uniffi::Enum, Clone, Debug)]
pub enum AppAction {
SetPublicFollow {
owner_pubkey_hex: String,
following: bool,
},
ApproveContactName {
owner_pubkey_hex: String,
name: String,
},
SetContactFavorite {
owner_pubkey_hex: String,
favorite: bool,
},
StartCall {
chat_id: String,
video: bool,
},
AnswerCall {
call_id: String,
},
AnswerCallWithVoice {
call_id: String,
},
EndCall {
call_id: String,
},
SetCallMuted {
muted: bool,
},
SetCallVideoEnabled {
enabled: bool,
},
SendCallMedia {
call_id: String,
kind: u8,
timestamp_us: u64,
key_frame: bool,
data: Vec<u8>,
},
RequestCallKeyFrame {
call_id: String,
},
SetCallMediaConnected {
call_id: String,
connected: bool,
},
SetCallQuality {
quality: String,
max_bitrate_bps: u32,
},
SetVoiceCallsEnabled {
enabled: bool,
},
SetVideoCallsEnabled {
enabled: bool,
},
CreateAccount {
name: String,
},
UpdateProfileMetadata {
name: String,
picture_url: Option<String>,
about: Option<String>,
},
RestoreSession {
owner_nsec: String,
},
RestoreAccountBundle {
owner_nsec: Option<String>,
owner_pubkey_hex: String,
device_nsec: String,
},
RestorePendingDeviceLink {
device_nsec: String,
approval_bootstrap_json: String,
},
StartRemoteSignerLogin,
ConnectRemoteSigner {
connection_uri: String,
},
CancelRemoteSignerLogin,
BeginSignerLogin {
owner_pubkey_hex: String,
},
CompleteSignerLogin {
request_id: String,
signed_event_json: String,
},
CancelSignerLogin {
request_id: String,
},
StartLinkedDevice {
owner_input: String,
},
SetCurrentDeviceLabels {
device_label: String,
client_label: String,
},
AppForegrounded,
AppBackgrounded,
Logout,
CreateChat {
peer_input: String,
},
CreateGroup {
name: String,
member_inputs: Vec<String>,
},
CreateGroupWithPicture {
name: String,
member_inputs: Vec<String>,
picture_file_path: String,
picture_filename: String,
},
CreatePublicInvite,
CreateFullInvite,
CreateGroupInvite {
group_id: String,
max_uses: Option<u32>,
expires_in_seconds: Option<u64>,
},
RevokeGroupInvite {
group_id: String,
invite_id: String,
},
SetInviteOpenOnJoin {
enabled: bool,
},
AcceptInvite {
invite_input: String,
},
OpenChat {
chat_id: String,
},
RetryDirectChatCapability {
chat_id: String,
},
SendMessage {
chat_id: String,
text: String,
},
SendDisappearingMessage {
chat_id: String,
text: String,
expires_at_secs: u64,
},
SetChatMessageTtl {
chat_id: String,
ttl_seconds: Option<u64>,
},
SetChatMuted {
chat_id: String,
muted: bool,
},
SetChatMuteUntil {
chat_id: String,
until_secs: u64,
},
SetChatMentionNotifications {
chat_id: String,
enabled: bool,
},
SetChatPinned {
chat_id: String,
pinned: bool,
},
SetChatUnread {
chat_id: String,
unread: bool,
},
SendAttachment {
chat_id: String,
file_path: String,
filename: String,
caption: String,
},
SendAttachments {
chat_id: String,
attachments: Vec<OutgoingAttachment>,
caption: String,
},
SendDirectFiles {
chat_id: String,
attachments: Vec<OutgoingAttachment>,
caption: String,
},
DeclineDirectFiles {
chat_id: String,
transfer_id: String,
},
CancelDirectFiles {
chat_id: String,
transfer_id: String,
},
ToggleReaction {
chat_id: String,
message_id: String,
emoji: String,
},
SendTyping {
chat_id: String,
},
StopTyping {
chat_id: String,
},
SetTypingIndicatorsEnabled {
enabled: bool,
},
SetReadReceiptsEnabled {
enabled: bool,
},
SetDesktopNotificationsEnabled {
enabled: bool,
},
SetInviteAcceptanceNotificationsEnabled {
enabled: bool,
},
SetStartupAtLoginEnabled {
enabled: bool,
},
SetNearbyEnabled {
enabled: bool,
},
SetNearbyBluetoothEnabled {
enabled: bool,
},
SetNearbyLanEnabled {
enabled: bool,
},
SetDebugLoggingEnabled {
enabled: bool,
},
SetAcceptUnknownDirectMessages {
enabled: bool,
},
SetUserBlocked {
owner_pubkey_hex: String,
blocked: bool,
},
SetMessageRequestAccepted {
chat_id: String,
},
SetNearbyMailbagEnabled {
enabled: bool,
},
SetNearbyShowInChatList {
enabled: bool,
},
AddNostrRelay {
relay_url: String,
},
UpdateNostrRelay {
old_relay_url: String,
new_relay_url: String,
},
RemoveNostrRelay {
relay_url: String,
},
SetNostrRelays {
relay_urls: Vec<String>,
},
ResetNostrRelays,
SetImageProxyEnabled {
enabled: bool,
},
SetImageProxyFallbackEnabled {
enabled: bool,
},
SetImageProxyUrl {
url: String,
},
SetImageProxyKeyHex {
key_hex: String,
},
SetImageProxySaltHex {
salt_hex: String,
},
ResetImageProxySettings,
SetMobilePushServerUrl {
url: String,
},
ResetMobilePushServerUrl,
IngestMobilePushPayload {
payload_json: String,
},
MarkMessagesSeen {
chat_id: String,
message_ids: Vec<String>,
},
SendReceipt {
chat_id: String,
receipt_type: String,
message_ids: Vec<String>,
},
EditMessage {
chat_id: String,
message_id: String,
text: String,
},
DeleteMessageForEveryone {
chat_id: String,
message_id: String,
},
SetHideBlockedGroupMessages {
enabled: bool,
},
SetAllowMessageDeletionByOthers {
enabled: bool,
},
DeleteLocalMessage {
chat_id: String,
message_id: String,
},
DeleteChat {
chat_id: String,
},
UpdateGroupName {
group_id: String,
name: String,
},
UpdateGroupPicture {
group_id: String,
file_path: String,
filename: String,
},
UpdateGroupAbout {
group_id: String,
about: Option<String>,
},
AddGroupMembers {
group_id: String,
member_inputs: Vec<String>,
},
SetGroupAdmin {
group_id: String,
owner_pubkey_hex: String,
is_admin: bool,
},
RemoveGroupMember {
group_id: String,
owner_pubkey_hex: String,
},
UploadProfilePicture {
file_path: String,
},
AddAuthorizedDevice {
device_input: String,
},
AddAuthorizedDeviceWithHistory {
device_input: String,
include_message_history: bool,
},
RemoveAuthorizedDevice {
device_pubkey_hex: String,
},
AcknowledgeRevokedDevice,
PushScreen {
screen: Screen,
},
UpdateScreenStack {
stack: Vec<Screen>,
},
NavigateBack,
SetChatDraft {
chat_id: String,
text: String,
},
DeleteProfileMetadata,
SetContactNickname {
owner_pubkey_hex: String,
nickname: String,
},
SetContactDetails {
owner_pubkey_hex: String,
nickname: String,
note: String,
},
}