post quote reposts impl
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user