mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Add ban/unban/kick room commands (#327)
This commit is contained in:
parent
2a66496913
commit
df3896df9c
4 changed files with 145 additions and 0 deletions
21
src/base.rs
21
src/base.rs
|
@ -391,6 +391,24 @@ pub enum RoomField {
|
|||
CanonicalAlias,
|
||||
}
|
||||
|
||||
/// An action that operates on a room member.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum MemberUpdateAction {
|
||||
Ban,
|
||||
Kick,
|
||||
Unban,
|
||||
}
|
||||
|
||||
impl Display for MemberUpdateAction {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
MemberUpdateAction::Ban => write!(f, "ban"),
|
||||
MemberUpdateAction::Kick => write!(f, "kick"),
|
||||
MemberUpdateAction::Unban => write!(f, "unban"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An action that operates on a focused room.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum RoomAction {
|
||||
|
@ -406,6 +424,9 @@ pub enum RoomAction {
|
|||
/// Leave this room.
|
||||
Leave(bool),
|
||||
|
||||
/// Update a user's membership in this room.
|
||||
MemberUpdate(MemberUpdateAction, String, Option<String>, bool),
|
||||
|
||||
/// Open the members window.
|
||||
Members(Box<CommandContext>),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue