Skip to main content

Module handlers

Module handlers 

Source
Expand description

Message handlers for Avestruz.

Every handler is a method on AppModel, called from the one match in crate::app. A handler changes the model at once, and returns a Task for whatever takes time, whose answer comes back as another message. Nothing else changes the model.

flowchart LR
    message["A Message"] --> update["app: update"]
    update --> handler["One handler"]
    handler -->|"at once"| model[("The model")]
    handler -->|"returns"| task["A Task: the store, a relay, the signer, the web"]
    task -->|"its answer, as a Message"| update

They are split by what happens:

ModuleWhat it handles
authSigning in with a key, signing out, restoring the account at startup
bookmarksWhat the account has bookmarked, and bookmarking a note
composeWriting a note, a reply or a quote, keeping drafts, and publishing
engagementWhat was made of the notes on show, and liking and reposting them
feedLoading the feed and other lists of notes, paging into the past, and authors’ profiles
imagesFetching the pictures views ask for
keysThe keyboard, on a list: stepping through its rows, opening the one it is at, showing the notes that wait, going back
mediaThe account’s media servers, and attaching files to what is being written
navigationThe popup, which view it shows, the pages opened over the feed, and showing a long note in full where it is
notificationsWhat others did that concerns the account, and how much of it was looked at
previewsAsking the web pages notes link to what they say of themselves
profileOpening someone’s profile, and following them
relaysThe account’s relays: reading its lists, changing them, and saving them
screenshotTaking a picture of the popup, from the popup, and writing it to the pictures folder
searchSearching for people and notes, and opening what is typed by its address
settingsChanging settings, and taking changes made elsewhere
shareCopying a link to a note that anyone can open
storeHaving the event store let go of what is old, once a day
threadOpening a note’s thread, and gathering its conversation
videoPlaying a video a note links to, and finding what there is to play of a YouTube one
zapZapping a note: asking for the invoice, and waiting for its receipt

What several of them do together, in order, is in crate::guide::flows.

Modules§

auth
Authentication message handlers for Avestruz.
bookmarks
Bookmark message handlers for Avestruz: what the account has bookmarked, and bookmarking a note or taking its bookmark off.
compose
Composer message handlers for Avestruz.
engagement
Engagement message handlers for Avestruz: what was made of the notes on show, and the account’s own reactions and reposts.
feed
Feed message handlers for Avestruz.
images
Image message handlers for Avestruz.
keys
The keyboard, on a list: stepping through its rows, opening the one the keyboard is at, showing the notes that wait, and going back.
media
The account’s media servers, and attaching files to what is being written.
navigation
Navigation message handlers for Avestruz.
notifications
Notification message handlers for Avestruz: finding out what others did that concerns the account, showing it, and keeping track of how much of it was looked at.
previews
Link preview message handlers for Avestruz.
profile
Profile message handlers for Avestruz.
relays
The account’s relays: where it writes, where it reads and where it searches, shown as its lists have them and changed there.
screenshot
A picture of the popup, taken by the popup itself: Ctrl+Shift+S.
search
Searching for people and notes.
settings
Settings message handlers for Avestruz.
share
Sharing a note: copying a link to it that anyone can open.
store
Store message handlers for Avestruz: having the event store let go of what it has kept for longer than the settings say (see crate::nostr::sweep).
thread
Thread message handlers for Avestruz.
video
Video message handlers for Avestruz.
zap
Zap message handlers for Avestruz.