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:
Antonio Scandurra 2022-09-29 17:24:31 +02:00
parent 1158911560
commit e0db62173a
13 changed files with 49 additions and 43 deletions

View file

@ -1,9 +1,9 @@
#[cfg(any(test, feature = "test-support"))]
pub mod test;
pub mod call;
pub mod channel;
pub mod http;
pub mod incoming_call;
pub mod user;
use anyhow::{anyhow, Context, Result};

View file

@ -2,7 +2,7 @@ use crate::User;
use std::sync::Arc;
#[derive(Clone)]
pub struct Call {
pub struct IncomingCall {
pub room_id: u64,
pub caller: Arc<User>,
pub participants: Vec<Arc<User>>,

View file

@ -1,5 +1,5 @@
use super::{http::HttpClient, proto, Client, Status, TypedEnvelope};
use crate::call::Call;
use crate::incoming_call::IncomingCall;
use anyhow::{anyhow, Context, Result};
use collections::{hash_map::Entry, BTreeSet, HashMap, HashSet};
use futures::{channel::mpsc, future, AsyncReadExt, Future, StreamExt};
@ -67,7 +67,10 @@ pub struct UserStore {
outgoing_contact_requests: Vec<Arc<User>>,
pending_contact_requests: HashMap<u64, usize>,
invite_info: Option<InviteInfo>,
incoming_call: (watch::Sender<Option<Call>>, watch::Receiver<Option<Call>>),
incoming_call: (
watch::Sender<Option<IncomingCall>>,
watch::Receiver<Option<IncomingCall>>,
),
client: Weak<Client>,
http: Arc<dyn HttpClient>,
_maintain_contacts: Task<()>,
@ -205,7 +208,7 @@ impl UserStore {
_: Arc<Client>,
mut cx: AsyncAppContext,
) -> Result<proto::Ack> {
let call = Call {
let call = IncomingCall {
room_id: envelope.payload.room_id,
participants: this
.update(&mut cx, |this, cx| {
@ -241,7 +244,7 @@ impl UserStore {
self.invite_info.as_ref()
}
pub fn incoming_call(&self) -> watch::Receiver<Option<Call>> {
pub fn incoming_call(&self) -> watch::Receiver<Option<IncomingCall>> {
self.incoming_call.1.clone()
}