move aux code to bottom

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-06-25 16:25:43 -04:00
parent e8d833bf89
commit 41e141d9a9

View File

@@ -11,44 +11,6 @@ use std::collections::{BTreeMap, BTreeSet};
// TODO: remove this
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct SwitchAccountAction {
/// Some index representing the source of the action
pub source: Option<usize>,
/// The account index to switch to
pub switch_to: usize,
}
impl SwitchAccountAction {
pub fn new(source: Option<usize>, switch_to: usize) -> Self {
SwitchAccountAction { source, switch_to }
}
}
#[derive(Debug)]
pub enum AccountsAction {
Switch(SwitchAccountAction),
Remove(usize),
}
#[derive(Default)]
pub struct ContainsAccount {
pub has_nsec: bool,
pub index: usize,
}
#[must_use = "You must call process_login_action on this to handle unknown ids"]
pub struct AddAccountAction {
pub accounts_action: Option<AccountsAction>,
pub unk_id_action: SingleUnkIdAction,
}
pub struct AccountData {
pub(crate) relay: AccountRelayData,
pub(crate) muted: AccountMutedData,
}
/// The interface for managing the user's accounts.
/// Represents all user-facing operations related to account management.
pub struct Accounts {
@@ -675,3 +637,41 @@ impl AddAccountAction {
self.unk_id_action.process_action(ids, ndb, txn);
}
}
#[derive(Debug, Clone)]
pub struct SwitchAccountAction {
/// Some index representing the source of the action
pub source: Option<usize>,
/// The account index to switch to
pub switch_to: usize,
}
impl SwitchAccountAction {
pub fn new(source: Option<usize>, switch_to: usize) -> Self {
SwitchAccountAction { source, switch_to }
}
}
#[derive(Debug)]
pub enum AccountsAction {
Switch(SwitchAccountAction),
Remove(usize),
}
#[derive(Default)]
pub struct ContainsAccount {
pub has_nsec: bool,
pub index: usize,
}
#[must_use = "You must call process_login_action on this to handle unknown ids"]
pub struct AddAccountAction {
pub accounts_action: Option<AccountsAction>,
pub unk_id_action: SingleUnkIdAction,
}
pub struct AccountData {
pub(crate) relay: AccountRelayData,
pub(crate) muted: AccountMutedData,
}