Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Open chat panel for guests
Conrad Irwinf0d490c67140
diff --git a/crates/call/src/call.rs b/crates/call/src/call.rsindex a37cc3bc789..72bb6a4e6e8 100644--- a/crates/call/src/call.rs+++ b/crates/call/src/call.rs@@ -442,8 +442,10 @@ impl ActiveCall {.location.as_ref().and_then(|location| location.upgrade());- let channel_id = room.update(cx, |room, cx| room.channel_id());- cx.emit(Event::RoomJoined { channel_id });+ let (channel_id, role) = room.update(cx, |room, _| {+ (room.channel_id(), room.local_participant().role)+ });+ cx.emit(Event::RoomJoined { channel_id, role });room.update(cx, |room, cx| room.set_location(location.as_ref(), cx))}} else {diff --git a/crates/call/src/room.rs b/crates/call/src/room.rsindex 6dae1e6a4d5..23a6ea4a1cd 100644--- a/crates/call/src/room.rs+++ b/crates/call/src/room.rs@@ -28,6 +28,7 @@ pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);pub enum Event {RoomJoined {channel_id: Option<u64>,+ role: proto::ChannelRole,},ParticipantLocationChanged {participant_id: proto::PeerId,diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rsindex bbe0a6b4fe3..a170f956978 100644--- a/crates/collab_ui/src/chat_panel.rs+++ b/crates/collab_ui/src/chat_panel.rs@@ -16,6 +16,7 @@ use menu::Confirm;use message_editor::MessageEditor;use project::Fs;use rich_text::RichText;+use rpc::proto;use serde::{Deserialize, Serialize};use settings::{Settings, SettingsStore};use std::sync::Arc;@@ -143,10 +144,14 @@ impl ChatPanel {this.subscriptions.push(cx.subscribe(&ActiveCall::global(cx),move |this: &mut Self, _, event: &room::Event, cx| match event {- room::Event::RoomJoined { channel_id } => {+ room::Event::RoomJoined { channel_id, role } => {if let Some(channel_id) = channel_id {this.select_channel(*channel_id, None, cx)- .detach_and_log_err(cx)+ .detach_and_log_err(cx);++ if *role == proto::ChannelRole::Guest {+ cx.emit(PanelEvent::Activate)+ }}}_ => {}