Repository navigation
The desktop app shows polls and lets you vote, and opens view-once photos and videos once - #209
Conversation
Polls show their options, votes and voters, ours ticked; a click votes (single or several choices, a click on ours takes it back), and our own open poll can be ended. View-once photos open once in a viewer over the window, decoded in memory only; videos play in the system's player from a copy removed when the viewer closes. Each is spent only once it shows.
A sender's name could make the player's click run a program or a script; a type that isn't a video a player should open isn't copied or opened at all.
# Conflicts: # core/desktop/src/app/mod.rs
…h their chat A video handed to the player counts as shown and is spent even if the chat changed meanwhile; a photo for a chat left meanwhile isn't. A look shown keeps its button waiting for the rest of the run, as on the Mac, and while one shows the chat shortcuts wait. Switching chats or leaving the chats screen closes the look and removes a video's copy; a copy the player still holds is said. Photo read errors use the app's words.
# Conflicts: # core/desktop/src/app/view.rs # core/desktop/src/main.rs
Review (
|
What changed
The desktop app no longer shows "📊 Poll: …" and "View-once media" placeholders; it does what the Mac app does (
PollView.swift,ViewOnceinPlaceholder.swift, the view-once spec).Polls (
core/desktop/src/app/polls.rs,polls/view.rs)Client::details.PollChoice.afterdoes: single choice → that option (on ours, the vote is taken back); several → toggles it. Ended polls take no votes. Our own open poll has "End poll". Both go throughchats::change("Couldn't vote: …", "Couldn't end the poll: …"), and show once the core reports them sent.View-once media (
core/desktop/src/app/view_once.rs,view_once/view.rs)file_bytes, decoded in memory and shown over the window (Close or Esc). It never enters the files' picture cache (Files.thumbs) and is never written to disk; its pixels are dropped when it closes (drop_image).video.mp4,.mov,.m4v,.webmor.3gp) and never from the sender's file name; a view-once "video" of any other type is refused before anything is copied. A small "View-once video" window stays up while it plays, and its Close removes the copy. If the player still holds the file (Windows locks it), the app says so. Any copy left behind is removed at quit and at the next launch, as the other opened copies are.view_once_opened) only once it shows, so a failed open keeps it for another try. A photo for a chat left while it was being prepared shows nothing and spends nothing. A video already handed to the player is always spent. Once shown, a look's button stays waiting for the rest of the run, even if the core couldn't mark it viewed (the Mac'sviewOnceOpening). While a look shows, the chat shortcuts wait; switching chats or leaving the chats screen closes it, as the Mac closes Quick Look with its chat. Nothing in the viewer copies, saves or forwards: there is no menu on it, and the message menu has no Copy (the core keeps no caption).Hooks in shared files are additive: the row's poll and view-once fields plus its words replaced (
view.rs), poll details loaded and kept (actions/mod.rs), the module fields and demo screens (mod.rs,main.rs,demo.rs), and a fewfiles.rshelpers made visible (picture,attachments, the copy and open helpers).How it was tested
make format,make lint(including clippy withhush-desktop/snapshot),cd core && cargo test --features hush-desktop/snapshot -q: all pass.--snapshot, light and dark):polls(our open poll with End poll, Ana's ended poll with our vote, and Viewed, Download and View photo bubbles) andview-once(the photo viewer over the chat).core/desktop).Decisions for the owner
video/mp4,quicktime,x-m4v,webmand3gpp. Any othervideo/*type is refused with "Couldn't open the video: it isn't a kind of video Hush plays".Not verified
open_with_systemand the copy-folder cleanup, which already have theircfgs, but it was built and run on macOS only.Closes #152