Support displaying and editing room descriptions (#12)
This commit is contained in:
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 {
|
||||
|
||||
Reference in New Issue
Block a user