fix 2 msg when send from_user = to_user
Continuous integration / Check (push) Successful in 34s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / build (push) Successful in 55s
Continuous integration / build-release (push) Successful in 1m11s

This commit is contained in:
wt committed 2025-11-27 23:43:31 +07:00
1 parent ab25ef7ba8
commit 941afa2485
2 files changed
+2565 -2259

No files matched your search

+5 -3
View File
@@ -1374,9 +1374,11 @@ async fn handle_websocket(socket: WebSocket, state: Arc<AppState>) {
}
let users = recv_state.users.read().await;
if let Some(recipient_tx) = users.get(&chat_msg.to_user) {
let message_json = serde_json::to_string(&chat_msg).unwrap();
let _ = recipient_tx.send(Message::Text(message_json));
if chat_msg.to_user != chat_msg.from_user {
if let Some(recipient_tx) = users.get(&chat_msg.to_user) {
let message_json = serde_json::to_string(&chat_msg).unwrap();
let _ = recipient_tx.send(Message::Text(message_json));
}
}
if let Some(sender_tx) = users.get(&username) {
+2560 -2256
View File
File diff suppressed because it is too large. Load diff