add Accounts to NoteContext
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -6,13 +6,12 @@ use crate::{
|
||||
};
|
||||
|
||||
use enostr::Pubkey;
|
||||
use notedeck::{Accounts, MuteFun, NoteContext};
|
||||
use notedeck::{MuteFun, NoteContext};
|
||||
use notedeck_ui::{jobs::JobsCache, NoteOptions};
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn render_timeline_route(
|
||||
timeline_cache: &mut TimelineCache,
|
||||
accounts: &mut Accounts,
|
||||
kind: &TimelineKind,
|
||||
col: usize,
|
||||
note_options: NoteOptions,
|
||||
@@ -32,10 +31,9 @@ pub fn render_timeline_route(
|
||||
let note_action = ui::TimelineView::new(
|
||||
kind,
|
||||
timeline_cache,
|
||||
&accounts.mutefun(),
|
||||
¬e_context.accounts.mutefun(),
|
||||
note_context,
|
||||
note_options,
|
||||
&(&accounts.get_selected_account().key).into(),
|
||||
jobs,
|
||||
)
|
||||
.ui(ui);
|
||||
@@ -47,11 +45,10 @@ pub fn render_timeline_route(
|
||||
if depth > 1 {
|
||||
render_profile_route(
|
||||
pubkey,
|
||||
accounts,
|
||||
timeline_cache,
|
||||
col,
|
||||
ui,
|
||||
&accounts.mutefun(),
|
||||
¬e_context.accounts.mutefun(),
|
||||
note_options,
|
||||
note_context,
|
||||
jobs,
|
||||
@@ -61,10 +58,9 @@ pub fn render_timeline_route(
|
||||
let note_action = ui::TimelineView::new(
|
||||
kind,
|
||||
timeline_cache,
|
||||
&accounts.mutefun(),
|
||||
¬e_context.accounts.mutefun(),
|
||||
note_context,
|
||||
note_options,
|
||||
&(&accounts.get_selected_account().key).into(),
|
||||
jobs,
|
||||
)
|
||||
.ui(ui);
|
||||
@@ -78,7 +74,6 @@ pub fn render_timeline_route(
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn render_thread_route(
|
||||
threads: &mut Threads,
|
||||
accounts: &mut Accounts,
|
||||
selection: &ThreadSelection,
|
||||
col: usize,
|
||||
mut note_options: NoteOptions,
|
||||
@@ -94,9 +89,8 @@ pub fn render_thread_route(
|
||||
threads,
|
||||
selection.selected_or_root(),
|
||||
note_options,
|
||||
&accounts.mutefun(),
|
||||
¬e_context.accounts.mutefun(),
|
||||
note_context,
|
||||
&(&accounts.get_selected_account().key).into(),
|
||||
jobs,
|
||||
)
|
||||
.id_source(col)
|
||||
@@ -107,7 +101,6 @@ pub fn render_thread_route(
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn render_profile_route(
|
||||
pubkey: &Pubkey,
|
||||
accounts: &Accounts,
|
||||
timeline_cache: &mut TimelineCache,
|
||||
col: usize,
|
||||
ui: &mut egui::Ui,
|
||||
@@ -118,7 +111,6 @@ pub fn render_profile_route(
|
||||
) -> Option<RenderNavAction> {
|
||||
let profile_view = ProfileView::new(
|
||||
pubkey,
|
||||
accounts,
|
||||
col,
|
||||
timeline_cache,
|
||||
note_options,
|
||||
@@ -130,7 +122,8 @@ pub fn render_profile_route(
|
||||
|
||||
if let Some(action) = profile_view {
|
||||
match action {
|
||||
ui::profile::ProfileViewAction::EditProfile => accounts
|
||||
ui::profile::ProfileViewAction::EditProfile => note_context
|
||||
.accounts
|
||||
.get_full(pubkey)
|
||||
.map(|kp| RenderNavAction::ProfileAction(ProfileAction::Edit(kp.to_full()))),
|
||||
ui::profile::ProfileViewAction::Note(note_action) => {
|
||||
|
||||
Reference in New Issue
Block a user