Skip to main content

Module drafts

Module drafts 

Source
Expand description

What has been written and not published: one text for each thing that can be written to.

Leaving the composer keeps the text, so that coming back to the same note finds it. What is kept here lasts as long as the session. What is there after a restart is what the relay Avestruz runs itself keeps (see crate::nostr::kept_drafts), which every draft is sent to when the composer is left; and, when that relay can’t be given the draft of a new note, the file that draft was kept in before there was such a relay.

Structs§

Drafts
The unpublished text for each target that has any.

Functions§

default_draft_path
Where the draft of a new note is kept: the user’s data directory, beside the event store.
load
The draft kept at path. No file is no draft.
save
Keep text at path as the draft of a new note. A blank text is no draft, and takes the file away.
write 🔒
Write text to path in a way that leaves either the old draft or the new one, never half of one.