feat: enable transitive trust for repost

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-09-11 19:38:32 -04:00
parent 4ac2e59983
commit a0e9c8b434

View File

@@ -734,7 +734,7 @@ fn render_reaction_cluster(
fn render_composite_entry( fn render_composite_entry(
ui: &mut egui::Ui, ui: &mut egui::Ui,
note_context: &mut NoteContext, note_context: &mut NoteContext,
note_options: NoteOptions, mut note_options: NoteOptions,
jobs: &mut JobsCache, jobs: &mut JobsCache,
underlying_note: &nostrdb::Note<'_>, underlying_note: &nostrdb::Note<'_>,
profiles_to_show: Vec<ProfileEntry>, profiles_to_show: Vec<ProfileEntry>,
@@ -760,6 +760,16 @@ fn render_composite_entry(
ReferencedNoteType::Yours ReferencedNoteType::Yours
}; };
if !note_options.contains(NoteOptions::TrustMedia) {
let acc = note_context.accounts.get_selected_account();
for entry in &profiles_to_show {
if matches!(acc.is_following(entry.pk), notedeck::IsFollowing::Yes) {
note_options = note_options.union(NoteOptions::TrustMedia);
break;
}
}
}
egui::Frame::new() egui::Frame::new()
.inner_margin(Margin::symmetric(8, 4)) .inner_margin(Margin::symmetric(8, 4))
.show(ui, |ui| { .show(ui, |ui| {
@@ -838,15 +848,14 @@ fn render_composite_entry(
let resp = ui let resp = ui
.horizontal(|ui| { .horizontal(|ui| {
let mut options = note_options; if note_options.contains(NoteOptions::Notification) {
if options.contains(NoteOptions::Notification) { note_options = note_options
options = options
.difference(NoteOptions::ActionBar | NoteOptions::OptionsButton) .difference(NoteOptions::ActionBar | NoteOptions::OptionsButton)
.union(NoteOptions::NotificationPreview); .union(NoteOptions::NotificationPreview);
ui.add_space(48.0); ui.add_space(48.0);
}; };
NoteView::new(note_context, underlying_note, options, jobs).show(ui) NoteView::new(note_context, underlying_note, note_options, jobs).show(ui)
}) })
.inner; .inner;