feat: Chat request implementation #14

Manually merged
awiteb merged 55 commits from awiteb/chat-request-and-response into master 2024-07-18 14:21:39 +02:00 AGit
Showing only changes of commit 48acab2519 - Show all commits

View file

@ -130,7 +130,7 @@ impl OnlineUsersExt for OnlineUsers {
}
async fn send(&self, conn_id: &Uuid, event: ServerEvent<Unsigned>) {
if let Some((_, user)) = self.read().await.iter().find(|(c, _)| *c == conn_id) {
if let Some(user) = self.read().await.get(conn_id) {
awiteb marked this conversation as resolved
Review

use get

if let Some(user) = self.read().await.get(conn_id) {
// ...
}
use `get` ```rust if let Some(user) = self.read().await.get(conn_id) { // ... } ```
let _ = user
.sender
.unbounded_send(Ok(event.sign(&user.shared_secret).as_ref().into()));