From c1df166700ab98bb04c66bda5ff4f6ed0bdacc60 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 24 Jan 2024 10:51:46 -0700 Subject: [PATCH] Allow completions of everyone in the call --- crates/channel/src/channel_store.rs | 1 - crates/collab_ui/src/chat_panel/message_editor.rs | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/crates/channel/src/channel_store.rs b/crates/channel/src/channel_store.rs index 6e58381d604a2c725343b60bd8f9acda8fc34539..59b69405a5c8dd5160e9d61d6fd8d64fb1370a94 100644 --- a/crates/channel/src/channel_store.rs +++ b/crates/channel/src/channel_store.rs @@ -118,7 +118,6 @@ pub struct MembershipSortKey<'a> { pub enum ChannelEvent { ChannelCreated(ChannelId), ChannelRenamed(ChannelId), - ChannelParticipantsChanged(ChannelId), } impl EventEmitter for ChannelStore {} diff --git a/crates/collab_ui/src/chat_panel/message_editor.rs b/crates/collab_ui/src/chat_panel/message_editor.rs index f6f609d572bf641cde049c1d742ede79d3c0d3f0..be5755ad5e213d961ec8dfab9232d3cda2195a13 100644 --- a/crates/collab_ui/src/chat_panel/message_editor.rs +++ b/crates/collab_ui/src/chat_panel/message_editor.rs @@ -155,14 +155,6 @@ impl MessageEditor { ); } - pub fn update_users(&mut self, users: &Vec>, cx: &mut ViewContext) { - self.channel_members.extend( - users - .into_iter() - .map(|user| (user.github_login.clone(), user.id)), - ); - } - pub fn take_message(&mut self, cx: &mut ViewContext) -> MessageParams { self.editor.update(cx, |editor, cx| { let highlights = editor.text_highlights::(cx); @@ -229,11 +221,11 @@ impl MessageEditor { let start_offset = end_offset - query.len(); let start_anchor = buffer.read(cx).anchor_before(start_offset); - let names = HashSet::new(); - for (github_login, _) in self.channel_members { + let mut names = HashSet::new(); + for (github_login, _) in self.channel_members.iter() { names.insert(github_login.clone()); } - if let Some(channel_id) = channel_id { + if let Some(channel_id) = self.channel_id { for participant in self.channel_store.read(cx).channel_participants(channel_id) { names.insert(participant.github_login.clone()); }