WIP - Register client RPC handlers on app startup

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-02-15 18:03:06 -08:00
parent 1ca1595490
commit 71abea728e
6 changed files with 268 additions and 269 deletions

View file

@ -180,14 +180,17 @@ impl Entity for Channel {
}
impl Channel {
pub fn init(rpc: &Arc<Client>) {
rpc.add_entity_message_handler(Self::handle_message_sent);
}
pub fn new(
details: ChannelDetails,
user_store: ModelHandle<UserStore>,
rpc: Arc<Client>,
cx: &mut ModelContext<Self>,
) -> Self {
let _subscription =
rpc.add_entity_message_handler(details.id, cx, Self::handle_message_sent);
let _subscription = rpc.add_model_for_remote_entity(cx.handle(), details.id);
{
let user_store = user_store.clone();