Move chat to ui module
This commit is contained in:
parent
603876738f
commit
446e3e885a
11 changed files with 7 additions and 12 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
// TODO Clean up use and manipulation of toss Pos and Size
|
||||
|
||||
mod chat;
|
||||
mod euph;
|
||||
mod logger;
|
||||
mod replies;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
mod chat;
|
||||
mod room;
|
||||
mod rooms;
|
||||
mod util;
|
||||
|
|
@ -14,10 +15,10 @@ use tokio::task;
|
|||
use toss::frame::{Frame, Pos, Size};
|
||||
use toss::terminal::Terminal;
|
||||
|
||||
use crate::chat::Chat;
|
||||
use crate::logger::{LogMsg, Logger};
|
||||
use crate::vault::Vault;
|
||||
|
||||
use self::chat::Chat;
|
||||
use self::rooms::Rooms;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@ use std::sync::Arc;
|
|||
use parking_lot::FairMutex;
|
||||
use toss::terminal::Terminal;
|
||||
|
||||
use crate::chat::Cursor;
|
||||
use crate::store::{Msg, MsgStore};
|
||||
|
||||
use super::TreeView;
|
||||
use super::{Cursor, TreeView};
|
||||
|
||||
impl<M: Msg> TreeView<M> {
|
||||
fn prompt_msg(crossterm_lock: &Arc<FairMutex<()>>, terminal: &mut Terminal) -> Option<String> {
|
||||
|
|
@ -5,9 +5,7 @@ use std::collections::VecDeque;
|
|||
use chrono::{DateTime, Utc};
|
||||
use toss::styled::Styled;
|
||||
|
||||
use crate::chat::Cursor;
|
||||
|
||||
use super::util;
|
||||
use super::{util, Cursor};
|
||||
|
||||
pub struct Block<I> {
|
||||
pub id: I,
|
||||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
use toss::frame::{Frame, Size};
|
||||
|
||||
use crate::chat::Cursor;
|
||||
use crate::store::{Msg, MsgStore, Tree};
|
||||
|
||||
use super::blocks::Blocks;
|
||||
use super::{util, TreeView};
|
||||
use super::{util, Cursor, TreeView};
|
||||
|
||||
impl<M: Msg> TreeView<M> {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
use toss::frame::{Frame, Size};
|
||||
|
||||
use crate::chat::Cursor;
|
||||
use crate::store::{Msg, MsgStore, Tree};
|
||||
|
||||
use super::blocks::{Block, Blocks};
|
||||
use super::util::{self, MIN_CONTENT_WIDTH};
|
||||
use super::TreeView;
|
||||
use super::{Cursor, TreeView};
|
||||
|
||||
fn msg_to_block<M: Msg>(frame: &mut Frame, size: Size, msg: &M, indent: usize) -> Block<M::Id> {
|
||||
let nick = msg.nick();
|
||||
|
|
@ -6,10 +6,10 @@ use tokio::sync::mpsc;
|
|||
use toss::frame::{Frame, Pos, Size};
|
||||
use toss::terminal::Terminal;
|
||||
|
||||
use crate::chat::Chat;
|
||||
use crate::euph::{self, Status};
|
||||
use crate::vault::{EuphMsg, EuphVault};
|
||||
|
||||
use super::chat::Chat;
|
||||
use super::{util, UiEvent};
|
||||
|
||||
pub struct EuphRoom {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue