Revert "feat: transitively trust images from parent note"

This reverts commit ea14713b58.
This commit is contained in:
kernelkind
2025-09-11 19:39:12 -04:00
parent a0e9c8b434
commit d6182ed7c3
3 changed files with 12 additions and 19 deletions

View File

@@ -410,7 +410,7 @@ impl<'a, 'd> PostView<'a, 'd> {
self.note_context,
txn,
id.bytes(),
None,
nostrdb::NoteKey::new(0),
self.note_options,
self.jobs,
)

View File

@@ -4,7 +4,7 @@ use crate::{
secondary_label,
};
use egui::{Color32, Hyperlink, Label, RichText};
use nostrdb::{BlockType, Mention, Note, Transaction};
use nostrdb::{BlockType, Mention, Note, NoteKey, Transaction};
use notedeck::Localization;
use notedeck::{time_format, update_imeta_blurhashes, NoteCache, NoteContext, NotedeckTextStyle};
use notedeck::{JobsCache, RenderableMedia};
@@ -81,7 +81,7 @@ pub fn render_note_preview(
note_context: &mut NoteContext,
txn: &Transaction,
id: &[u8; 32],
parent: Option<&Note>,
parent: NoteKey,
note_options: NoteOptions,
jobs: &mut JobsCache,
) -> NoteResponse {
@@ -112,12 +112,10 @@ pub fn render_note_preview(
*/
};
let mut view = NoteView::new(note_context, &note, note_options, jobs).preview_style();
if let Some(parent) = parent {
view = view.parent(parent);
}
view.show(ui)
NoteView::new(note_context, &note, note_options, jobs)
.preview_style()
.parent(parent)
.show(ui)
}
/// Render note contents and surrounding info (client name, full date timestamp)
@@ -357,7 +355,7 @@ fn render_undecorated_note_contents<'a>(
});
let preview_note_action = inline_note.and_then(|(id, _)| {
render_note_preview(ui, note_context, txn, id, Some(note), options, jobs)
render_note_preview(ui, note_context, txn, id, note_key, options, jobs)
.action
.map(|a| match a {
NoteAction::Note { note_id, .. } => NoteAction::Note {

View File

@@ -32,7 +32,7 @@ use notedeck::{
pub struct NoteView<'a, 'd> {
note_context: &'a mut NoteContext<'d>,
parent: Option<&'a Note<'a>>,
parent: Option<NoteKey>,
note: &'a nostrdb::Note<'a>,
flags: NoteOptions,
jobs: &'a mut JobsCache,
@@ -85,7 +85,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
flags: NoteOptions,
jobs: &'a mut JobsCache,
) -> Self {
let parent: Option<&Note> = None;
let parent: Option<NoteKey> = None;
Self {
note_context,
@@ -209,7 +209,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
}
#[inline]
pub fn parent(mut self, parent: &'a Note<'a>) -> Self {
pub fn parent(mut self, parent: NoteKey) -> Self {
self.parent = Some(parent);
self
}
@@ -576,12 +576,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
.ndb
.get_profile_by_pubkey(txn, self.note.pubkey());
let hitbox_id = note_hitbox_id(
note_key,
self.options(),
self.parent
.map(|n| n.key().expect("todo: support non-db notes")),
);
let hitbox_id = note_hitbox_id(note_key, self.options(), self.parent);
let maybe_hitbox = maybe_note_hitbox(ui, hitbox_id);
// wide design