Rename room
crate to call
Also, rename `client::Call` to `client::IncomingCall`. Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
1158911560
commit
e0db62173a
13 changed files with 49 additions and 43 deletions
31
crates/call/src/participant.rs
Normal file
31
crates/call/src/participant.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
use anyhow::{anyhow, Result};
|
||||
use client::proto;
|
||||
use gpui::ModelHandle;
|
||||
use project::Project;
|
||||
|
||||
pub enum ParticipantLocation {
|
||||
Project { project_id: u64 },
|
||||
External,
|
||||
}
|
||||
|
||||
impl ParticipantLocation {
|
||||
pub fn from_proto(location: Option<proto::ParticipantLocation>) -> Result<Self> {
|
||||
match location.and_then(|l| l.variant) {
|
||||
Some(proto::participant_location::Variant::Project(project)) => Ok(Self::Project {
|
||||
project_id: project.id,
|
||||
}),
|
||||
Some(proto::participant_location::Variant::External(_)) => Ok(Self::External),
|
||||
None => Err(anyhow!("participant location was not provided")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct LocalParticipant {
|
||||
pub projects: Vec<ModelHandle<Project>>,
|
||||
}
|
||||
|
||||
pub struct RemoteParticipant {
|
||||
pub user_id: u64,
|
||||
pub projects: Vec<ModelHandle<Project>>,
|
||||
pub location: ParticipantLocation,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue