forked from lavina/lavina
1
0
Fork 0

add sender to ping response

This commit is contained in:
Nikita Vilunov 2023-07-22 16:22:49 +02:00
parent 1895084ded
commit 51d7278617
2 changed files with 3 additions and 2 deletions

View File

@ -203,7 +203,7 @@ pub enum JoinResult {
} }
/// Player update event type which is sent to a player actor and from there to a connection handler. /// Player update event type which is sent to a player actor and from there to a connection handler.
#[derive(Clone)] #[derive(Clone, Debug)]
pub enum Updates { pub enum Updates {
RoomTopicChanged { RoomTopicChanged {
room_id: RoomId, room_id: RoomId,

View File

@ -273,6 +273,7 @@ async fn handle_update(
rooms: &RoomRegistry, rooms: &RoomRegistry,
update: Updates, update: Updates,
) -> Result<()> { ) -> Result<()> {
log::debug!("Sending irc message to player {player_id:?} on update {update:?}");
match update { match update {
Updates::RoomJoined { Updates::RoomJoined {
new_member_id, new_member_id,
@ -378,7 +379,7 @@ async fn handle_incoming_message(
ClientMessage::Ping { token } => { ClientMessage::Ping { token } => {
ServerMessage { ServerMessage {
tags: vec![], tags: vec![],
sender: None, sender: Some(config.server_name.clone()),
body: ServerMessageBody::Pong { body: ServerMessageBody::Pong {
from: config.server_name.clone(), from: config.server_name.clone(),
token, token,