Store online peers when joining a worktree

This commit is contained in:
Antonio Scandurra
2021-06-30 15:07:33 +02:00
parent 7704291432
commit 1d53d43d6f
3 changed files with 27 additions and 18 deletions
+7 -4
View File
@@ -47,14 +47,12 @@ message OpenWorktree {
message OpenWorktreeResponse {
Worktree worktree = 1;
uint32 replica_id = 2;
uint32 host_peer_id = 3;
repeated Peer peers = 3;
}
message AddGuest {
uint64 worktree_id = 1;
uint32 peer_id = 2;
uint32 replica_id = 3;
User user = 4;
Peer guest = 2;
}
message RemoveGuest {
@@ -62,6 +60,11 @@ message RemoveGuest {
uint32 peer_id = 2;
}
message Peer {
uint32 peer_id = 1;
uint32 replica_id = 2;
}
message OpenBuffer {
uint64 worktree_id = 1;
string path = 2;
+1 -1
View File
@@ -26,7 +26,7 @@ type BoxedWriter = Pin<Box<dyn AsyncWrite + 'static + Send>>;
type BoxedReader = Pin<Box<dyn AsyncRead + 'static + Send>>;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub struct ConnectionId(u32);
pub struct ConnectionId(pub u32);
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub struct PeerId(pub u32);