Rename participants to guests in proto

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-09-21 18:30:49 +02:00
parent 1bd6cd0978
commit c90dc7235e
5 changed files with 10 additions and 13 deletions

View file

@ -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();

View file

@ -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(),
});
}
}

View file

@ -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)

View file

@ -30,7 +30,7 @@ pub struct Collaborator {
pub struct WorktreeMetadata {
pub root_name: String,
pub is_shared: bool,
pub participants: Vec<Arc<User>>,
pub guests: Vec<Arc<User>>,
}
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 })

View file

@ -345,5 +345,5 @@ message Collaborator {
message WorktreeMetadata {
string root_name = 1;
bool is_shared = 2;
repeated uint64 participants = 3;
repeated uint64 guests = 3;
}