The chat view showed what `Event::Chat` reported: no ids, so nothing could be pinned, reacted to or grouped into topics, and avatars were always initials. Drive it from `Event::ChatHistory` instead, which upserts messages by their local id, and keep the old path only for sessions the engine stores no history for (it does not know the server yet). Each tab now holds its messages and rebuilds its lines with `vm::list::sync`, so a reaction changes one row. Around that: the image cache decodes avatars and icons from the engine's cache (`AvatarReady`, `IconReady`), members are grouped by server group with badges and talk power, the member card carries contacts and per-client volume, and file links in a message become cards that can be downloaded. The composer's attach uses xdg-desktop-portal's file chooser, which `voelin-platform` already had ashpd for. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
41 lines
1.3 KiB
Rust
41 lines
1.3 KiB
Rust
//! Desktop integration.
|
|
//!
|
|
//! - [`hotkey`]: global push-to-talk hotkeys with press and release events
|
|
//! (xdg-desktop-portal on Wayland, XInput2 on X11, a keyboard hook on
|
|
//! Windows)
|
|
//! - [`files`]: asking the user for a file (xdg-desktop-portal)
|
|
//! - [`notify`]: desktop notifications
|
|
//! - [`paths`]: data, config, cache and state directories
|
|
//! - [`crash`]: opt-in local crash reports (panic hook)
|
|
//! - [`notices`]: third-party notices for the About page
|
|
|
|
pub mod crash;
|
|
pub mod files;
|
|
pub mod hotkey;
|
|
pub mod notices;
|
|
pub mod notify;
|
|
pub mod paths;
|
|
|
|
pub use hotkey::{BackendKind, Hotkey, HotkeyEvent, HotkeyEvents, HotkeyManager, Key, Modifiers};
|
|
pub use notify::{Notification, notify};
|
|
|
|
/// Application id: desktop file, icon, portal registrations. It cannot change
|
|
/// once published on Flathub or Google Play.
|
|
pub const APP_ID: &str = "io.github.faumaray.Voelin";
|
|
/// Name shown in notifications and window titles.
|
|
pub const APP_NAME: &str = "Voelin";
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum Error {
|
|
#[error("invalid hotkey: {0}")]
|
|
InvalidHotkey(String),
|
|
#[error("not supported: {0}")]
|
|
Unsupported(String),
|
|
#[error("{0}")]
|
|
Backend(String),
|
|
#[error("notification: {0}")]
|
|
Notification(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|