Render room list with new generic list
This commit is contained in:
parent
8b7c58b702
commit
7f1dc020d3
3 changed files with 152 additions and 126 deletions
|
|
@ -348,3 +348,24 @@ impl Time {
|
|||
/// fixed format for the unique value.
|
||||
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct UserId(pub String);
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum SessionType {
|
||||
Agent,
|
||||
Account,
|
||||
Bot,
|
||||
}
|
||||
|
||||
impl UserId {
|
||||
pub fn session_type(&self) -> Option<SessionType> {
|
||||
if self.0.starts_with("agent:") {
|
||||
Some(SessionType::Agent)
|
||||
} else if self.0.starts_with("account:") {
|
||||
Some(SessionType::Account)
|
||||
} else if self.0.starts_with("bot:") {
|
||||
Some(SessionType::Bot)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue