Make ready payload send all users we have a relationship with.

This commit is contained in:
Paul Makles
2021-01-03 17:43:20 +00:00
parent ffff620508
commit b87f396f40
3 changed files with 68 additions and 4 deletions

View File

@@ -96,7 +96,19 @@ async fn accept(stream: TcpStream) {
subscriptions::generate_subscriptions(&user),
) {
send(ClientboundNotification::Authenticated);
send(ClientboundNotification::Ready { user });
match task::block_on(
user.generate_ready_payload()
) {
Ok(payload) => {
send(payload);
}
Err(_) => {
send(ClientboundNotification::Error(
WebSocketError::InternalError,
));
}
}
} else {
send(ClientboundNotification::Error(
WebSocketError::InternalError,