Support composing messages in an external editor (#155)

This commit is contained in:
Leonid Dyachkov 2023-09-10 16:45:27 +03:00 committed by Ulyssa
parent 47e650c2be
commit 0565b6eb05
No known key found for this signature in database
GPG key ID: F2873CA2997B83C5
6 changed files with 141 additions and 19 deletions

View file

@ -202,6 +202,7 @@ pub enum RoomAction {
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum SendAction {
Submit,
SubmitFromEditor,
Upload(String),
UploadImage(usize, usize, Cow<'static, [u8]>),
}
@ -222,6 +223,16 @@ pub enum IambAction {
ToggleScrollbackFocus,
}
impl IambAction {
/// Indicates whether this action will draw over the screen.
pub fn scribbles(&self) -> bool {
match self {
IambAction::Send(SendAction::SubmitFromEditor) => true,
_ => false,
}
}
}
impl From<HomeserverAction> for IambAction {
fn from(act: HomeserverAction) -> Self {
IambAction::Homeserver(act)