mutes: hide logs

these are getting spammed on each frame. not ideal

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-01-19 12:40:00 -08:00
parent 9a48b12e36
commit a94ebc3603

View File

@@ -1,7 +1,7 @@
use nostrdb::Note; use nostrdb::Note;
use std::collections::BTreeSet; use std::collections::BTreeSet;
use tracing::{debug, trace}; //use tracing::{debug, trace};
// If the note is muted return a reason string, otherwise None // If the note is muted return a reason string, otherwise None
pub type MuteFun = dyn Fn(&Note, &[u8; 32]) -> bool; pub type MuteFun = dyn Fn(&Note, &[u8; 32]) -> bool;
@@ -35,18 +35,22 @@ impl std::fmt::Debug for Muted {
impl Muted { impl Muted {
// If the note is muted return a reason string, otherwise None // If the note is muted return a reason string, otherwise None
pub fn is_muted(&self, note: &Note, thread: &[u8; 32]) -> bool { pub fn is_muted(&self, note: &Note, thread: &[u8; 32]) -> bool {
/*
trace!( trace!(
"{}: thread: {}", "{}: thread: {}",
hex::encode(note.id()), hex::encode(note.id()),
hex::encode(thread) hex::encode(thread)
); );
*/
if self.pubkeys.contains(note.pubkey()) { if self.pubkeys.contains(note.pubkey()) {
debug!( /*
trace!(
"{}: MUTED pubkey: {}", "{}: MUTED pubkey: {}",
hex::encode(note.id()), hex::encode(note.id()),
hex::encode(note.pubkey()) hex::encode(note.pubkey())
); );
*/
return true; return true;
} }
// FIXME - Implement hashtag muting here // FIXME - Implement hashtag muting here
@@ -64,11 +68,13 @@ impl Muted {
// } // }
if self.threads.contains(thread) { if self.threads.contains(thread) {
debug!( /*
trace!(
"{}: MUTED thread: {}", "{}: MUTED thread: {}",
hex::encode(note.id()), hex::encode(note.id()),
hex::encode(thread) hex::encode(thread)
); );
*/
return true; return true;
} }