Fix nick from snapshot being ignored

This commit is contained in:
Joscha 2022-07-24 18:54:44 +02:00
parent e19ff7a622
commit 94a746f992

View file

@ -92,6 +92,10 @@ impl Joining {
fn joined(&self) -> Option<Joined> { fn joined(&self) -> Option<Joined> {
if let (Some(hello), Some(snapshot)) = (&self.hello, &self.snapshot) { if let (Some(hello), Some(snapshot)) = (&self.hello, &self.snapshot) {
let mut session = hello.session.clone();
if let Some(nick) = &snapshot.nick {
session.name = nick.clone();
}
let listing = snapshot let listing = snapshot
.listing .listing
.iter() .iter()
@ -99,7 +103,7 @@ impl Joining {
.map(|s| (s.id.clone(), s)) .map(|s| (s.id.clone(), s))
.collect::<HashMap<_, _>>(); .collect::<HashMap<_, _>>();
Some(Joined { Some(Joined {
session: hello.session.clone(), session,
account: hello.account.clone(), account: hello.account.clone(),
listing, listing,
}) })