Make ready payload send all users we have a relationship with.
This commit is contained in:
@@ -33,7 +33,7 @@ pub enum ClientboundNotification {
|
||||
Error(WebSocketError),
|
||||
Authenticated,
|
||||
Ready {
|
||||
user: User
|
||||
users: Vec<User>
|
||||
},
|
||||
|
||||
/*MessageCreate {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user