Move ChatMsg trait to chat2
This commit is contained in:
parent
6f0088e194
commit
e2b75d2f52
2 changed files with 11 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ use crate::macros::{logging_unwrap, ok_or_return, some_or_return};
|
|||
use crate::util::InfallibleExt;
|
||||
use crate::vault::Vault;
|
||||
|
||||
pub use self::chat::ChatMsg;
|
||||
pub use self::chat2::ChatMsg;
|
||||
use self::chat2::ChatState;
|
||||
use self::input::{key, InputEvent, KeyBindingsList};
|
||||
use self::rooms::Rooms;
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ use std::io;
|
|||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::FairMutex;
|
||||
use time::OffsetDateTime;
|
||||
use toss::widgets::{BoxedAsync, EditorState};
|
||||
use toss::{Terminal, WidgetExt};
|
||||
use toss::{Styled, Terminal, WidgetExt};
|
||||
|
||||
use crate::store::{Msg, MsgStore};
|
||||
|
||||
|
|
@ -17,7 +18,14 @@ use self::cursor::Cursor;
|
|||
use self::tree::TreeViewState;
|
||||
|
||||
use super::input::{InputEvent, KeyBindingsList};
|
||||
use super::{ChatMsg, UiError};
|
||||
use super::UiError;
|
||||
|
||||
pub trait ChatMsg {
|
||||
fn time(&self) -> OffsetDateTime;
|
||||
fn styled(&self) -> (Styled, Styled);
|
||||
fn edit(nick: &str, content: &str) -> (Styled, Styled);
|
||||
fn pseudo(nick: &str, content: &str) -> (Styled, Styled);
|
||||
}
|
||||
|
||||
pub enum Mode {
|
||||
Tree,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue