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:
@@ -1,7 +1,7 @@
|
||||
use enostr::{Filter, Pubkey};
|
||||
use nostrdb::{FilterBuilder, Ndb, ProfileRecord, Transaction};
|
||||
|
||||
use notedeck::{filter::default_limit, FilterState, MuteFun, NoteCache, NoteRef};
|
||||
use notedeck::{filter::default_limit, FilterState, NoteCache, NoteRef};
|
||||
|
||||
use crate::{
|
||||
multi_subscriber::MultiSubscriber,
|
||||
@@ -60,7 +60,6 @@ impl Profile {
|
||||
source: PubkeySource,
|
||||
filters: Vec<Filter>,
|
||||
notes: Vec<NoteRef>,
|
||||
is_muted: &MuteFun,
|
||||
) -> Self {
|
||||
let mut timeline = Timeline::new(
|
||||
TimelineKind::profile(source),
|
||||
@@ -68,7 +67,7 @@ impl Profile {
|
||||
TimelineTab::full_tabs(),
|
||||
);
|
||||
|
||||
copy_notes_into_timeline(&mut timeline, txn, ndb, note_cache, notes, is_muted);
|
||||
copy_notes_into_timeline(&mut timeline, txn, ndb, note_cache, notes);
|
||||
|
||||
Profile {
|
||||
timeline,
|
||||
@@ -114,7 +113,6 @@ impl NotesHolder for Profile {
|
||||
id: &[u8; 32],
|
||||
filters: Vec<Filter>,
|
||||
notes: Vec<NoteRef>,
|
||||
is_muted: &MuteFun,
|
||||
) -> Self {
|
||||
Profile::new(
|
||||
txn,
|
||||
@@ -123,7 +121,6 @@ impl NotesHolder for Profile {
|
||||
PubkeySource::Explicit(Pubkey::new(*id)),
|
||||
filters,
|
||||
notes,
|
||||
is_muted,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user