Skip to main content

Crate iris_chat_core

Crate iris_chat_core 

Source

Re-exports§

pub use update_policy::UpdateAutoCheckPolicy;

Modules§

contact_memory
Private contact memory. Storage and transport are left to the application.
image_proxy
invite_record
Private invitation records: one standard CHK-encrypted hashtree leaf.
local_relay
perflog
Minimal millisecond-resolution perf logger that writes straight to Android logcat (or stderr off-Android with IRIS_PERF_LOG=1) without pulling in log + android_logger crates. Used to diagnose where time goes between an FFI dispatch, the core thread processing, and the UI reconcile.
update_policy

Macros§

perflog
IrisPerf tag — adb logcat IrisPerf:I *:S shows only these.

Structs§

AccountSnapshot
AppState
AttachmentDownloadResult
BusyState
CallAudioCodec
CallHistorySnapshot
A local call summary. Signaling and media never enter message history.
CallSnapshot
CashuMintAmount
CashuTokenMetadata
Unverified, sender-provided metadata. This does not establish that the mint issued the proofs, that spending conditions are met, or that funds remain.
ChatMessageSnapshot
ChatMuteDeadline
ChatParticipantSnapshot
ChatThreadSnapshot
ContactIdentitySnapshot
CorePerfCountersSnapshot
Core-internal hot-loop counters. FFI surface counters can only catch shells that re-enter the core in a loop — the build_runtime_debug_snapshot regression that caused the macOS CPU loop was entirely internal (relay events fanned out through persist_best_effort_inner → persist_debug_snapshot_best_effort → full SessionManager clone × N known users). The release-gate budget tests assert on this snapshot too so the next time core work explodes per event, CI catches it before a device does.
CurrentChatSnapshot
DesktopAudioDevice
DesktopAudioDevices
DesktopCallMedia
DesktopCallTone
DesktopNearbyPeerSnapshot
DesktopNearbySnapshot
DesktopNotificationMessage
DeviceEntrySnapshot
DeviceHistorySyncSnapshot
DeviceRosterSnapshot
DirectFileSnapshot
DirectFileTransferSnapshot
EmojiAliasSnapshot
EmojiCategorySnapshot
FfiApp
FfiDesktopNearby
Compatibility facade for desktop callers that still own the Nearby UI lifecycle. FIPS owns discovery and transport; peer snapshots arrive through AppUpdate.
FfiFipsBle
FfiPerfCountersSnapshot
FollowedUserSearchResult
A person discovered from local profiles, the account’s social graph, or the global profile index. Chat capability is resolved only after selection; shells only render these fields.
GroupDetailsSnapshot
GroupInviteSnapshot
GroupMemberSnapshot
IrisDesktopUpdateResult
LightningInvoiceMetadata
LinkDeviceSnapshot
MentionNotificationSnapshot
MessageAttachmentSnapshot
MessageDeliveryTraceSnapshot
MessageEditSnapshot
MessageMention
MessagePaymentLink
A compact link with UTF-16 offsets, like MessageMention. The URI contains bearer/payment data: do not log it or send it to a link-preview service.
MessageReactionSnapshot
MessageReactor
MessageRecipientDeliverySnapshot
MessageSearchHit
One row inside the “Messages” section of a search result. Shells use the conversation identity for global results and the author identity for results within a chat. Both are resolved from persisted history so searching older messages does not depend on the loaded timeline.
MobilePushDelayedAuthor
MobilePushNotificationResolution
MobilePushSessionSnapshot
MobilePushSubscriptionRequest
MobilePushSyncSnapshot
MutualGroupsSnapshot
NetworkStatusSnapshot
NotificationCandidate
OutgoingAttachment
PeerProfileDebugSnapshot
PersonNamePresentation
PreferencesSnapshot
PublicInviteSnapshot
QrCodeMatrix
RelayConnectionSnapshot
RemoteSignerLoginSnapshot
Router
SearchResultSnapshot
SocialConnectionSnapshot
TypingIndicatorSnapshot
UniFfiTraitVtableAppReconciler
UniFfiTraitVtableDesktopNearbyObserver
UniFfiTraitVtableDirectFileDestination
UploadProgress
UserProfileSnapshot
Current account’s presentation of a person. Metadata stays in the core; native views select an identity, rather than passing cached names/photos.

Enums§

AppAction
AppUpdate
CallAudioError
ChatInputShortcut
Classification of the free-text input typed into a chat-action field — the search bar, the “New chat” paste field, the share-link handler. Centralising the parsing here means the UI just looks at the enum and dispatches; no platform has its own ad-hoc contains("://") && contains("#") check.
ChatKind
ChatMessageKind
DeliveryState
DesktopCallEvent
DeviceAuthorizationState
DeviceHistorySyncPhase
DirectChatCapabilityState
Capability of the selected direct-chat peer. Profile search results are locators only; the composer unlocks after current owner-signed evidence is resolved. Group chats expose None.
DirectFileDestinationError
DirectFileTransferStatus
FipsBleBridgeError
FipsBleCommand
FipsBleEvent
RemoteSignerPhase
Screen
SocialBadge
A social connection, not identity verification. Computed by nostr-social-graph.

Traits§

AppReconciler
DesktopNearbyObserver
DirectFileDestination
Each selected destination belongs to one acceptance. abort must remove only newly created partial outputs; it must never delete or truncate existing files. prepare must clean its own partial preparation on error, without disturbing an already-open destination if the same object is accidentally reused.

Functions§

app_version
Marketing version baked in at build time from IRIS_APP_VERSION_NAME (or IRIS_APP_VERSION), falling back to the crate semver. Use this instead of env!("CARGO_PKG_VERSION") so UI/release artifacts agree on a single version string.
build_call_push_subscription_request
Register a device for incoming call wakeups on the existing notification service.
build_large_test_app_state
Deterministic high-volume shell fixture for list, navigation, and message rendering tests. This is intentionally synthetic: relay-backed tests cover protocol behaviour, while this keeps UI/perf tests fast and reproducible.
build_large_test_search_result
Deterministic grouped search fixture for shell tests that need to verify collapsed initial rendering plus “View more” expansion without writing a large on-disk message index first.
build_mobile_push_create_subscription_request
build_mobile_push_delete_subscription_request
build_mobile_push_list_subscriptions_request
build_mobile_push_update_subscription_request
build_summary
classify_chat_input
Single source of truth for “is this typed text an npub or an invite URL?”. Used by the New Chat paste field, the chat-list search bar, and the deep-link handler so all three branches agree on what counts as a chat-opening shortcut. Returns None for regular search-style text.
decide_pending_notifications
Compute the list of chats that should raise a notification given two successive AppState chat-list snapshots. Single source of truth for suppression — chat muted, chat open with app foregrounded, outgoing last message, no unread increase, or global pref off. Use this from Android, macOS, Linux, and Windows. iOS APNS uses a separate path that cannot suppress until Apple grants the filtering entitlement.
decrypt_mobile_push_notification_payload
Decrypt a notification payload against the persisted double-ratchet state under data_dir. Use from the FCM service (Android) or Notification Service Extension (iOS) where there’s no live FfiApp. Falls back to the generic resolver when keys, payload, or storage are unavailable so the user still gets some notification.
direct_file_directory_destination
Save directly into a new batch folder within the folder selected by the user. The exclusive batch folder keeps existing destination files untouched.
display_message_mentions
Readable previews and quoted/forwarded content must not expose wire syntax.
download_hashtree_attachment
download_hashtree_attachment_with_limit
Automatic previews may request a lower ceiling; callers cannot raise the app limit.
encode_text_qr
Render text to a QR-code module matrix. Returns a square matrix encoded as 1/0 characters in row-major order. Returns None for inputs that don’t fit at the medium error-correction level.
format_forwarded_message
Mark a forward without including the source chat, author or message ID. Keep the heading in the encrypted body so every renderer can display it.
format_message_mention
image_load_urls
iris_desktop_update_check
iris_desktop_update_download
iris_emoji_catalog
iris_emoji_search_aliases
is_device_approval_bootstrap
is_trusted_test_build
is_valid_peer_input
message_mentions
message_payment_links
Recognizes standalone payments, including optional URI schemes. Invalid, embedded-URL and oversized candidates remain ordinary selectable text.
mobile_push_request_without_timed_filters
Legacy notification servers reject time bounds. Retry with muted authors excluded entirely, never by dropping the bound while keeping those authors subscribed.
mobile_push_subscription_id_key
normalize_peer_input
optimistic_push_screen_stack
Predicts the screen stack that [AppCore::push_screen] will produce, so a shell can show the destination before the core confirms it. None means the push has no predictable result and the shell must wait for the core.
parse_cashu_token
parse_lightning_invoice
peer_input_to_hex
Convert any pubkey-shaped input (hex, npub, nprofile, …) to its canonical lowercase-hex form. The empty string is returned when the input can’t be parsed as a public key — callers expecting hex downstream can short-circuit on that.
peer_input_to_npub
Convert any pubkey-shaped input (hex, npub, nprofile, …) to its npub form. Returns the original string when it can’t be parsed as a public key.
pending_navigation_settled
Whether a shell should drop its optimistic stack and show the core’s: the account is gone, the core caught up, or the shell’s timeout expired.
present_person_name
Display-only repair of cached identifiers and generated names. Explicit profile names and nicknames are distinguished by provenance, not word shape.
proxied_image_url
read_desktop_notification_indexes
read_mobile_push_notification_indexes
relay_set_id
resolve_call_push_invite
Authenticate a call wakeup locally before reporting it to the system call UI.
resolve_mobile_push_notification_payload
resolve_mobile_push_subscription_server_url
router_open_chat_id
Pull the open chat id out of a Router, falling back to its default screen. Shells normally just call this with state.router so they don’t each reimplement the Screen::Chat { chat_id } extraction.
run_direct_file_transfer_smoke
Runs actual FIPS-TCP file transport through the platform’s native library. Returns JSON so platform test runners can retain the same compact evidence.
share_target_chats
A picker can offer the account’s own conversation before it has any history.
uniffi_iris_chat_core_fn_init_callback_vtable_appreconciler
uniffi_iris_chat_core_fn_init_callback_vtable_desktopnearbyobserver
uniffi_iris_chat_core_fn_init_callback_vtable_directfiledestination
validate_account_storage
Check account ownership without changing the database or opening a live core. CLI history readers use this while another process may own the session lock.