forked from trinitrix/core
1
0
Fork 0

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 f7b161fb55
commit a80245c523
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
1 changed files with 1 additions and 1 deletions

View File

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