diff --git a/crates/oxidetalis/src/websocket/handlers/chat_request.rs b/crates/oxidetalis/src/websocket/handlers/chat_request.rs index e9044c9..13fca2b 100644 --- a/crates/oxidetalis/src/websocket/handlers/chat_request.rs +++ b/crates/oxidetalis/src/websocket/handlers/chat_request.rs @@ -107,18 +107,6 @@ pub async fn handle_chat_response( return Some(WsError::NoChatRequestFromRecipient.into()); } - if let Some(conn_id) = ONLINE_USERS.is_online(sender_public_key).await { - ONLINE_USERS - .send( - &conn_id, - ServerEvent::chat_request_response(recipient_public_key, accepted), - ) - .await; - } else { - // TODO: Create a table for chat request responses, and send them when - // the user logs in - } - // We don't need to handle the case where the sender is blacklisted or // whitelisted already, just add it if it is not already there let _ = if accepted { @@ -132,5 +120,17 @@ pub async fn handle_chat_response( .await ); + if let Some(conn_id) = ONLINE_USERS.is_online(sender_public_key).await { + ONLINE_USERS + .send( + &conn_id, + ServerEvent::chat_request_response(recipient_public_key, accepted), + ) + .await; + } else { + // TODO: Create a table for chat request responses, and send them when + // the user logs in + } + None }