Populate the user data of worktree collaborators

This will make it possible for us to render their avatars. Previously we only had the user ids. During rendering, everything needs to be available synchronously. So now, whenever collaborators are added, we perform the async I/O to fetch their user data prior to adding them to the worktree.
This commit is contained in:
Nathan Sobo 2021-11-26 20:35:50 -07:00
parent 9930e92412
commit b307a7e91d
5 changed files with 145 additions and 114 deletions

View file

@ -21,8 +21,8 @@ message Envelope {
UpdateBuffer update_buffer = 16;
SaveBuffer save_buffer = 17;
BufferSaved buffer_saved = 18;
AddPeer add_peer = 19;
RemovePeer remove_peer = 20;
AddCollaborator add_collaborator = 19;
RemoveCollaborator remove_collaborator = 20;
GetChannels get_channels = 21;
GetChannelsResponse get_channels_response = 22;
GetUsers get_users = 23;
@ -83,7 +83,7 @@ message LeaveWorktree {
message JoinWorktreeResponse {
Worktree worktree = 2;
uint32 replica_id = 3;
repeated Peer peers = 4;
repeated Collaborator collaborators = 4;
}
message UpdateWorktree {
@ -96,12 +96,12 @@ message CloseWorktree {
uint64 worktree_id = 1;
}
message AddPeer {
message AddCollaborator {
uint64 worktree_id = 1;
Peer peer = 2;
Collaborator collaborator = 2;
}
message RemovePeer {
message RemoveCollaborator {
uint64 worktree_id = 1;
uint32 peer_id = 2;
}
@ -196,7 +196,7 @@ message UpdateContacts {
// Entities
message Peer {
message Collaborator {
uint32 peer_id = 1;
uint32 replica_id = 2;
uint64 user_id = 3;