From c90dc7235eb0c6f00686af0275ad2cb2a6dc9d81 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 21 Sep 2021 18:30:49 +0200 Subject: [PATCH] Rename `participants` to `guests` in proto Co-Authored-By: Nathan Sobo --- server/src/rpc.rs | 5 +---- server/src/rpc/store.rs | 2 +- zed/src/people_panel.rs | 2 +- zed/src/user.rs | 12 ++++++------ zrpc/proto/zed.proto | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/server/src/rpc.rs b/server/src/rpc.rs index f957cbffa91613a3b360cdc87dc0cc295f5b8f82..51df8fea7a32c3126e29e680774529cf15f50036 100644 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -1947,10 +1947,7 @@ mod tests { .map(|w| { ( w.root_name.as_str(), - w.participants - .iter() - .map(|p| p.github_login.as_str()) - .collect(), + w.guests.iter().map(|p| p.github_login.as_str()).collect(), ) }) .collect(); diff --git a/server/src/rpc/store.rs b/server/src/rpc/store.rs index 15d2e6a920bc8b02e4426faefe3f2135402d70aa..f57e7ed59b8912766815be4acad79178a5fc1c7b 100644 --- a/server/src/rpc/store.rs +++ b/server/src/rpc/store.rs @@ -204,7 +204,7 @@ impl Store { host.worktrees.push(proto::WorktreeMetadata { root_name: worktree.root_name.clone(), is_shared: worktree.share().is_ok(), - participants: guests.into_iter().collect(), + guests: guests.into_iter().collect(), }); } } diff --git a/zed/src/people_panel.rs b/zed/src/people_panel.rs index 769b2d7d9b80d1e1690e457c557dc8db8749f8f8..26dbc19f74c00e49792ce3cc3a4198069439f6a4 100644 --- a/zed/src/people_panel.rs +++ b/zed/src/people_panel.rs @@ -146,7 +146,7 @@ impl PeoplePanel { .with_style(theme.worktree_name.container) .boxed(), ) - .with_children(worktree.participants.iter().filter_map(|participant| { + .with_children(worktree.guests.iter().filter_map(|participant| { participant.avatar.clone().map(|avatar| { Image::new(avatar) .with_style(theme.worktree_guest_avatar) diff --git a/zed/src/user.rs b/zed/src/user.rs index 1ed7a1662a4de1deda361049c062811fae80651f..32c271257fc49676ea54315eb17d452716e691c5 100644 --- a/zed/src/user.rs +++ b/zed/src/user.rs @@ -30,7 +30,7 @@ pub struct Collaborator { pub struct WorktreeMetadata { pub root_name: String, pub is_shared: bool, - pub participants: Vec>, + pub guests: Vec>, } pub struct UserStore { @@ -112,7 +112,7 @@ impl UserStore { collaborator .worktrees .iter() - .flat_map(|w| &w.participants) + .flat_map(|w| &w.guests) .copied(), ); } @@ -224,9 +224,9 @@ impl Collaborator { .await?; let mut worktrees = Vec::new(); for worktree in collaborator.worktrees { - let mut participants = Vec::new(); - for participant_id in worktree.participants { - participants.push( + let mut guests = Vec::new(); + for participant_id in worktree.guests { + guests.push( user_store .update(cx, |user_store, cx| { user_store.fetch_user(participant_id, cx) @@ -237,7 +237,7 @@ impl Collaborator { worktrees.push(WorktreeMetadata { root_name: worktree.root_name, is_shared: worktree.is_shared, - participants, + guests, }); } Ok(Self { user, worktrees }) diff --git a/zrpc/proto/zed.proto b/zrpc/proto/zed.proto index 340c0751aa3255a5fded2f7ab71a212c7322f9a0..be85fdecd6ba49235de13bb157c2610a7e22a21b 100644 --- a/zrpc/proto/zed.proto +++ b/zrpc/proto/zed.proto @@ -345,5 +345,5 @@ message Collaborator { message WorktreeMetadata { string root_name = 1; bool is_shared = 2; - repeated uint64 participants = 3; + repeated uint64 guests = 3; }