mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 17:14:21 +01:00
move aux code to bottom
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -11,44 +11,6 @@ use std::collections::{BTreeMap, BTreeSet};
|
|||||||
// TODO: remove this
|
// TODO: remove this
|
||||||
use std::sync::Arc;
|
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.
|
/// The interface for managing the user's accounts.
|
||||||
/// Represents all user-facing operations related to account management.
|
/// Represents all user-facing operations related to account management.
|
||||||
pub struct Accounts {
|
pub struct Accounts {
|
||||||
@@ -675,3 +637,41 @@ impl AddAccountAction {
|
|||||||
self.unk_id_action.process_action(ids, ndb, txn);
|
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,
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user