fix(bonfire): Ready event should include user with online status true (if applicable)

This commit is contained in:
Paul Makles
2024-06-25 21:02:27 +01:00
parent 1d5dae4751
commit c5f4b94aa5
9 changed files with 24 additions and 8 deletions

View File

@@ -180,7 +180,7 @@ impl State {
.collect();
// Make sure we see our own user correctly.
users.push(user.into_self().await);
users.push(user.into_self(true).await);
// Set subscription state internally.
self.reset_state().await;
@@ -540,6 +540,20 @@ impl State {
}
}
EventV1::Message(message) => {
// Since Message events are fanned out to many clients,
// we must reconstruct the relationship value at this end.
if let Some(user) = &mut message.user {
user.relationship = self
.cache
.users
.get(&self.cache.user_id)
.expect("missing self?")
.relationship_with(&message.author)
.into();
}
}
_ => {}
}