Mute rendering instead of ingress

Previous approach was to keep muted content from getting inserted.

Instead, this version alters it's display.  This makes toggling mutes
on and off externally much more stable (the display changes but we
don't have to rebuild content trees)

For now muted content is collapsed to a red "Muted" tombstone w/ a reason.
This commit is contained in:
Ken Sedgwick
2024-12-19 15:27:26 -08:00
parent 2d7de8fdc0
commit e193e00539
15 changed files with 93 additions and 125 deletions

View File

@@ -4,7 +4,7 @@ use tracing::{debug, error, info};
use uuid::Uuid;
use crate::Error;
use notedeck::{MuteFun, NoteRef, UnifiedSubscription};
use notedeck::{NoteRef, UnifiedSubscription};
pub struct MultiSubscriber {
filters: Vec<Filter>,
@@ -106,12 +106,7 @@ impl MultiSubscriber {
}
}
pub fn poll_for_notes(
&mut self,
ndb: &Ndb,
txn: &Transaction,
is_muted: &MuteFun,
) -> Result<Vec<NoteRef>, Error> {
pub fn poll_for_notes(&mut self, ndb: &Ndb, txn: &Transaction) -> Result<Vec<NoteRef>, Error> {
let sub = self.sub.as_ref().ok_or(notedeck::Error::no_active_sub())?;
let new_note_keys = ndb.poll_for_notes(sub.local, 500);
@@ -129,10 +124,6 @@ impl MultiSubscriber {
continue;
};
if is_muted(&note) {
continue;
}
notes.push(note);
}