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:
parent
363a0f8fc4
commit
80a8c9ccf5
|
@ -100,12 +100,12 @@ pub async fn handle(
|
||||||
Command::RoomMessageSend(msg) => {
|
Command::RoomMessageSend(msg) => {
|
||||||
if let Some(room) = app.status.room_mut() {
|
if let Some(room) = app.status.room_mut() {
|
||||||
room.send(msg.clone()).await?;
|
room.send(msg.clone()).await?;
|
||||||
|
send_status_output!("Sent message: `{}`", msg);
|
||||||
} else {
|
} else {
|
||||||
// TODO(@Soispha): Should this raise a lua error? It could be very confusing,
|
// TODO(@Soispha): Should this raise a lua error? It could be very confusing,
|
||||||
// when a user doesn't read the log.
|
// when a user doesn't read the log.
|
||||||
warn!("Can't send message: `{}`, as there is no open room!", &msg);
|
warn!("Can't send message: `{}`, as there is no open room!", &msg);
|
||||||
}
|
}
|
||||||
send_status_output!("Send message: `{}`", msg);
|
|
||||||
EventStatus::Ok
|
EventStatus::Ok
|
||||||
}
|
}
|
||||||
Command::Greet(name) => {
|
Command::Greet(name) => {
|
||||||
|
|
Reference in New Issue