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
f7b161fb55
commit
a80245c523
|
@ -112,12 +112,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