From 7b1ace328f005dfede1b7d479fdf28553414c3af Mon Sep 17 00:00:00 2001 From: kernelkind Date: Sun, 24 Aug 2025 23:14:53 -0400 Subject: [PATCH] add muted helper Signed-off-by: kernelkind --- crates/notedeck/src/account/accounts.rs | 5 +++++ crates/notedeck/src/muted.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/crates/notedeck/src/account/accounts.rs b/crates/notedeck/src/account/accounts.rs index 0b72fcce..41206f45 100644 --- a/crates/notedeck/src/account/accounts.rs +++ b/crates/notedeck/src/account/accounts.rs @@ -267,6 +267,11 @@ impl Accounts { Box::new(move |note: &Note, thread: &[u8; 32]| muted.is_muted(note, thread)) } + pub fn mute(&self) -> Box> { + let account_data = self.get_selected_account_data(); + Box::new(Arc::clone(&account_data.muted.muted)) + } + pub fn send_initial_filters(&mut self, pool: &mut RelayPool, relay_url: &str) { let data = &self.get_selected_account().data; // send the active account's relay list subscription diff --git a/crates/notedeck/src/muted.rs b/crates/notedeck/src/muted.rs index 3d038033..2b0b6d93 100644 --- a/crates/notedeck/src/muted.rs +++ b/crates/notedeck/src/muted.rs @@ -80,4 +80,8 @@ impl Muted { false } + + pub fn is_pk_muted(&self, pk: &[u8; 32]) -> bool { + self.pubkeys.contains(pk) + } }