2024-08-09 00:40:33 +02:00
|
|
|
use codemp_proto::workspace::workspace_event::Event as WorkspaceEventInner;
|
|
|
|
|
|
|
|
pub enum Event {
|
|
|
|
FileTreeUpdated,
|
|
|
|
UserJoin(String),
|
|
|
|
UserLeave(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<&WorkspaceEventInner> for Event {
|
|
|
|
fn from(event: &WorkspaceEventInner) -> Self {
|
|
|
|
match event {
|
|
|
|
WorkspaceEventInner::Join(e) => Self::UserJoin(e.user.id.clone()),
|
|
|
|
WorkspaceEventInner::Leave(e) => Self::UserLeave(e.user.id.clone()),
|
|
|
|
WorkspaceEventInner::Create(_)
|
|
|
|
| WorkspaceEventInner::Rename(_)
|
2024-08-15 17:58:02 +02:00
|
|
|
| WorkspaceEventInner::Delete(_) => Self::FileTreeUpdated,
|
2024-08-09 00:40:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|