This commit is contained in:
Max Brunsfeld
2021-08-06 14:47:18 -07:00
parent 4a32bd6bb0
commit ff822c9158
4 changed files with 45 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
use crate::rpc::Client;
use gpui::{Entity, ModelHandle, WeakModelHandle};
use std::{
collections::{HashMap, VecDeque},
sync::Arc,
};
pub struct ChannelList {
channels: HashMap<u64, WeakModelHandle<Channel>>,
rpc: Arc<Client>,
}
pub struct Channel {
id: u64,
name: String,
first_message_id: Option<u64>,
messages: Option<VecDeque<ChannelMessage>>,
rpc: Arc<Client>,
}
pub struct ChannelMessage {
id: u64,
}
enum Event {}
impl Entity for ChannelList {
type Event = Event;
}
impl ChannelList {}
+1
View File
@@ -1,4 +1,5 @@
pub mod assets;
pub mod channel;
pub mod editor;
pub mod file_finder;
pub mod fs;
+1
View File
@@ -29,6 +29,7 @@ pub struct Client {
pub struct ClientState {
connection_id: Option<ConnectionId>,
pub shared_worktrees: HashMap<u64, WeakModelHandle<Worktree>>,
pub channel_list: Option<WeakModelHandle<ChannelList>>,
pub languages: Arc<LanguageRegistry>,
}