Skip to main content

Module feed

Module feed 

Source
Expand description

Feed message handlers for Avestruz.

The feed is the notes of the people the account follows. A profile has a list of its own, the notes of one person, and both are kept and filled the same way, as a FeedState. What the event store already holds of a list shows at once; the relays are then asked for the newest page, and for an older page each time the list is scrolled near its end. Nothing is fetched unasked after that: Refresh pulls the feed’s latest.

What a list shows is its reader’s: it only changes when they say so. The feed is looked at again every so often, and notes that turned up since wait beside it (Pending), offered by a button over the list; pressing it, or Refresh, shows them and goes to the top. Until then nothing is put in above what is being read, and nothing moves.

A list is read with replies or without (FeedMode), by a choice made above it and kept in the config. Read without, a page may bring nothing to show: the list then looks further back on its own, a few pages at most, and after that when asked.

Every list has an id of its own, and whatever is asked for it comes back with that id. An answer whose list is gone by then is dropped: a profile that was closed, a feed that started over.

Who the account follows is its contact list (kind 3), read from the store first and then asked of the relays. Whenever that answer changes — another account, or a newer list — the feed starts over, as a new list.

Constants§

NEW_NOTES_FRESH 🔒
How long after the feed was looked at for new notes it is not looked at again for the popup opening.

Functions§

fetch_error_text 🔒
Why a request to the relays failed, in the user’s language.
fetch_profiles 🔒
Ask the relays for the profiles of people: the account’s own, and, for those these don’t have, the relays those people write to, which take longer. Each answers when it has one.