Move IncomingCall into call crate

This commit is contained in:
Antonio Scandurra 2022-10-06 09:52:03 +02:00
parent 55cc142319
commit 7763acbdd5
5 changed files with 15 additions and 16 deletions

View File

@ -2,7 +2,7 @@ mod participant;
pub mod room;
use anyhow::{anyhow, Result};
use client::{incoming_call::IncomingCall, proto, Client, TypedEnvelope, UserStore};
use client::{proto, Client, TypedEnvelope, User, UserStore};
use gpui::{
AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, MutableAppContext,
Subscription, Task,
@ -18,6 +18,14 @@ pub fn init(client: Arc<Client>, user_store: ModelHandle<UserStore>, cx: &mut Mu
cx.set_global(active_call);
}
#[derive(Clone)]
pub struct IncomingCall {
pub room_id: u64,
pub caller: Arc<User>,
pub participants: Vec<Arc<User>>,
pub initial_project_id: Option<u64>,
}
pub struct ActiveCall {
room: Option<(ModelHandle<Room>, Vec<Subscription>)>,
incoming_call: (

View File

@ -1,6 +1,9 @@
use crate::participant::{ParticipantLocation, RemoteParticipant};
use crate::{
participant::{ParticipantLocation, RemoteParticipant},
IncomingCall,
};
use anyhow::{anyhow, Result};
use client::{incoming_call::IncomingCall, proto, Client, PeerId, TypedEnvelope, User, UserStore};
use client::{proto, Client, PeerId, TypedEnvelope, User, UserStore};
use collections::{HashMap, HashSet};
use futures::StreamExt;
use gpui::{AsyncAppContext, Entity, ModelContext, ModelHandle, MutableAppContext, Task};

View File

@ -3,7 +3,6 @@ pub mod test;
pub mod channel;
pub mod http;
pub mod incoming_call;
pub mod user;
use anyhow::{anyhow, Context, Result};

View File

@ -1,10 +0,0 @@
use crate::User;
use std::sync::Arc;
#[derive(Clone)]
pub struct IncomingCall {
pub room_id: u64,
pub caller: Arc<User>,
pub participants: Vec<Arc<User>>,
pub initial_project_id: Option<u64>,
}

View File

@ -1,5 +1,4 @@
use call::ActiveCall;
use client::incoming_call::IncomingCall;
use call::{ActiveCall, IncomingCall};
use futures::StreamExt;
use gpui::{
elements::*,