Fix(squas): Hi!

This commit is contained in:
Benedikt Peetz 2023-07-09 09:11:56 +02:00
parent e36fadbb72
commit c814426905
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
5 changed files with 27 additions and 24 deletions

View File

@ -1,3 +1,5 @@
use std::fs;
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use cli_log::{error, info, warn}; use cli_log::{error, info, warn};
use matrix_sdk::{ use matrix_sdk::{
@ -6,7 +8,6 @@ use matrix_sdk::{
Client, Session, Client, Session,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fs;
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Account { pub struct Account {

View File

@ -1,8 +1,3 @@
use crate::app::{
status::{State, Status},
App,
};
use crate::ui;
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use cli_log::{error, info, warn}; use cli_log::{error, info, warn};
use matrix_sdk::{ use matrix_sdk::{
@ -14,10 +9,20 @@ use matrix_sdk::{
}, },
Client, LoopCtrl, Client, LoopCtrl,
}; };
use tokio::sync::{broadcast, mpsc}; use tokio::{
use tokio::time::Duration; sync::{broadcast, mpsc},
time::Duration,
};
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use crate::{
app::{
status::{State, Status},
App,
},
ui,
};
#[derive(Debug)] #[derive(Debug)]
pub enum EventStatus { pub enum EventStatus {
Ok, Ok,

View File

@ -1,11 +1,9 @@
pub mod event; pub mod event;
pub mod status; pub mod status;
use crate::accounts; use std::path::Path;
use crate::ui;
use accounts::Account; use accounts::{Account, AccountsManager};
use accounts::AccountsManager;
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use cli_log::{error, info, warn}; use cli_log::{error, info, warn};
use matrix_sdk::{ use matrix_sdk::{
@ -19,13 +17,14 @@ use matrix_sdk::{
Client, Client,
}; };
use status::{State, Status}; use status::{State, Status};
use std::path::Path;
use tokio::{ use tokio::{
sync::{broadcast, mpsc}, sync::{broadcast, mpsc},
time::{sleep, Duration}, time::{sleep, Duration},
}; };
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use crate::{accounts, ui};
pub struct App<'a> { pub struct App<'a> {
ui: ui::UI<'a>, ui: ui::UI<'a>,
accounts_manager: accounts::AccountsManager, accounts_manager: accounts::AccountsManager,

View File

@ -1,3 +1,5 @@
use std::any::Any;
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use cli_log::{error, info, warn}; use cli_log::{error, info, warn};
use indexmap::IndexMap; use indexmap::IndexMap;
@ -9,7 +11,6 @@ use matrix_sdk::{
}, },
Client, Client,
}; };
use std::any::Any;
pub enum State { pub enum State {
None, None,

View File

@ -1,4 +1,4 @@
use crate::app::status::Status; use std::{cmp, io, io::Stdout};
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use cli_log::{error, info, warn}; use cli_log::{error, info, warn};
@ -12,21 +12,18 @@ use matrix_sdk::{
room::MessagesOptions, room::MessagesOptions,
ruma::events::{AnyMessageLikeEvent, AnyTimelineEvent}, ruma::events::{AnyMessageLikeEvent, AnyTimelineEvent},
}; };
use std::cmp;
use std::io;
use std::io::Stdout;
use tui::layout::{Alignment, Corner};
use tui::style::{Color, Modifier, Style};
use tui::text::{Span, Spans, Text};
use tui::widgets::{List, ListItem, ListState, Paragraph, Wrap};
use tui::{ use tui::{
backend::CrosstermBackend, backend::CrosstermBackend,
layout::{Constraint, Direction, Layout}, layout::{Alignment, Constraint, Corner, Direction, Layout},
widgets::{Block, Borders, Widget}, style::{Color, Modifier, Style},
text::{Span, Spans, Text},
widgets::{Block, Borders, List, ListItem, ListState, Paragraph, Widget, Wrap},
Frame, Terminal, Frame, Terminal,
}; };
use tui_textarea::{Input, Key, TextArea}; use tui_textarea::{Input, Key, TextArea};
use crate::app::status::Status;
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub enum SetupInputPosition { pub enum SetupInputPosition {
Homeserver, Homeserver,