From a80245c523ad8505e7d388802619857c6fc7ad98 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 554c91a..69c43e1 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 @@ -112,12 +112,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) => {