post quote reposts impl

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-09-17 12:20:29 -04:00
parent 8e32f757f0
commit de9e0e4ca1
12 changed files with 275 additions and 20 deletions

View File

@@ -8,6 +8,7 @@ pub struct Draft {
#[derive(Default)]
pub struct Drafts {
replies: HashMap<[u8; 32], Draft>,
quotes: HashMap<[u8; 32], Draft>,
compose: Draft,
}
@@ -19,14 +20,19 @@ impl Drafts {
pub fn reply_mut(&mut self, id: &[u8; 32]) -> &mut Draft {
self.replies.entry(*id).or_default()
}
pub fn quote_mut(&mut self, id: &[u8; 32]) -> &mut Draft {
self.quotes.entry(*id).or_default()
}
}
/*
pub enum DraftSource<'a> {
Compose,
Reply(&'a [u8; 32]), // note id
Quote(&'a [u8; 32]), // note id
}
/*
impl<'a> DraftSource<'a> {
pub fn draft(&self, drafts: &'a mut Drafts) -> &'a mut Draft {
match self {