From 80a8c9ccf5616a04566b74148044fb47b591456f Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 26 Jul 2023 21:15:53 +0200 Subject: [PATCH] Fix(handlers::command): Only send success on real success The `room_message_send()` function told the user about a successful sent room message, even if that was not the case. --- src/tui_app/app/events/event_types/event/handlers/command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui_app/app/events/event_types/event/handlers/command.rs b/src/tui_app/app/events/event_types/event/handlers/command.rs index 953668f..bed3a46 100644 --- a/src/tui_app/app/events/event_types/event/handlers/command.rs +++ b/src/tui_app/app/events/event_types/event/handlers/command.rs @@ -100,12 +100,12 @@ pub async fn handle( Command::RoomMessageSend(msg) => { if let Some(room) = app.status.room_mut() { room.send(msg.clone()).await?; + send_status_output!("Sent message: `{}`", msg); } else { // TODO(@Soispha): Should this raise a lua error? It could be very confusing, // when a user doesn't read the log. warn!("Can't send message: `{}`, as there is no open room!", &msg); } - send_status_output!("Send message: `{}`", msg); EventStatus::Ok } Command::Greet(name) => {