Skip to main content

cosmic_applet_avestruz/handlers/
mod.rs

1// SPDX-License-Identifier: MIT
2
3//! Message handlers for Avestruz.
4//!
5//! Every handler is a method on [`AppModel`](crate::state::AppModel),
6//! called from the one `match` in [`crate::app`]. A handler changes the
7//! model at once, and returns a `Task` for whatever takes time, whose
8//! answer comes back as another message. Nothing else changes the model.
9//!
10//! ```mermaid
11//! flowchart LR
12//!     message["A Message"] --> update["app: update"]
13//!     update --> handler["One handler"]
14//!     handler -->|"at once"| model[("The model")]
15//!     handler -->|"returns"| task["A Task: the store, a relay, the signer, the web"]
16//!     task -->|"its answer, as a Message"| update
17//! ```
18//!
19//! They are split by what happens:
20//!
21//! | Module | What it handles |
22//! |---|---|
23//! | [`auth`] | Signing in with a key, signing out, restoring the account at startup |
24//! | [`bookmarks`] | What the account has bookmarked, and bookmarking a note |
25//! | [`compose`] | Writing a note, a reply or a quote, keeping drafts, and publishing |
26//! | [`engagement`] | What was made of the notes on show, and liking and reposting them |
27//! | [`feed`] | Loading the feed and other lists of notes, paging into the past, and authors' profiles |
28//! | [`images`] | Fetching the pictures views ask for |
29//! | [`keys`] | The keyboard, on a list: stepping through its rows, opening the one it is at, showing the notes that wait, going back |
30//! | [`media`] | The account's media servers, and attaching files to what is being written |
31//! | [`navigation`] | The popup, which view it shows, the pages opened over the feed, and showing a long note in full where it is |
32//! | [`notifications`] | What others did that concerns the account, and how much of it was looked at |
33//! | [`previews`] | Asking the web pages notes link to what they say of themselves |
34//! | [`profile`] | Opening someone's profile, and following them |
35//! | [`relays`] | The account's relays: reading its lists, changing them, and saving them |
36//! | [`screenshot`] | Taking a picture of the popup, from the popup, and writing it to the pictures folder |
37//! | [`search`] | Searching for people and notes, and opening what is typed by its address |
38//! | [`settings`] | Changing settings, and taking changes made elsewhere |
39//! | [`share`] | Copying a link to a note that anyone can open |
40//! | [`store`] | Having the event store let go of what is old, once a day |
41//! | [`thread`] | Opening a note's thread, and gathering its conversation |
42//! | [`video`] | Playing a video a note links to, and finding what there is to play of a YouTube one |
43//! | [`zap`] | Zapping a note: asking for the invoice, and waiting for its receipt |
44//!
45//! What several of them do together, in order, is in
46//! [`crate::guide::flows`].
47
48pub mod auth;
49pub mod bookmarks;
50pub mod compose;
51pub mod engagement;
52pub mod feed;
53pub mod images;
54pub mod keys;
55pub mod media;
56pub mod navigation;
57pub mod notifications;
58pub mod previews;
59pub mod profile;
60pub mod relays;
61pub mod screenshot;
62pub mod search;
63pub mod settings;
64pub mod share;
65pub mod store;
66pub mod thread;
67pub mod video;
68pub mod zap;