Send a ShowContacts message the first time a user connects to collab

This commit is contained in:
Antonio Scandurra 2022-05-20 15:41:38 +02:00
parent 6f2c3f1e37
commit d8ee4378c9
5 changed files with 47 additions and 10 deletions

View file

@ -280,6 +280,11 @@ impl Server {
let _ = send_connection_id.send(connection_id).await;
}
if user.first_connection {
this.peer.send(connection_id, proto::ShowContacts {})?;
this.app_state.db.set_user_first_connection(user_id, false).await?;
}
let (contacts, invite_code) = future::try_join(
this.app_state.db.get_contacts(user_id),
this.app_state.db.get_invite_code_for_user(user_id)