mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Support displaying and editing room descriptions (#12)
This commit is contained in:
parent
8ed037afca
commit
38f4795886
13 changed files with 286 additions and 55 deletions
19
src/base.rs
19
src/base.rs
|
@ -59,9 +59,22 @@ pub enum VerifyAction {
|
|||
Mismatch,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum SetRoomField {
|
||||
Name(String),
|
||||
Topic(String),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum RoomAction {
|
||||
Members(Box<CommandContext<ProgramContext>>),
|
||||
Set(SetRoomField),
|
||||
}
|
||||
|
||||
impl From<SetRoomField> for RoomAction {
|
||||
fn from(act: SetRoomField) -> Self {
|
||||
RoomAction::Set(act)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
|
@ -73,6 +86,12 @@ pub enum IambAction {
|
|||
ToggleScrollbackFocus,
|
||||
}
|
||||
|
||||
impl From<RoomAction> for IambAction {
|
||||
fn from(act: RoomAction) -> Self {
|
||||
IambAction::Room(act)
|
||||
}
|
||||
}
|
||||
|
||||
impl ApplicationAction for IambAction {
|
||||
fn is_edit_sequence<C: EditContext>(&self, _: &C) -> SequenceStatus {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue