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.
This commit is contained in:
Benedikt Peetz 2023-07-26 21:15:53 +02:00
parent 363a0f8fc4
commit 80a8c9ccf5
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
1 changed files with 1 additions and 1 deletions

View File

@ -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) => {