rename ImageCache -> MediaCache
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -8,11 +8,11 @@ use egui::{Color32, Hyperlink, Image, RichText};
|
||||
use nostrdb::{BlockType, Mention, Ndb, Note, NoteKey, Transaction};
|
||||
use tracing::warn;
|
||||
|
||||
use notedeck::{ImageCache, NoteCache};
|
||||
use notedeck::{MediaCache, NoteCache};
|
||||
|
||||
pub struct NoteContents<'a> {
|
||||
ndb: &'a Ndb,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note_cache: &'a mut NoteCache,
|
||||
txn: &'a Transaction,
|
||||
note: &'a Note<'a>,
|
||||
@@ -24,7 +24,7 @@ pub struct NoteContents<'a> {
|
||||
impl<'a> NoteContents<'a> {
|
||||
pub fn new(
|
||||
ndb: &'a Ndb,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note_cache: &'a mut NoteCache,
|
||||
txn: &'a Transaction,
|
||||
note: &'a Note,
|
||||
@@ -72,7 +72,7 @@ pub fn render_note_preview(
|
||||
ui: &mut egui::Ui,
|
||||
ndb: &Ndb,
|
||||
note_cache: &mut NoteCache,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
txn: &Transaction,
|
||||
id: &[u8; 32],
|
||||
parent: NoteKey,
|
||||
@@ -134,7 +134,7 @@ fn is_image_link(url: &str) -> bool {
|
||||
fn render_note_contents(
|
||||
ui: &mut egui::Ui,
|
||||
ndb: &Ndb,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
note_cache: &mut NoteCache,
|
||||
txn: &Transaction,
|
||||
note: &Note,
|
||||
@@ -279,7 +279,7 @@ fn rot13(input: &str) -> String {
|
||||
|
||||
fn image_carousel(
|
||||
ui: &mut egui::Ui,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
images: Vec<String>,
|
||||
carousel_id: egui::Id,
|
||||
) {
|
||||
|
||||
@@ -25,14 +25,14 @@ use egui::emath::{pos2, Vec2};
|
||||
use egui::{Id, Label, Pos2, Rect, Response, RichText, Sense};
|
||||
use enostr::{NoteId, Pubkey};
|
||||
use nostrdb::{Ndb, Note, NoteKey, Transaction};
|
||||
use notedeck::{CachedNote, ImageCache, NoteCache, NotedeckTextStyle};
|
||||
use notedeck::{CachedNote, MediaCache, NoteCache, NotedeckTextStyle};
|
||||
|
||||
use super::profile::preview::one_line_display_name_widget;
|
||||
|
||||
pub struct NoteView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
parent: Option<NoteKey>,
|
||||
note: &'a nostrdb::Note<'a>,
|
||||
flags: NoteOptions,
|
||||
@@ -74,7 +74,7 @@ impl<'a> NoteView<'a> {
|
||||
pub fn new(
|
||||
ndb: &'a Ndb,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note: &'a nostrdb::Note<'a>,
|
||||
mut flags: NoteOptions,
|
||||
) -> Self {
|
||||
|
||||
@@ -13,7 +13,7 @@ use egui::{vec2, Frame, Layout, Margin, Pos2, ScrollArea, Sense, TextBuffer};
|
||||
use enostr::{FilledKeypair, FullKeypair, NoteId, Pubkey, RelayPool};
|
||||
use nostrdb::{Ndb, Transaction};
|
||||
|
||||
use notedeck::{ImageCache, NoteCache};
|
||||
use notedeck::{MediaCache, NoteCache};
|
||||
use tracing::error;
|
||||
|
||||
use super::contents::render_note_preview;
|
||||
@@ -22,7 +22,7 @@ pub struct PostView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
draft: &'a mut Draft,
|
||||
post_type: PostType,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note_cache: &'a mut NoteCache,
|
||||
poster: FilledKeypair<'a>,
|
||||
id_source: Option<egui::Id>,
|
||||
@@ -88,7 +88,7 @@ impl<'a> PostView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
draft: &'a mut Draft,
|
||||
post_type: PostType,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note_cache: &'a mut NoteCache,
|
||||
poster: FilledKeypair<'a>,
|
||||
inner_rect: egui::Rect,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use enostr::{FilledKeypair, NoteId};
|
||||
use nostrdb::Ndb;
|
||||
use notedeck::{ImageCache, NoteCache};
|
||||
use notedeck::{MediaCache, NoteCache};
|
||||
|
||||
use crate::{
|
||||
draft::Draft,
|
||||
@@ -13,7 +13,7 @@ pub struct QuoteRepostView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
poster: FilledKeypair<'a>,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
draft: &'a mut Draft,
|
||||
quoting_note: &'a nostrdb::Note<'a>,
|
||||
id_source: Option<egui::Id>,
|
||||
@@ -27,7 +27,7 @@ impl<'a> QuoteRepostView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
poster: FilledKeypair<'a>,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
draft: &'a mut Draft,
|
||||
quoting_note: &'a nostrdb::Note<'a>,
|
||||
inner_rect: egui::Rect,
|
||||
|
||||
@@ -4,13 +4,13 @@ use crate::ui::note::{NoteOptions, PostResponse, PostType};
|
||||
use enostr::{FilledKeypair, NoteId};
|
||||
use nostrdb::Ndb;
|
||||
|
||||
use notedeck::{ImageCache, NoteCache};
|
||||
use notedeck::{MediaCache, NoteCache};
|
||||
|
||||
pub struct PostReplyView<'a> {
|
||||
ndb: &'a Ndb,
|
||||
poster: FilledKeypair<'a>,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
draft: &'a mut Draft,
|
||||
note: &'a nostrdb::Note<'a>,
|
||||
id_source: Option<egui::Id>,
|
||||
@@ -25,7 +25,7 @@ impl<'a> PostReplyView<'a> {
|
||||
poster: FilledKeypair<'a>,
|
||||
draft: &'a mut Draft,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
note: &'a nostrdb::Note<'a>,
|
||||
inner_rect: egui::Rect,
|
||||
note_options: NoteOptions,
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::{
|
||||
};
|
||||
use egui::{Label, RichText, Sense};
|
||||
use nostrdb::{Ndb, Note, NoteReply, Transaction};
|
||||
use notedeck::{ImageCache, NoteCache};
|
||||
use notedeck::{MediaCache, NoteCache};
|
||||
|
||||
#[must_use = "Please handle the resulting note action"]
|
||||
pub fn reply_desc(
|
||||
@@ -12,7 +12,7 @@ pub fn reply_desc(
|
||||
txn: &Transaction,
|
||||
note_reply: &NoteReply,
|
||||
ndb: &Ndb,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
note_cache: &mut NoteCache,
|
||||
note_options: NoteOptions,
|
||||
) -> Option<NoteAction> {
|
||||
@@ -29,7 +29,7 @@ pub fn reply_desc(
|
||||
// note link renderer helper
|
||||
let note_link = |ui: &mut egui::Ui,
|
||||
note_cache: &mut NoteCache,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
text: &str,
|
||||
note: &Note<'_>| {
|
||||
let r = ui.add(
|
||||
|
||||
Reference in New Issue
Block a user